ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From John Lindwall <JLindw...@Xifin.com>
Subject Inserting elements into an XML file
Date Thu, 17 Jun 2004 23:07:26 GMT
I'd like to insert an element into an XML file using ant.  One use is to add a <WebAppComponent>
element to a WebLogic config.xml file and another is to add a <module> element to a
web.xml file.  

Not that its important to the problem at hand but I'm adding cactus support to our app and
so if the users wishes to cactus-enable the build these elements must be inserted into the
otherwise standard {config,web}.xml files.

Any pointers?  Thanks!

An example, hopefully to better explain what I'm after --------

Original file:

<?xml version="1.0" encoding="UTF-8"?>
<Domain>
    <Application>
        <EJBComponent Name="foo">
    </Application>
</Domain>


After inserting a new element:

<?xml version="1.0" encoding="UTF-8"?>
<Domain>
    <Application>
        <EJBComponent Name="foo">
        <WebAppComponent Name="Here Is A New Element That Inserted By Ant!!!!! NEAT!"/>
    </Application>
</Domain>


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message