|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Keys working on nodeset?
> <?xml version="1.0" encoding="iso-8859-1" ?>
> <xsl:stylesheet version="1.0"
> xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> <xsl:param name="Input" select="''"/>
> <xsl:key name="key-test" match="Something" use="some-attribute"/>
>
> <xsl:template match="/">
> <xsl:for-each select="$Input/Root-element">
> <xsl:for-each select="key('key-test',Something/@some-attribute)">
> Do something
> </xsl:for-each>
> <xsl:for-each>
> </xsl:template>
> </xsl:stylesheet>
This is interesting in that you want to key on a document that is passed
in as a parameter. This should work fine, but I've certainly never done
it. Instead, I pass the XML into the stylesheet as a string and then
use the extension saxon:parse() on it to create a nodeset. This is
simpler than doing the work in the host language.
This is useful when the XML that is passed in as a paramter is created
dynamically, if the document already exists at the end of a url you
should use the document() function - isn't that sufficient for what you
need here?
Cheers
andrew
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|

Cart








