Altova Mailing List Archives

Re: [xsl] Numbering similar nodes sequentially in the output

From: "Mark" <mark@--------.--->
To: <xsl-list@-----.------------.--->
Date: 10/13/2011 12:52:00 AM
It worked out beautifully! The code is ugly because I write each <Formats> 
attribute-name to its own variable, but then adding seperate sequence 
numbers as I write them to the output is a snap!

Thanks for the great hint,

-----Original Message----- 
From: G. Ken Holman
Sent: Wednesday, October 12, 2011 2:07 PM
To: xsl-list@l...
Subject: Re: [xsl] Numbering similar nodes sequentially in the output

At 2011-10-12 13:59 -0700, you wrote:
>My gut feeling is that thee is no helpful pattern in selecting the members 
>of the output. Building a temporary tree is just the thing. I had no idea 
>that I could do that. I'll do some reading up on them and try it.

Along the lines of:

   <xsl:variable name="intermediate">
   <xsl:apply-templates mode="augment-result" select="$intermediate"/>

   <xsl:template mode="augment-result" match="Formats">
     <xsl:attribute name="label" select="position()"/>

Or grouping, or whatever ... just treat $intermediate as your
second-pass input.  I suggest a different mode so that your template
rules for creating $intermediate are not engaged when processing 

>On another topic, thanks for the lead on the Crane publications.

You are most welcome.  The announcement even led to some sales of our
XSLT interactive DVD that I didn't mention:

. . . . . . . . . Ken

Contact us for world-wide XML consulting and instructor-led training
Crane Softwrights Ltd.  
G. Ken Holman                   mailto:gkholman@C...
Google+ profile:
Legal business disclaimers:

XSL-List info and archive:
To unsubscribe, go to:
or e-mail: <mailto:xsl-list-unsubscribe@l...>

XSL-List info and archive:
To unsubscribe, go to:
or e-mail: <mailto:xsl-list-unsubscribe@l...>


These Archives are provided for informational purposes only and have been generated directly from the Altova mailing list archive system and are comprised of the lists set forth on Therefore, Altova does not warrant or guarantee the accuracy, reliability, completeness, usefulness, non-infringement of intellectual property rights, or quality of any content on the Altova Mailing List Archive(s), regardless of who originates that content. You expressly understand and agree that you bear all risks associated with using or relying on that content. Altova will not be liable or responsible in any way for any content posted including, but not limited to, any errors or omissions in content, or for any losses or damage of any kind incurred as a result of the use of or reliance on any content. This disclaimer and limitation on liability is in addition to the disclaimers and limitations contained in the Website Terms of Use and elsewhere on the site.