This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths 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

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML Property File" Watch "XML Property File" New topic

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é

Joined: Nov 24, 2005
Posts: 14688

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
subject: XML Property File
It's not a secret anymore!