Operating system environment variables in .dtd and .xml files
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   Anonymous
Posted On:   Friday, June 28, 2002 07:21 AM

Is there a way to use environment variables in .dtd and .xml files. Example: I want to use user dependant files to include private data DTD: <!ENTITY P1 SYSTEM "./Projects.xml"> <!ENTITY HOME SYSTEM "$HOME/Private.xml"> XML file: &P1; &HOME; I read the files, using jdom: SAXBuilder builder = null; builder = new SAXBuilder(); Document doc; doc = builder.build(new File(filename)); XMLOutputter outputter = new XMLOutputter(); Element root = doc.getRootElement(); Element OS; OS = root.g   More>>

Is there a way to use environment variables in .dtd and .xml files.

Example:

I want to use user dependant files to include private data


			
DTD:
<!ENTITY P1 SYSTEM "./Projects.xml">
<!ENTITY HOME SYSTEM "$HOME/Private.xml">


XML file:


&P1;



&HOME;


I read the files, using jdom:


SAXBuilder builder = null;
builder = new SAXBuilder();

Document doc;

doc = builder.build(new File(filename));
XMLOutputter outputter = new XMLOutputter();

Element root = doc.getRootElement();
Element OS;
OS = root.getChild("Unix");
....
....
   <<Less

Re: Operating system environment variables in .dtd and .xml files

Posted By:   Roseanne_Zhang  
Posted On:   Monday, September 2, 2002 07:28 PM

NO or yes. Generally to say, NO. However, if you know ant well, and know ant property filters well, you can do it. Use @home@ in your dtd, the replace it by using ant properties. It is not a simple job. However, it can be done.
About | Sitemap | Contact