Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

exslt set:distinct template order

Status
Not open for further replies.

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=&quot;set:distinct&quot;>
<xsl:param name=&quot;nodes&quot; select=&quot;/..&quot; />
<xsl:choose>
<xsl:when test=&quot;not($nodes)&quot; />
<xsl:eek:therwise>
<xsl:apply-templates select=&quot;$nodes[1][not(. = $nodes[position() > 1])]&quot; mode=&quot;set:distinct&quot;/>
<xsl:call-template name=&quot;set:distinct&quot;>
<xsl:with-param name=&quot;nodes&quot; select=&quot;$nodes[position() > 1]&quot; />
</xsl:call-template>
</xsl:eek:therwise>
</xsl:choose>
</xsl:template>

and the following call to it:

<xsl:variable name=&quot;distinctVnames&quot;>
<xsl:call-template name=&quot;set:distinct&quot;>
<xsl:with-param name=&quot;nodes&quot; select=&quot;//@vname&quot; />
</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!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top