ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Guy Catz" <>
Subject RE: writing to XML
Date Thu, 01 May 2008 14:01:52 GMT
Thanks guys, that's very helpful.

But, once I've used echoxml to write into a file, can I use it again to
add more values, in append mode?
I need to add values to my XML file in different tasks, not in one

Please advice,

Thank you very much,

-----Original Message-----
From: Steve Loughran [] 
Sent: Thursday, May 01, 2008 12:22 PM
To: Ant Users List
Subject: Re: writing to XML

Guy Catz wrote:
> Hi.
> What I actually need, is to write data into a XML file, so I will be 
> able to render this XML to a HTML as a report.
> The XML structure is something I know.
> Thanks.

There is an <echoxml> task that takes well formed XML and echoes it.

<echoxml file="subbuild.xml">
   <project default="foo">
     <target name="foo">

One thing you have to watch out for here is namespace games. If you want
xml in a new namespace
  -declare the namespaces inside the echoxml
  -keep it all explicit
  -check the output by hand to see that it looks ok

you can use <xmlvalidate> and <schemavalidate> to automate those checks

Steve Loughran        
Author: Ant in Action 

To unsubscribe, e-mail: For additional
commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message