[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

RE: Keys working on nodeset?

Subject: RE: Keys working on nodeset?
From: "Andrew Welch" <ajwelch@xxxxxxxxxxxxxxx>
Date: Mon, 25 Jul 2005 14:12:47 +0100
nodeset 2007 key
> <?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

Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.