This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes Read properties file in xml Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "Read properties file in xml" Watch "Read properties file in xml" New topic
Author

Read properties file in xml

Supri dharshni
Greenhorn

Joined: Jul 14, 2009
Posts: 25
Hi ,

I have to read some values from .properties file in xml.Please let me know how to do this.I have read directly not through java.

Thanks.


Regards,
Priya.
Paul Clapham
Bartender

Joined: Oct 14, 2005
Posts: 18541
    
    8

What do you mean by "in XML"? XML is data, not a programming language, so it can't read a file. You would have to use whatever programming language you are using to process the XML to read the properties file.

And since it's a properties file, the best choice of language to read it would be Java.
Supri dharshni
Greenhorn

Joined: Jul 14, 2009
Posts: 25
Hi,

I meant i need some values from properties file in a xml file.

<a:query>

(xs:QName("empid"),"123")
</a:query>
now,instead of hardcoding 123 i need this to be from properties file.
We have to do this onloading of the xml file.

Thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 41060
    
  43
That sounds like a use case for a templating library such as Apache Velocity or FreeMarker.


Ping & DNS - my free Android networking tools app
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Read properties file in xml
 
Similar Threads
JDBC-ODBC bridge any other options
reading a properties file from the war file
Properties file
using two properties files in struts
whats wrong with this code?