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
2 AM To: [EMAIL PROTECTED] Subject: Property resolution in a task In Cocoon we have an Ant task for patching our config files. I'd like to extend this to be able to expand properties found in the patch files. How can I, in a Task, expand properties within a String? For example

RE: Property resolution in a task

2003-11-17 Thread Jan . Materne
name, e.g. ${xxx */ Jan > -Original Message- > From: Upayavira [mailto:[EMAIL PROTECTED] > Sent: Monday, November 17, 2003 11:12 AM > To: [EMAIL PROTECTED] > Subject: Property resolution in a task > > > In Cocoon we have an Ant task for patching our config

Property resolution in a task

2003-11-17 Thread Upayavira
In Cocoon we have an Ant task for patching our config files. I'd like to extend this to be able to expand properties found in the patch files. How can I, in a Task, expand properties within a String? For example, if I have a string that says "${local.mounttable}", I want to replace it with the v