ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lopez, William" <>
Subject RE: Problem in pattern(filter) replaing in XML file
Date Sat, 09 Aug 2003 17:22:01 GMT
I'm sure there is a way to make the filter work but an alternative is
xmltask ( ).
Try something like this *NOT TESTED*:

  <taskdef name="xmltask"

  <target name="your-targetname">
    <xmltask source="${dest}/temp/model.xml" dest="${dest}">
       <rename path="/information" to="info"/>

Check out the doco there are many "editing" functions you can do with


-----Original Message-----
From: Nagarajan Murugesan [] 
Sent: Friday, August 08, 2003 2:00 PM
To: Ant Users List
Subject: Problem in pattern(filter) replaing in XML file

Hai Friends,

I have a problem while Running my AntScript. I need your help on that.

1. I am using an XML file. I want to replace a particular tag say </sample>
using filters. It throws an error < cannot be used as begin pattern. Now I
have changed < and > to &gt; and &lt; and run the script. The particular
patten has not replaced

2. How can I do filtering pattern in XML files using ANT?

I here enclose my portion of the script. Is there any way to do that? I want
to replace </information> to info in model.xml file

		<copy overwrite="true" todir="${dest}">
			<fileset dir="${dest}/temp">
				<include name="model.xml"/>
			<filterset begintoken="&gt;" endtoken="&lt;">
				<filter token="/information" value="info"/>

Nagarajan M.

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

View raw message