ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Lopez, William" <william.lo...@eds.com>
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 ( http://www.oopsconsultancy.com/software/xmltask.html ).
Try something like this *NOT TESTED*:

  <taskdef name="xmltask"
classname="com.oopsconsultancy.xmltask.ant.XmlTask"/>

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

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

HTH,
-Will

-----Original Message-----
From: Nagarajan Murugesan [mailto:NMURUGESAN@selectica.com] 
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"/>
			</fileset>
		
			<filterset begintoken="&gt;" endtoken="&lt;">
				<filter token="/information" value="info"/>
			</filterset>
		</copy>
 

Thanks,
Nagarajan M.



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message