[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

Subject: Who can give me tech info about xsl:key and key()? (was: Lookup in a xml file with a key)
From: Rene de Vries <RdVries@xxxxxxxxxxx>
Date: Tue, 10 Jul 2001 15:24:06 +0200
the 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>&#xA;</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>&#xA;</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


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.