Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

XML Property File

 
praveen sharma
Ranch Hand
Posts: 44
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi ranches,

can anyone help me in using X M L property file reading. my X M L File is in this format


i am not able to create a DTD properlly and getting error while reading so can anyone tell me how to prepare DTD For the following field.waiting for your reply please help urgently required
 
Amol Nayak
Ranch Hand
Posts: 218
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are not required to have a dtd or xsd unless you need to validate it before parsing. For parsing you can use SAX or DOM. Use DOM as it is simple to understand and use.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Moving to XML and related technologies
 
Rahul Bhattacharjee
Ranch Hand
Posts: 2308
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are using JDK 1.5 and your configuration file is only of type key value pair then you might want to use java.util.Properties which not only supports .properties file , but also a simple xml file.For more information you might want to refer the Javadoc for JDK1.5

Otherwise you can load the xml file into a DOM and then use XPath to fetch values from it.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic