• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

XML Beans..Can xml file read system variable

 
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I am using XMLBeans which is reading an xml file.
For example: Following are contents of xml file.

<Log4JPropertiesFilePath>C:/MyProj/config/log4j.properties</Log4JPropertiesFilePath>
<LogFilePath>C:/MyProj/logs/ICA_log.txt</LogFilePath>

The above kind of c:/MyProj locations are defind at many places in xml file.

Now, problem is that if the above location gets changed, I will have to make changes in the complete xml file which I don't want.

Is there any way where I can define my location "c:/MyProj" at a common place in XML Or outside XML from where XML can read it.

It is very urgent. Please help.

Thanks in advance.
 
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
How are you forming your XML? Can't you force the code making your XML to read it,say, from a property file and insert it at the proper tag in the XML?

Jhakda
 
dimpsonu arora
Ranch Hand
Posts: 51
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Done! Thanks.
 
Jhakda Velu
Ranch Hand
Posts: 167
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
What did you do,do let us know. Share the knowledge.

Jhakda
 
Bartender
Posts: 1638
IntelliJ IDE MySQL Database Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Originally posted by dimpsonu arora:

Is there any way where I can define my location "c:/MyProj" at a common place in XML Or outside XML from where XML can read it.



What is the meaning of "Xml can read it"?
XML is not an application, it is a simple file. It is like saying i will write a place holder in a Text file and the text file should read the value for the place holder from another file!
It is the application that reads an XML file and thus the application must have the intelligence as to how to understand a place holder like the path you are talking about. I can write in my Xml something like:

The application reading this will know that the actual value in between these tags will come from a system variable.
 
You’ll find me in my office. I’ll probably be drinking. And reading this tiny ad.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic