Re: Property resolution in a task

2003-11-18 Thread Christopher Lenz
[EMAIL PROTECTED] wrote: Ok, that comes from a guy who works more on DOM-Nodes than me (=nothing) :-) Should we add that to Project class? (If we are allowed to do that) I don't think there's a need to add this to the Ant core. It's not hard to implement (if one is familiar with the DOM ;-) ), and

RE: Property resolution in a task

2003-11-18 Thread Jan . Materne
> > Ok, that comes from a guy who works more on DOM-Nodes than me (=nothing) :-) > > > > Should we add that to Project class? (If we are allowed to do that) > > sure -as long as we also have a test for it :) Of course - only with test :-) Ok, I will try that. Jan

Re: Property resolution in a task

2003-11-17 Thread Steve Loughran
[EMAIL PROTECTED] wrote: Ok, that comes from a guy who works more on DOM-Nodes than me (=nothing) :-) Should we add that to Project class? (If we are allowed to do that) sure -as long as we also have a test for it :) - To unsubscri

Re: Property resolution in a task

2003-11-17 Thread Upayavira
er node types } } } Jan -Original Message- From: Upayavira [mailto:[EMAIL PROTECTED] Sent: Monday, November 17, 2003 1:02 PM To: Ant Developers List Subject: Re: Property resolution in a task Christopher Lenz wrote: It should be much more efficient (and probably simpler) to just

RE: Property resolution in a task

2003-11-17 Thread Jan . Materne
elopers List > Subject: Re: Property resolution in a task > > > Christopher Lenz wrote: > > > It should be much more efficient (and probably simpler) to just > > traverse the DOM and replace properties in-place: > > Splendid! This job gets easier by the moment!

Re: Property resolution in a task

2003-11-17 Thread Upayavira
Christopher Lenz wrote: It should be much more efficient (and probably simpler) to just traverse the DOM and replace properties in-place: Splendid! This job gets easier by the moment! Thanks for that. Regards, Upayavira public void replaceProperties(Node n) throws DOMException { switch (n.ge

Re: Property resolution in a task

2003-11-17 Thread Christopher Lenz
It should be much more efficient (and probably simpler) to just traverse the DOM and replace properties in-place: public void replaceProperties(Node n) throws DOMException { switch (n.getNodeType()) { case Node.ATTR_NODE: case Node.CDATA_SECTION_NODE: case Node.TEXT_NODE:

RE: Property resolution in a task

2003-11-17 Thread Jan . Materne
Have a look at org.apache.tools.ant.util.DOMElementWriter. Sounds that it could help you. Jan > -Original Message- > From: Upayavira [mailto:[EMAIL PROTECTED] > Sent: Monday, November 17, 2003 12:29 PM > To: Ant Developers List > Subject: Re: Property resolution in a task

Re: Property resolution in a task

2003-11-17 Thread Upayavira
[EMAIL PROTECTED] wrote: Is there an Ant way to 'spider' a DOM node, replacing properties as it goes? I don´t know such a thing. But you can do: - write the DOM to a String - use Project.replace() on that String - parse the String - replace the DOM with new one Jan Yup, that should work! T

RE: Property resolution in a task

2003-11-17 Thread Jan . Materne
> Is there an Ant way to 'spider' a DOM node, replacing > properties as it goes? I don´t know such a thing. But you can do: - write the DOM to a String - use Project.replace() on that String - parse the String - replace the DOM with new one Jan

Re: Property resolution in a task

2003-11-17 Thread Upayavira
[EMAIL PROTECTED] wrote: String org.apache.tools.ant.Project.replaceProperties(String value) would help here. Absolutely splendid. I thought it might be that simple. One further question - I've looked deeper into the Cocoon code, and can see that we have a DOM node for which I want to replace p

RE: Property resolution in a task

2003-11-17 Thread Jan . Materne
String org.apache.tools.ant.Project.replaceProperties(String value) would help here. /** * Replaces ${} style constructions in the given value with the * string value of the corresponding data types. * * @param value The string to be scanned for property references.