aspose file tools*
The moose likes XML and Related Technologies and the fly likes Reg :help in Archi Design Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Reg :help in Archi Design " Watch "Reg :help in Archi Design " New topic
Author

Reg :help in Archi Design

Arjun Kumar
Greenhorn

Joined: Nov 09, 2006
Posts: 3
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

Joined: Nov 09, 2006
Posts: 3
got another doubt is itpossible to build a tree structure with the above xml or should i use JAXP?
David O'Meara
Rancher

Joined: Mar 06, 2001
Posts: 13459

"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

Joined: Nov 09, 2006
Posts: 3
hi ok changed to valid login name .thanks
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18657
    
    8

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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Reg :help in Archi Design