aspose file tools
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


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: 12933
    
    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...
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Get element name using parsing