ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: DynamicConfigurator and friends
Date Fri, 14 Jan 2005 08:03:22 GMT
On Thu, 13 Jan 2005, Brian Topping <topping@codehaus.org> wrote:

> I'm trying to use DynamicConfigurator and need a bit of
> clarification.  I'd like to make the child text of a Task (defined
> with a taskdef) be usable as a String by the Task.

That would be the addText(String) method, no DynamicFoo involved at
all, if you really were talking about nested text.

> The issue is that the "arbitrary" text is XML

which makes it nested elements, and not nested text at all.

> Is this possible without wrapping the text in a CDATA?

Ant's CVS HEAD contains a class[1] that captures arbitrary XML
structures, add a child element to your task via

public void addChild(XMLFragment frag) {
    ...
}

and the you can use 

<mytask>
  <child>
    ... arbitrary XML goes here ...
  </child>
</mytask>

and then serialize the DocumentFragment held by XMLFragement into a
String.

Stefan

Footnotes: 
[1]  in src/main/org/apache/tools/ant/util/XMLFragment.java


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message