Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Reg :help in Archi Design

 
Arjun Kumar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi all iam new to java and xml and i need suggestion reg this design ..this is wat my input xml going to be
<xpTransactions>
<transList>
<xpTrans name="ADD_AG">
<childTrans>ADD_ED</childTrans>
<childTrans>ADD_CD</childTrans>
<actionDelay>
<timeSec>60<\timeSec>
<retry>1<\retry>
</actionDelay>
</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 to get all the elements underneath it ..so in this case we have two chils 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

palnning to use Jdom and create a tree structure and then store each node and its contents in alist ...is this approach corerct .is it is after storing it in a list how do i associate ie check that it has chils or not .

thanks for the help
 
Arjun Kumar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
got another doubt is itpossible to build a tree structure with the above xml or should i use JAXP?
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
"siv_ga",
Welcome to the JavaRanch.

We're a friendly group, but we do require members to have valid display names.

Display names must be two words: your first name, a space, then your last name. Fictitious names are not allowed.

Please edit your profile and correct your display name since accounts with invalid display names get deleted, often without warning

thanks,
Dave
 
Arjun Kumar
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ok changed to valid login name .thanks
 
Paul Clapham
Sheriff
Pie
Posts: 20771
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are going to use JDOM? Its entire purpose is to convert the XML document into a tree structure. And it does have methods that you can call to find out whether a node has children or not. I would suggest reading some XML tutorials, and looking at the JDOM site for examples or tutorials, or if it doesn't have any of those then look at the JDOM API documentation.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic