[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Numbering similar nodes sequentially in the output

Subject: Numbering similar nodes sequentially in the output
From: "Mark" <mark@xxxxxxxxxxxx>
Date: Wed, 12 Oct 2011 13:32:17 -0700
 Numbering similar nodes sequentially in the output
I suspect this cannot be done, but will ask. Is it possible to sequentially number similar nodes in the output? For instance, part of my current output is:

<FormatPage souvenir-sheet="365">
  <FormatButtons>
    <Formats se-tenant="365"/>
    <Formats coupon="367"/>
    <Formats coupon="368"/>
  </FormatButtons>
</FormatPage>

I would like to make that
<FormatPage souvenir-sheet="365">
  <FormatButtons>
    <Formats se-tenant="365"/>
    <Formats label='1' coupon="367"/>
    <Formats label="2" coupon="368"/>
  </FormatButtons>
</FormatPage>

or, for a more complex example, an output of
<FormatPage souvenir-sheet="365">
  <FormatButtons>
    <Formats label='1' se-tenant="365"/>
   <Formats label='2' se-tenant="367"/>
    <Formats label='1' coupon="367"/>
    <Formats label='2' coupon="368"/>
  </FormatButtons>
</FormatPage>

That is, inserting a sequential label attribute in the <Formats> that have the same attribute. The original position() of the <Formats> in the input file is most likely irrelevant and misleading, and I suspect trying to count the different input <Formats> may be just as useless. My only interest is in sequentially numbering multiple <Formats> bearing the same attribute. If this might be possible, I can submit for a selected set of sample inputs, the output and current stylesheet. Otherwise, I'll just give up on it. Only se-tenant and coupon attributes require this treatment.
Thanks,
Mark


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.