Java Mailing List Archive

http://www.junlu.com/

Home » Home (12/2007) » JDOM User »

[jdom-interest] How to combine two xml files

Muthu Vel

2004-01-29


Hai,
I am having two xml files build.xml and deploy.xml. I have to combine these files to form config.xml. I have given the format for the xml files below.

build.xml
-------------
<!DOCTYPE project PUBLIC "-//ANT//DTD project/EN" "build.dtd">
<project name="${project.name}" default="init" basedir=".">
<target name="init" depends="build.properties" description="Initialize the build properties">
<property file="build.properties"/>
</target>
</project>

deploy.xml
---------------
<?xml version="1.0" ?>
<!DOCTYPE project PUBLIC "-//ANT//DTD project/EN" "build.dtd">
<project name="${project.name}" default="init" basedir=".">
<target name="init" description="Initialize the deploy properties">
<property file="deploy.properties"/>
</target>
</project>

Two files are having a lot of targets. I have to differentiate the targets of bo th files. For that I have to add a new attribute "location" to all targets. The problem is how to add a location attribute. Can anyone faced this? If so tell me the procedure for solving the problem. The Output file should be of the form
 
config.xml
---------------
<?xml version="1.0" ?>
<!DOCTYPE project PUBLIC "-//ANT//DTD project/EN" "build.dtd">
<target name="init" description="Initialize the build properties" location = "build.xml">
<property file="build.properties"/>
</target>

<target name="init" description="Initialize the deploy properties" location = "deploy.xml">
<property file="deploy.properties"/>
</target>
Thanks in Advance,
    SMVEL


Do you Yahoo!?
Yahoo! SiteBuilder - Free web site building tool. Try it!
©2008 junlu.com - Jax Systems, LLC, U.S.A.