On Sun, 11 Dec 2005, Daniel Veillard wrote:
> Just send the input XSL and input XML as attachments and describe what
> you're testing, that will be sufficient if no code change is needed then
> (i.e. assuming the ouptut from the current version works as you expect).
I've moved the XSL and XML from my previous post to attachments. I
believe the description is really one sentence:
Check that the match pattern of an xsl:key may contain a forward reference
to another xsl:key.
Thanks.
Joel
<?xml version="1.0" encoding="iso-8859-1"?>
<test>
<A>1.0</A>
<A>2.0</A>
<A>3.0</A>
<B>1.0</B>
<B>4.0</B>
<B>5.0</B>
</test>
<?xml version="1.0" encoding="iso-8859-1"?>
<xsl:transform
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
>
<xsl:output method="text" />
<xsl:key name="keyA" match="A" use="." />
<xsl:key name="keyAnotB" match="A[ not( key( 'keyB', . ) ) ]" use = "." />
<xsl:key name="keyB" match="B" use="." />
<xsl:variable name="AnotB" select="//A[ not( key( 'keyB', . ) ) ]" />
<xsl:template match="/">
<xsl:text>A: </xsl:text>
<xsl:for-each select="//A">
<xsl:call-template name="print_membership" />
</xsl:for-each>
<xsl:text>B: </xsl:text>
<xsl:for-each select="//B">
<xsl:call-template name="print_membership" />
</xsl:for-each>
<xsl:text>AnotB: </xsl:text>
<xsl:for-each select="$AnotB">
<xsl:call-template name="print_membership" />
</xsl:for-each>
</xsl:template>
<xsl:template name="print_membership">
<xsl:text> </xsl:text><xsl:value-of select="." />
<xsl:text>: A=</xsl:text>
<xsl:value-of select="count( key( 'keyA', . ) )" />
<xsl:text>, B=</xsl:text>
<xsl:value-of select="count( key( 'keyB', . ) )" />
<xsl:text>, AnotB=</xsl:text>
<xsl:value-of select="count( key( 'keyAnotB', . ) )" />
<xsl:text> </xsl:text>
</xsl:template>
</xsl:transform>
_______________________________________________
xslt mailing list, project page http://xmlsoft.org/XSLT/
[email protected]
http://mail.gnome.org/mailman/listinfo/xslt