Node Grouping

Discussion in 'Java' started by Brad Foster, Oct 22, 2003.

  1. Brad Foster

    Brad Foster Guest

    How do I do this


    <Document>
    <Title value=1>
    <Chapter value=1/>
    <Part value=1/>
    <Part value=2/>
    <Part value=3/>
    <Chapter value=2/>
    <Chapter value=3/>
    <Chapter value=4/>
    <Chapter value=5/>
    <Title>
    <Title value=2>
    <Chapter value=1/>
    <Part value=1/>
    <Part value=2/>
    <Part value=3/>
    <Chapter value=2/>
    <Chapter value=3/>
    <Chapter value=4/>
    <Chapter value=5/>
    <Title>
    </Document>

    How can I gather all titles and then all chapters ie Chapter 1, Chapter 2,
    Chapter 3, Chapter 4, Chapter 5 of Title 1 and Chapter 1, Chapter 2, Chapter
    3, Chapter 4, Chapter 5 of Title 2 and do this recursively

    That is, I should do a breadth first traversal(which I have done)...now all
    I need is to group by a parent
     
    Brad Foster, Oct 22, 2003
    #1
    1. Advertising

  2. Brad Foster

    Phil Hanna Guest

    On Wed, 22 Oct 2003 14:18:06 -0400, "Brad Foster"
    <> wrote:

    >How do I do this


    What's your context? Are you talking about using Java with DOM/SAX or
    something else? XSLT works well for something like this, and you can
    call it easily with javax.xml.transform.*. If you can post some more
    details, I might be able to help.
    --
    Phil Hanna
    Author of JSP 2.0: The Complete Reference
    http://www.philhanna.com
     
    Phil Hanna, Oct 23, 2003
    #2
    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. wolf
    Replies:
    0
    Views:
    565
  2. Replies:
    0
    Views:
    1,587
  3. Replies:
    0
    Views:
    381
  4. discomiller
    Replies:
    1
    Views:
    509
    Paul R
    Feb 1, 2005
  5. Tjerk Wolterink
    Replies:
    2
    Views:
    1,467
    Dimitre Novatchev
    Aug 24, 2006
Loading...

Share This Page