ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesse Glick <>
Subject Re: bug in DOMElementWriter
Date Mon, 28 Jun 2010 18:05:42 GMT
On 06/27/2010 01:35 PM, Dominique Devienne wrote:
> with \n, which is just like any other character*, the serializer doesn't do
> anything special, and the output the also contain a "plain" \n.

Jon is correct: &#10; or similar should be emitted for \n. Newlines are _not_ just like
any other character; in XML attributes they are collapsed into a generic 
whitespace sequence. For example,

<project default="run">
     <target name="run">
     <echo message="hello
     <echo message="hello&#10;again"/>


hello there

In general, there is a certain class of characters other than the usual &<>"' which
should be emitted in character entity form by any tool which purports to create 
round-trippable XML. Others, like &#8;, are simply invalid in XML content and cannot be
encoded at all.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message