This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes XML Property File 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 "XML Property File" Watch "XML Property File" New topic
Author

XML Property File

praveen sharma
Ranch Hand

Joined: May 27, 2006
Posts: 44
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

Joined: Oct 26, 2006
Posts: 218
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

Joined: Nov 24, 2005
Posts: 14688
    
  16

Moving to XML and related technologies


[My Blog]
All roads lead to JavaRanch
Rahul Bhattacharjee
Ranch Hand

Joined: Nov 29, 2005
Posts: 2308
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.


Rahul Bhattacharjee
LinkedIn - Blog
 
GeeCON Prague 2014
 
subject: XML Property File