473,785 Members | 2,434 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Possible to include other tags in a XSLT file?

Is it possible to include addition tags in a XSLT file, that the XSLT
processor will, for all practical purposes, ignore?

What I'm looking to do is to include a section to contain information
regarding what parameters the XSLT file is expecting. Then my program can
retrieve the information from the style sheet and prompt the user for the
necessary parameters. I'm envisioning the section would be something like
this:

<myParameters >
<Param name="City" prompt="City to search for" />
<Param name="State" prompt="State to search for" />
</myParameters>

TIA,

Richard Rosenheim
Nov 12 '05 #1
2 1460
Richard L Rosenheim wrote:
Is it possible to include addition tags in a XSLT file, that the XSLT
processor will, for all practical purposes, ignore?

What I'm looking to do is to include a section to contain information
regarding what parameters the XSLT file is expecting. Then my program can
retrieve the information from the style sheet and prompt the user for the
necessary parameters. I'm envisioning the section would be something like
this:

<myParameters >
<Param name="City" prompt="City to search for" />
<Param name="State" prompt="State to search for" />
</myParameters>


Sure you can do it. XSLT spec explicitly allows elements in non-XSLT
namespaces (excluding empty namespace) to be at stylesheet's top level
(children of xsl:stylesheet) . That's quite common XSLT technique usually
called embedded lookup table:

<xsl:styleshe et ... xmlns:my="http://my.com">
<my:Parameter s>
<Param name="City" prompt="City to search for" />
<Param name="State" prompt="State to search for" />
</my:Parameters>
....

And then you can query this embedded XML content using document()
function with empty string as an argument:

<xsl:variable name="term" select="'City'"/>
<xsl:value-of
select="documen t('')/*/my:Parameters/Param[@name=$term]/@prompt"/>

--
Oleg Tkachenko [XML MVP, MCP]
http://blog.tkachenko.com
Nov 12 '05 #2
Thanks..it works (after correcting my typing mistakes :) ) !

Richard Rosenheim
"Oleg Tkachenko [MVP]" <oleg@NO!SPAM!P LEASEtkachenko. com> wrote in message
news:Ob******** ******@TK2MSFTN GP09.phx.gbl...
Richard L Rosenheim wrote:
Is it possible to include addition tags in a XSLT file, that the XSLT
processor will, for all practical purposes, ignore?

What I'm looking to do is to include a section to contain information
regarding what parameters the XSLT file is expecting. Then my program can retrieve the information from the style sheet and prompt the user for the necessary parameters. I'm envisioning the section would be something like this:

<myParameters >
<Param name="City" prompt="City to search for" />
<Param name="State" prompt="State to search for" />
</myParameters>


Sure you can do it. XSLT spec explicitly allows elements in non-XSLT
namespaces (excluding empty namespace) to be at stylesheet's top level
(children of xsl:stylesheet) . That's quite common XSLT technique usually
called embedded lookup table:

<xsl:styleshe et ... xmlns:my="http://my.com">
<my:Parameter s>
<Param name="City" prompt="City to search for" />
<Param name="State" prompt="State to search for" />
</my:Parameters>
...

And then you can query this embedded XML content using document()
function with empty string as an argument:

<xsl:variable name="term" select="'City'"/>
<xsl:value-of
select="documen t('')/*/my:Parameters/Param[@name=$term]/@prompt"/>

--
Oleg Tkachenko [XML MVP, MCP]
http://blog.tkachenko.com

Nov 12 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
2135
by: Aeon Twilight | last post by:
REFERENCE: http://us4.php.net/manual/en/function.include.php Example 16-7. include() through HTTP Example 16-10. include() and the return() statement -------------------- return.php -------------------- <?php
3
3870
by: VBH | last post by:
This is probably a silly question but... I have an XML file which processes quite happily with XSL when opened on its own. However, I just want to include it in an ASP file. But when I do an SSI, the XML is not reformatted by the XSL. As in: <!-- #INCLUDE FILE="2003-06.XML" -->
2
3228
by: Keith Chadwick | last post by:
I have been running some tests with regards to xsl:include and xsl:import with the same results on both and I am wondering if someone can explain this behavior to me! First off the xslt file is being loaded as in dim myXSLT as new XslTransform() myXSLT.load("scripts/clnt.home.body.xslt") The load craps out when I change the xsl:include, tried all of the following
8
6021
by: Kathleen Dollard | last post by:
Hi, Oleg's answer about attribute value templates led me to look back at a different problem, and wonder if someone else had solved it. I want to output an ASP.NET page. Thus I need to output ASP.NET tags and HTML tags. <%@ Page Language= etc...
0
1097
by: GearsR4Girls | last post by:
I wish to use custom tags for NDoc. I recognise i need to have a template xslt file whose path is specified in NDoc under the ExtensibilityStyleSheet heading. I have copied the XSLT from the NDoc documentation and pasted it into notepad, saving as a .xslt file. Unfortunately when i build the NDoc assembly i get a whole load of exception errors. It works fine without the file, of course there are no custom tags, but it does build. So then,...
6
2926
by: Gideon de Swardt | last post by:
I am trying to do a server side transformation using an xsl:include in my xslt stylesheet. The include stylesheet is stored /Library/abo.Library.xslt and is included in multiple xslts, one example would be /Valuation/ValuationSelect.xslt which is also used on the client side via JavaScript and MSXML2.FreeThreadedDOMDocument.4.0. Client side the include and transformation without any problems but it is when I am trying to do the...
0
1240
by: paul.rusu | last post by:
My XSL file contains both <xsl: ..> <fo:..> tags. How to output get the <FO:..> TAGS NOT INTERPRETED. I just want to them to be outputed as normal text in the resulting file. I am using altovaxml 2006 free tool. The XSLT operation is supposed to result a XSL:FO file from a XHTML. Now the XSLT doesn't output the XSL:FO tags at all. Paul
5
1881
by: Thierry | last post by:
Let's say I have the following tags in an xml: <World> <Country>Canada</Country> <Hemisphere>North</Hemisphere> <Weather climate="cold" forecast="snow"> <CommandAction>$(HOME)\calculate.py Canada North snow</CommandAction> </Weather>
3
3598
by: Simon Brooke | last post by:
I'm trying to do internationalisation by using xsl:include to include a different file depending on the locale setting, and I'm completely failing. I've tried several different approaches: <xsl:include href="concat( 'i18n-', $locale, '-include.xslt)"/> fails with XSLT compile error: FileNotFoundException
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10325
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10147
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8972
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7499
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6739
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4050
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3645
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.