tags:

views:

277

answers:

2

I need to modify certain XML files, and possibly generate XML, in our build and deploy process, which runs on ant. Examples of what I might need to do would be eliminating certain elements based on the value of particular attributes, changing the values of attributes, adding attributes, and adding all new elements. I'm pretty familiar with doing this through the DOM in Java and would like something that feels similar from ant, if possible.

Any good suggested third-party ant tasks I could use?

+2  A: 

Preliminary Googling after posting the question leads me to believe xmltask will do what I want, assuming I'm willing to learn XPath (and I think I am). Still open to other suggestions; I'll have to give this more investigation next week.

skiphoppy
I used xmltask a couple years ago and it was very simple and effective.
digitaljoel
+3  A: 

Have you looked at the XSLT task? It sounds like you particularly want to use a DOM manipulation style, but I thought I should mention it just in case you're open to transformations instead of DOM manipulation. If you're unfamiliar with XSLT, there's a good introduction at w3schools.com

Don Kirkby