ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Bodewig <bode...@apache.org>
Subject Re: bug in DOMElementWriter
Date Mon, 28 Jun 2010 09:03:32 GMT
On 2010-06-28, Stefan Bodewig wrote:

> [just echoing what Antoine and Dominque already said, Ant doesn't even
>       know you used an entity reference to specify the newline.]

Just read <http://www.w3.org/TR/2008/REC-xml-20081126/#AVNormalize> and
realized that what I said above isn't true.

If Ant sees a \n, \r or \t inside an attribute's value, then it must
have been an entity reference in the original input - otherwise
normalization would have replaced it with a space.

This also means

>> <foo attr="beforenewline&#10;afternewline">

and

>> <foo attr="beforenewline
>> afternewline" />

result in different attribute values being passed to the application
(one containing the newline and one containing a space instead).

By now I tend to agree with Jon that DOMElementWriter should encode \n,
\r and \t when writing attribute values (and only when writing attribute
values).

Stefan

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


Mime
View raw message