[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Who can give me tech info about xsl:key and key()? (wa
Hi xsl:key/key()-experts, I've seen more of these XSL's as shown below and I'm surprised that they work. Could someone give me more technical info about how it works? What surprises me is that you declare an xsl:key at the top of the XSL, for a second XML-file which is to be read by the document()-function. So is it possible to use xsl:key for multiple XML's and how do you use the key()-function then? And when is the key-table build, what is its scope and how must I imagine such a table (if it is one)? Greetings Rene { @ @ } ^ \__/ "You don't need eyes to see, you need vision!" -----Oorspronkelijk bericht----- Van: Dimitre Novatchev [SMTP:dnovatchev@xxxxxxxxx] Verzonden: dinsdag 10 juli 2001 12:53 Aan: gaston_annebicque@xxxxxxxxx CC: xsl-list@xxxxxxxxxxxxxxxxxxxxxx Onderwerp: Re: Lookup in a xml file with a key <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> <xsl:output indent="yes" omit-xml-declaration="yes"/> <xsl:key name="kLookup" match="name" use="../abbr"/> <xsl:template match="/"> <out> <xsl:apply-templates select="in/country"/> <xsl:text>
</xsl:text> </out> </xsl:template> <xsl:template match="country"> <xsl:variable name="input" select="."/> <xsl:for-each select="document('lookup2.xml')"> <xsl:for-each select="key('kLookup',$input)"> <xsl:text>
</xsl:text> <xsl:value-of select="."/> </xsl:for-each> </xsl:for-each> </xsl:template> </xsl:stylesheet> XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|
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
|