Subject: Re: [xsl] keys vs. parameters From: David Carlisle <davidc@xxxxxxxxx> Date: Fri, 7 Jun 2002 20:31:52 +0100 |
> From what I understand, there is no > way of building a key on the external document (results from document()) or > a nodeset returned from an extension? If you use xsl:key then (separate) key tables are made for that match in _every_ document processed (conceptually, the system probably has optimisations so it doesn't produce tables that are never used). when you use key('foo','bar') it looks up bar in the foo table associated with the current document. So you just need to make sure you are in the document that you want, so <xsl:for-each select="document(...) "><!-- or xx:node-set() or ...--> <xsl:value-of select="key('foo','bar')"/> note the for-each here is just iterating over a list of size 1 root node, just to move the context document so key does the right thing. Just to show XPath2 is not entirely an ugly blot on the landscape I could point out that xpath2 should allow a slightly saner syntax of <xsl:value-of select="document(..)/key('foo','bar')"/> David _____________________________________________________________________ This message has been checked for all known viruses by Star Internet delivered through the MessageLabs Virus Scanning Service. For further information visit http://www.star.net.uk/stats.asp or alternatively call Star Internet for details on the Virus Scanning Service. XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
Current Thread |
---|
|
<- Previous | Index | Next -> |
---|---|---|
[xsl] keys vs. parameters, Hunsberger, Peter | Thread | RE: [xsl] keys vs. parameters, Michael Kay |
Re: [xsl] Newbie: See if a node exi, David Carlisle | Date | Re: [xsl] Re: xsl to HTML, Rajesh . Jayabalan |
Month |