| Author |
ANT Task to modify XML files?
|
a chang
Greenhorn
Joined: Aug 17, 2005
Posts: 2
|
|
|
I am writing a custom ant task to modify an ant task build.xml file. What ant tasks are available to parse and modify an xml file? I want to find a property element with a specific name, and change an attribute called value. Any help would be great! thanks in advance!
|
 |
Andy Hahn
Ranch Hand
Joined: Aug 31, 2004
Posts: 225
|
|
I am not aware of any tasks that are packaged with ant that can accomplish this. I always recommend extending ant and writing your own task. This is pretty easy to do. There is a task - org.apache.tools.ant.taskdefs.XmlProperty - but it only loads properties from an xml file. You could either parse the xml or if it is a specific element, you could write a routine to search and replace the value of that element.
|
 |
 |
|
|
subject: ANT Task to modify XML files?
|
|
|