473,394 Members | 1,751 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

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 1443
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:stylesheet ... xmlns:my="http://my.com">
<my:Parameters>
<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="document('')/*/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!PLEASEtkachenko.com> wrote in message
news:Ob**************@TK2MSFTNGP09.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:stylesheet ... xmlns:my="http://my.com">
<my:Parameters>
<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="document('')/*/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
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...
3
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...
2
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...
8
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...
0
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...
6
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...
0
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...
5
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...
3
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: ...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
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,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.