Skip to Content.
Sympa Menu

xom-interest - Re: [XOM-interest] Recursion

xom-interest AT lists.ibiblio.org

Subject: XOM API for Processing XML with Java

List archive

Chronological Thread  
  • From: Elliotte Rusty Harold <elharo AT metalab.unc.edu>
  • To: jcowan AT reutershealth.com
  • Cc: xom-interest AT lists.ibiblio.org
  • Subject: Re: [XOM-interest] Recursion
  • Date: Tue, 9 Mar 2004 11:53:04 -0500

At 4:06 PM -0500 3/8/04, jcowan AT reutershealth.com wrote:
0) Move to the root node.
1) Process the current node.
2) If the current node has a child:
move to the first child, go to step 1.
3) If the current node has a rightward sibling:
move to the rightward sibling, go to step 1.
4) If the current node has a parent:
move to the parent, go to step 2.
5) Done.


This algorithm needs to be adjusted somewhat for the serialization use case.
The key difference is that a serializer needs to process an element twice, once for the start-tag before the children are processed and once for the end-tag after the children are processed.
--

Elliotte Rusty Harold
elharo AT metalab.unc.edu
Effective XML (Addison-Wesley, 2003)
http://www.cafeconleche.org/books/effectivexml
http://www.amazon.com/exec/obidos/ISBN%3D0321150406/ref%3Dnosim/cafeaulaitA




Archive powered by MHonArc 2.6.24.

Top of Page