File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes XML and Related Technologies and the fly likes how to get element list from xml file? 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 "how to get element list from xml file?" Watch "how to get element list from xml file?" New topic
Author

how to get element list from xml file?

sihani rani
Ranch Hand

Joined: Jun 22, 2010
Posts: 32
Hi all.

This is XMLfile and DTD file for that xml file

XML File




DTD file

<!ELEMENT message ( operation ) >

<!ELEMENT operation ( #PCDATA ) >
<!ATTLIST operation action NMTOKEN #REQUIRED >
<!ATTLIST operation key NMTOKEN #REQUIRED >
<!ATTLIST operation type NMTOKEN #REQUIRED >

My question is

1)How can i get Operation element type value,action value and key value by java coding???
2)how can i retrive value ie "firstdocument " by using the key ie DocumentName in java?







please reply
thanks in advance.
William Brogden
Author and all-around good cowpoke
Rancher

Joined: Mar 22, 2000
Posts: 12809
    
    5
A google search for "Harold Processing XML with JAVA" will lead you to Harold's free online book which is loaded with code examples related to your problem.

If, after trying to run some actual code, you get stuck, post the code and your problem.

Bill
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to get element list from xml file?