ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Brian Topping <topp...@codehaus.org>
Subject Re: DynamicConfigurator and friends
Date Mon, 17 Jan 2005 09:27:55 GMT
Dear Stefan,

Yes, now I am starting to understand what's going on here.  Ant must use 
a SAX parser, and it's well beyond the ability of the application to 
reconsider how the events are interpreted, including grouping them as a 
larger bundle of straight text.

I've copied the XMLFragment code with a few modifications to achieve the 
requirements I was after and all was successful.  Thanks to you and 
everyone else for your time and effort to answer this for me.

Best regards,

Brian Topping

Stefan Bodewig wrote:

>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
>
>
>
>  
>


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


Mime
View raw message