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 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 Make it so: Java DB Connections & Transactions this week in the JDBC 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

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 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

Joined: Mar 22, 2000
Posts: 13027
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.

I agree. Here's the link:
subject: how to get element list from xml file?
It's not a secret anymore!