ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Agnew <br...@oopsconsultancy.com>
Subject Re: Find value between xml tags
Date Fri, 19 Nov 2004 00:24:29 GMT
I'd suggest using xmltask ( 
http://www.oopsconsultancy.com/software/xmltask ) to do XML replacement. 
It'll handle the below with appropriate XPath expressions.

e.g. see starts-with() in http://www.w3schools.com/xpath/xpath_functions.asp

although I'd suggest reforming your XML if possible to something like:

<tag1 name="abc">123</tag1>

or to go further
 <tag>
    <name>abc<name>
    <value>123</value>
</tag>

so that XML captures your data structure. Of course that option may not 
be available to you...

Brian

Sanjeev_Das wrote:

>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
>
>  
>

-- 
Brian Agnew                  http://www.oopsconsultancy.com
OOPS Consultancy Ltd         brian @ oopsconsultancy.com
Tel: +44 (0)7720 397526
Fax: +44 (0)20 8682 0012


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