ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dominique Devienne" <DDevie...@lgc.com>
Subject RE: DynamicConfigurator and friends
Date Fri, 14 Jan 2005 15:24:25 GMT
> From: Stefan Bodewig [mailto:bodewig@apache.org]
> 
> <mytask>
>   <child>
>     ... arbitrary XML goes here ...
>   </child>
> </mytask>
> 
> and then serialize the DocumentFragment held by
> XMLFragement into a String.

Thanks for the explanation Stefan. I didn't grasp the
fact that a DynamicConfigurator was still introspected
for the addText(String) method to grab nested text.

BTW, why did you choose to have the Child inner class
public? Ah, it probably to have its addText(String) method
accessible so nested text does get added.

There's one last twist about text handling in Ant that I
discovered with a modified version of <echo> though: Ant
merges text nodes for an element, calling addText() only
once, so <a>b<c>d</c>e</a> does not call addText("b") and
later addText("e"), but addText("be"), so you don't get
the same DOM fragment as what's in the build file.

Not sure if this still applies in general, and to XMLFragment
in particular, but I thought I should mention it. --DD

PS: Also, some XML tools might care about whitespace-only
    text nodes, and these are not created because of the
    !s.trim().equals("") test. If text node merging above
    is ever fixed, we'd probably need to make that user
    configurable.

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


Mime
View raw message