Guest_imported
New member
- Jan 1, 1970
- 0
Hi, I have the following XSL code:
The set:distinct template from exslt.org:
<xsl:template name="set:distinct">
<xsl
aram name="nodes" select="/.." />
<xsl:choose>
<xsl:when test="not($nodes)" />
<xsl
therwise>
<xsl:apply-templates select="$nodes[1][not(. = $nodes[position() > 1])]" mode="set:distinct"/>
<xsl:call-template name="set:distinct">
<xsl:with-param name="nodes" select="$nodes[position() > 1]" />
</xsl:call-template>
</xsl
therwise>
</xsl:choose>
</xsl:template>
and the following call to it:
<xsl:variable name="distinctVnames">
<xsl:call-template name="set:distinct">
<xsl:with-param name="nodes" select="//@vname" />
</xsl:call-template>
</xsl:variable>
After this the call variable value is a string with all distinct vname attributes of my xml document. thats fine. But the vname attributes appear in the result string in document order.
Does anybody have an idea how to change this in order to obtain the vname attributes in alphabetical order? Thank you very much!
The set:distinct template from exslt.org:
<xsl:template name="set:distinct">
<xsl
<xsl:choose>
<xsl:when test="not($nodes)" />
<xsl
<xsl:apply-templates select="$nodes[1][not(. = $nodes[position() > 1])]" mode="set:distinct"/>
<xsl:call-template name="set:distinct">
<xsl:with-param name="nodes" select="$nodes[position() > 1]" />
</xsl:call-template>
</xsl
</xsl:choose>
</xsl:template>
and the following call to it:
<xsl:variable name="distinctVnames">
<xsl:call-template name="set:distinct">
<xsl:with-param name="nodes" select="//@vname" />
</xsl:call-template>
</xsl:variable>
After this the call variable value is a string with all distinct vname attributes of my xml document. thats fine. But the vname attributes appear in the result string in document order.
Does anybody have an idea how to change this in order to obtain the vname attributes in alphabetical order? Thank you very much!