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 XML Property File Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java Interview Guide this week in the Jobs Discussion 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
I agree. Here's the link:
subject: XML Property File
jQuery in Action, 3rd edition