|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] Re: Spotting "cousin marriages" in a tree
David Carlisle wrote:
All that is stopping me is that XSLT doesn't - as far as I know - allow for keys to be used on exsl:node-set()s, Thanks for the suggestion David. But I can't get it to work. Here's my test code: <xsl:transform version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:exsl="http://exslt.org/common" extension-element-prefixes="exsl"> <xsl:key name="k" match="a" use="@x"/> <xsl:template match="/">
<xsl:variable name="v">
<n>
<a x="1" y="A"/>
<a x="2" y="B"/>
</n>
</xsl:variable>
<xsl:apply-templates select="exsl:node-set($v)/*"/>
</xsl:template> <xsl:template match="n">
<!-- <xsl:apply-templates select="a[@x='1']"/> -->
<xsl:apply-templates select="key('k','1')"/>
</xsl:template> <xsl:template match="a">
<xsl:value-of select="@y"/>
</xsl:template></xsl:transform> I get no output. But when I use the non-key lookup (commented out) I get "A", as expected. This is with libxslt's xsltproc: $ xsltproc --version Using libxml 20610, libxslt 10105 and libexslt 804 Does it work correctly on other processors? --Phil.
|
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








