|
Subject: Re: [xsl] Spotting "cousin marriages" in a tree From: Phil Endecott <spam_from_xslt_list@xxxxxxxxxxxx> Date: Thu, 29 Jul 2004 13:13:36 +0100 |
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,
keys, once set up, automatically apply, separately, to any document that is used and so if your exsl:node-set() returns a node set consisting of a root node / which it will if it is given a result tree fragment coming from xsl:variable, then your keys will apply to that.
<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: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>$ xsltproc --version Using libxml 20610, libxslt 10105 and libexslt 804
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| Re: [xsl] Spotting "cousin marriage, David Carlisle | Thread | Re: [xsl] Spotting "cousin marriage, David Carlisle |
| RE: [xsl] Merging and sorting multi, Herve Dubreuil | Date | Re: [xsl] Merging and sorting multi, David Carlisle |
| Month |