File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
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
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Reg :help in Archi Design " Watch "Reg :help in Archi Design " New topic

Reg :help in Archi Design

Arjun Kumar

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
<xpTrans name="ADD_AG">
<xpTrans name="ADD_ED">
<xpTrans name="ADD_CD">
</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 in this case we have two chils elements so the output should be


when the input is goin to be ADD_ED ( this does not have any child so )the output is


palnning to use Jdom and create a tree structure and then store each node and its contents in alist 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

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

Joined: Mar 06, 2001
Posts: 13459

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

Arjun Kumar

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

Joined: Oct 14, 2005
Posts: 19973

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:
subject: Reg :help in Archi Design
jQuery in Action, 3rd edition