java - Can you use Ant to Build/Modify XML files? - Stack Overflow
The correct answer depends upon what you're actually trying to do.
You could create a tiny xml document using echo task and argument replacement, but that gets hard to maintain very quickly.
If your goal is to generate an XML document that is mostly boilerplate with a couple of values substituted, then you should look at creating a template document and then using the Copy with filtering task.
If you need to modify the structure of the document depending upon data from Ant (or gathered from somewhere else) then using the xslt task is going to be a better fit. The problem with XSLT is that it is not always straight-forward to use (XSLT uses functional programming, not procedural programming).
You may find that the correct answer is to write your own Ant task that will do exactly what you want, just the way you want it.
If you can better describe what you're trying to achieve, I'm sure someone will be happy to provide a more precise answer.
Read full article from java - Can you use Ant to Build/Modify XML files? - Stack Overflow
No comments:
Post a Comment