Subject: Re: distinct values
From: David Carlisle <davidc@xxxxxxxxx>
Date: Tue, 8 Jun 1999 17:17:45 +0100 (BST)
|
> Is there a solution that works in the Microsoft implementation?
don't know.
> Is there a way to do this in the current draft without using variables?
why no variables?
Anyway this solution uses one variable and produces
bash-2.01$ xt u.xml ns.xsl
[[nodeA]]
[[nodeB]]
[[nodeC]]
[[nodeD]]
bash-2.01$
on your sample input.
David
<xsl:stylesheet
xmlns:xsl="http://www.w3.org/XSL/Transform/1.0"
result-ns="">
<xsl:template match="root">
<xsl:apply-templates select="*"/>
</xsl:template>
<xsl:template match="*">
<xsl:variable name="x" expr="qname(.)"/>
<xsl:if test="not(from-preceding-siblings(*[qname(.)=$x]))">
[[<xsl:value-of select="qname(.)"/>]]
</xsl:if>
</xsl:template>
</xsl:stylesheet>
XSL-List info and archive: http://www.mulberrytech.com/xsl/xsl-list
|