Reg:parsing design
Hi i've have alredy posted this under java/xml but no reponse ..not sure if i can post here .. and i need help with the design not code
want to know the right approach for the design .
This is wat my input xml going to be
<xpTransactions>
<transList>
<xpTrans name="ADD_AG">
<childTrans>ADD_ED</childTrans>
<childTrans>ADD_CD</childTrans>
</xpTrans>
<xpTrans name="ADD_ED">
< actionIntf>add_r</actionIntf>
<actionIntf>add_ml</actionIntf>
<actionIntf>sub_mlk</actionIntf>
</xpTrans>
<xpTrans name="ADD_CD">
<actionIntf>add_rkm</actionIntf>
<actionIntf>sub_mlcd</actionIntf>
<actionIntf>sub_mlki</actionIntf>
</xpTrans>
</transList>
</xpTransactions >
input to the java program will be xpTrans name so for eg when the input is ADD_AG i need to check whether it has any child and if it is then nee dto get all the elements underneath it ..so in this case we have two chilsd elements so the output should be
ADD_AG
ADD_ED
add_r
add_ml
sub_mlk
Add_CD
add_rkm
sub_mlcd
sub_mlki
when the input string is goin to be ADD_ED ( this does not have any child so )the output is just need to take all its child only
ADD_ED
add_r
add_ml
sub_mlk
Is it possible to produce a tree structure with above xml ?
if yes then use Jdom and create a tree structure and then store each node and its contents in alist ...is this approach corerct .
or shld i use other parseer and instead of producing tree structure jus store it in array or linked list and then manupalate it .what is the right approach to take ..thanks for the help

