Node Grouping

B

Brad Foster

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
 
P

Phil Hanna

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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top