> Essentially the problem I see myself encountering is that I need to embed > the <ForEach > functionality into the <Ant > task. The sub-task > implementation I posted previously kept the DOM around to re-make the > subtasks each iteration. I'm going to have to do the same thing, but > without the guarantee that I'm capturing all the information.
Please, don't ! Keeping DOM around is wrong - it's redundant information, and it will put too much weight on the framework. I can't understand what's wrong with reading the XML and creating Java objects ??? Why do you need to keep the information after that in memory? DOM is a solution for a different problem - why keeping the XML document in 2 different forms - the Java object tree and DOM ( or any equivalent )? SAX is more than enough - and it's the logical solution. Please don't say that this is the just to implement variables. All current Ant tasks work fine with the constants ( or whatever <property> is - it is set before project execution and doesn't change after). If you need more - please don't change everything, maybe you can use a scripting language that has a clear notion of variables, or your own API that can get/set attributes. Costin
