[XSL-LIST Mailing List Archive Home] [By Thread] [By Date]

Re: [xsl] Concatenating a nodeset (set of attributes)


Subject: Re: [xsl] Concatenating a nodeset (set of attributes)
From: Anton Triest <anton@xxxxxxxx>
Date: Mon, 10 Oct 2005 23:45:49 +0200

Just a thought - couldn't you just use multiple sort keys? Like

<xsl:template match="TOC">
 <xsl:apply-templates select="STRUCT">
   <xsl:sort select="@pos" data-type="number"/>
   <xsl:sort select="STRUCT/@pos" data-type="number"/>
   <xsl:sort select="STRUCT/STRUCT/@pos" data-type="number"/>
   <xsl:sort select="STRUCT/STRUCT/STRUCT/@pos" data-type="number"/>
   ...
 </xsl:apply-templates>
</xsl:template>

HTH!
Anton


Geert Josten wrote:


The depth of the STRUC elements is arbitrary.


If you know there is a resonable limit to the recusion depth you could do the following:

<xsl:sort select="number(concat(@pos, '.', STRUCT/@pos, STRUCT/STRUCT/@pos, STRUCT/STRUCT/STRUCT/@pos, ...)" data-type="number" />

Otherwise I would suggest a multistep process or refering to extensions..

HTH,
Geert


Current Thread