Originally posted by Revathi Damera:
I have a .properties file and i have transformed that to a xml file by writing a new DTD.
How are you transforming a properties file into a xml using a DTD ?
As sachin poddar said and if you are using JDK 1.5 and above you can do it directly using Properties object , you can read the xml directly into properties object.But you have to stick of the format specified by sun.You may want to have a look at the DTD of that.
And in case you want to use your own xml format or using JDK 1.4 , then you can read that into java classes using third parties like digester.Or simple use JAXP to construct the DOM and then query it using XPath to fetch required values.