ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jan.Mate...@rzf.fin-nrw.de
Subject AW: Find value between xml tags
Date Thu, 18 Nov 2004 13:51:32 GMT
You can use the <replaceregexp> task, because xml files are (more or less)
simple text files. But could also have a look at the external xml tasks
[1,2].

Another thing is thinking about your process. WHY do you have to modify that
file? Maybe it would be easier to provide a template and use variable parts
in that using <copy><filterchain><expandproperties> [3].

Jan

[1] http://ant.apache.org/external.html#xmltask
[2] http://www.oopsconsultancy.com/software/xmltask.html
[3] http://ant.apache.org/manual/CoreTypes/filterchain.html#expandproperties


> -----Urspr√ľngliche Nachricht-----
> Von: Sanjeev_Das [mailto:Sanjeev_Das@infosys.com]
> Gesendet am: Donnerstag, 18. November 2004 14:46
> An: user@ant.apache.org
> Betreff: Find value between xml tags
> 
> I have to search & replace values of certain parameters in a 
> XML file. These values i'm reading from a different file.
> 
> for ex. My XML is like this:
> 
> 
> <root>
> 	<tag1> abc ="123" </tag1>
> 	<tag2> xyz ="987" </tag2>
> </root>
> 
> Now i want to change the value of abc from "123" to "345"
> 
> so, any pointers of doing it in ANT.
> 
> Regards,
> Sanjeev
> 
> 
> 
> -----Original Message-----
> From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de] 
> Sent: Thursday, November 18, 2004 7:03 PM
> To: user@ant.apache.org
> Subject: AW: Find value between xml tags
> 
> Dont know what you mean. Can you give an example?
> There are several tasks for accessing xml: <xslt>, 
> <xslproperty>, the xml
> task (see external page)
> 
> Jan
> 
> > -----Urspr√ľngliche Nachricht-----
> > Von: Sanjeev_Das [mailto:Sanjeev_Das@infosys.com]
> > Gesendet am: Donnerstag, 18. November 2004 14:21
> > An: user@ant.apache.org
> > Betreff: Find value between xml tags
> > 
> > 
> > Hi All,
> > 
> > I need to find out the value present in between the xml 
> tags. Is there
> > any specific task in Ant to do so? If not can anyone suggest a
> > workaround.
> > 
> > Regards,
> > Sanjeev
> > 
> > 
> > 
> ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> > For additional commands, e-mail: user-help@ant.apache.org
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 

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