CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Threaded View

  1. #1
    Join Date
    May 2011
    Posts
    6

    Unhappy SAX Parsing And Keeping Track Of Children

    Hi,
    I'm trying to parse a document using SAX for Java. I need to keep track of the parent of the children in an XML format that allows for infinite decendants. I need to keep track of the parent as I go through. When I find the root phase object, I need to create an object in the database, retrieve the ID of the stored object. When I get to the children I need to know who their parent is so I can set their parentID in the database. How do I keep track of the parent? I included an XML file and a diagram showing the hierarchy. If I go all the way down to B_level4, how do I know that B_level2 is the child of A_level1 and not A_level3?

    I was going to:
    - find the first phase and set it to current
    - Get the level below, set current to parent, and set the id to the current

    How do I deal with the infinite depth (having phases within phases) and keeping track of who the parent is?

    Thanks,
    Stan
    Attached Images Attached Images  
    Attached Files Attached Files

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured