S
sivga
Hi all i wan to whether the right approach for the design is corerct.
this is wat my input xml going to be
<Transactions>
<transctionList>
<Trans name="ADD_AG">
<childTrans>ADD_ED</childTrans>
<childTrans>ADD_CD</childTrans>
</Trans>
<Trans name="ADD_ED">
< actionIntf>add_r</actionIntf>
<actionIntf>add_ml</actionIntf>
<actionIntf>sub_mlk</actionIntf>
</Trans>
<Trans name="ADD_CD">
<actionIntf>add_rkm</actionIntf>
<actionIntf>sub_mlcd</actionIntf>
<actionIntf>sub_mlki</actionIntf>
</Trans>
</transactionList>
</Transactions >
input to the java program will be xml file and Trans 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 to get all the elements underneath it ..so in this
case we have two child 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 is goin to be ADD_ED ( this does not have any child so
)the output is
ADD_ED
add_r
add_ml
sub_mlk
planning to use Jdom and create a tree structure and then store each
node and its contents in alist ...is this approach corerct . after
storing it in a list how do i associate ie check that it has child or
not .
or is is possible to produce a tree structure with above xml like
add_AG ->ADD_ED->add_r ......
|
Add_cd -> add_rkm ..... etc
...what is the right approach to take ..thanks for the help
this is wat my input xml going to be
<Transactions>
<transctionList>
<Trans name="ADD_AG">
<childTrans>ADD_ED</childTrans>
<childTrans>ADD_CD</childTrans>
</Trans>
<Trans name="ADD_ED">
< actionIntf>add_r</actionIntf>
<actionIntf>add_ml</actionIntf>
<actionIntf>sub_mlk</actionIntf>
</Trans>
<Trans name="ADD_CD">
<actionIntf>add_rkm</actionIntf>
<actionIntf>sub_mlcd</actionIntf>
<actionIntf>sub_mlki</actionIntf>
</Trans>
</transactionList>
</Transactions >
input to the java program will be xml file and Trans 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 to get all the elements underneath it ..so in this
case we have two child 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 is goin to be ADD_ED ( this does not have any child so
)the output is
ADD_ED
add_r
add_ml
sub_mlk
planning to use Jdom and create a tree structure and then store each
node and its contents in alist ...is this approach corerct . after
storing it in a list how do i associate ie check that it has child or
not .
or is is possible to produce a tree structure with above xml like
add_AG ->ADD_ED->add_r ......
|
Add_cd -> add_rkm ..... etc
...what is the right approach to take ..thanks for the help