This week's book giveaway is in the Cloud/Virtualizaton forum.
We're giving away four copies of Mesos in Action and have Roger Ignazio on-line!
See this thread for details.
Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to get element list from xml file?

 
sihani rani
Ranch Hand
Posts: 32
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 13062
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic