This week's book giveaway is in the OCPJP forum.
We're giving away four copies of OCA/OCP Java SE 7 Programmer I & II Study Guide and have Kathy Sierra & Bert Bates on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Get element name using parsing Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of OCA/OCP Java SE 7 Programmer I & II Study Guide this week in the OCPJP forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Get element name using parsing" Watch "Get element name using parsing" New topic
Author

Get element name using parsing

lee chan
Greenhorn

Joined: Jun 14, 2011
Posts: 15
Hi,

I'm very new to parsing...Please help me out in this concern...

I've an xml called example.xml

<Element>
<Program>
<A1>
<Name>Zinkoch</Name>
<Sub>Java</Sub>
</A1>
<A2>
<Name>Lewis</Name>
<Sub>C</Sub>
</A2>
</Program>
<Leave>
<Month1>
<Day>Friday</Day>
</Month1>
<Month2>
<Day>Tuesday</Day>
</Month2>
</Leave>
</Element>


Now by using XPATH or DOM or SAX I want to get elements <A1>, <A2> and the corresponding <Sub> values...
let me know how to do.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12809
    
    5
This free online book by Harold is loaded with useful examples including some similar to your problem.


Bill
lee chan
Greenhorn

Joined: Jun 14, 2011
Posts: 15
William Brogden wrote:This free online book by Harold is loaded with useful examples including some similar to your problem.


Bill


Thank you William...
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Get element name using parsing