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: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Sent: Thursday, November 18, 2004 7:03 PM
To: [EMAIL PROTECTED]
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:[EMAIL PROTECTED]
Gesendet am: Donnerstag, 18. November 2004 14:21
An: [EMAIL PROTECTED]
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: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]




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



Reply via email to