[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
> > 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
[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
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
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!
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
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:
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
[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
> 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
[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
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.
12 matches
Mail list logo