incrementing

Discussion in 'XML' started by David Schwartz, Jul 1, 2008.

  1. I need to create unique id's for DIVs for each instance of <foo>
    within each instance of <bar> as follows. I iterate through both the
    bars and foos via <apply-templates/>. I've tried to use position() but
    that reflects the current <bar>, not the current <foo> (the id for the
    first DIV on the second page turns out to be 'foo2').

    I'd appreciate any ideas!

    TIA,
    David

    ========= sample xml ================
    <!-- note the there may be other peer elements to the FOOs -->
    <root>
    <bar>
    <foo>blah, blah, blah</foo>
    <foo>bebop, smooth, cool, swing, super cool</foo>
    </bar>
    <bar>
    <foo>baroque, classical, modern</foo>
    <foo>chicago, delta</foo>
    </bar>
    </root>
    ==================================

    ========= sample html ================
    page generated for the first <bar> instance:
    <html>
    <body>
    <div id="foo1">blah, blah, blah</div>
    <div id="foo2">bebop, smooth, cool, swing, super cool</
    div>
    </body>
    </html>

    page generated for the second <bar> instance:
    <html>
    <body>
    <div id="foo1">baroque, classical, modern</div>
    <div id="foo2">chicago, delta</div>
    </body>
    </html>
    =================================
     
    David Schwartz, Jul 1, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Josh Graham
    Replies:
    3
    Views:
    23,235
    Nicolas Matringe
    Apr 7, 2004
  2. Salman

    Incrementing value test

    Salman, Apr 13, 2005, in forum: VHDL
    Replies:
    2
    Views:
    637
    Engineering Guy
    Apr 13, 2005
  3. Mothra
    Replies:
    3
    Views:
    435
  4. Ron
    Replies:
    0
    Views:
    313
  5. =?Utf-8?B?bWVraW0=?=

    Incrementing Assembly Version?

    =?Utf-8?B?bWVraW0=?=, Oct 28, 2004, in forum: ASP .Net
    Replies:
    5
    Views:
    7,324
    Saravana
    Oct 29, 2004
Loading...

Share This Page