Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Referencing environment variable in xml

Status
Not open for further replies.

prasaddeva

Technical User
Mar 13, 2013
1
0
0
I am on linux machine. My Application is using a xml file. In this xml file, a absolute File System path is mentioned. like., <ENTITY webapp_root "/usr/red/apache-tomcat/webapps/ROOT">
and this entity is referenced in many other properties in the same xml file. like.,

<PROPERTY NAME="DOCS">&webapp_root;/docs</PROPERTY>.

Now, webapp_root path is very much explicit and I want to be referenced from some place. I wondered this can be done by creating the env variable for webapp_root & refer it inside the xml.

I dont know how to do that... Can someone please help me on this ? I am badly in need to get this done !!

Thanks in advance.

 
Well that really depends on how smart your application is.

The XML itself doesn't care whether you write
[tt]<PROPERTY NAME="DOCS">/usr/red/apache-tomcat/webapps/ROOT/docs</PROPERTY>
<PROPERTY NAME="DOCS">&webapp_root;/docs</PROPERTY>
<PROPERTY NAME="DOCS">$ROOT/docs</PROPERTY>[/tt]

It's all down to how your specific application deals with the data as it is being processed.


--
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top