java - SAX Parser having parent and child tags similar -


i using sax parser parse xml has parent , children tags this:

<a name="parent"  level="0">     <a name="child" level="0">         <a name="subchild01" level="1">             <a name="subchild11" level="1">             </a>         </a>         <a name="subchild11" level="1">         </a>     </a>     <a name="child2" level="0">         <a name="subchild02" level="1">         </a>     </a> </a> 

code

class node{     list<integer> childnodeid=new arraylist<integer>(); } 

to save childnodes id immediate subsequent parent. how can achieved?

with vast majority of sax applications, have maintain stack. push information onto stack when notified of startelement, , pop stack on endelement events. can find information relevant parent of current element peek() @ top of stack.


Comments

Popular posts from this blog

java - activate/deactivate sonar maven plugin by profile? -

python - TypeError: can only concatenate tuple (not "float") to tuple -

java - What is the difference between String. and String.this. ? -