ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jon Stevens <>
Subject Re: bug in DOMElementWriter
Date Mon, 28 Jun 2010 01:55:00 GMT
On Sun, Jun 27, 2010 at 10:35 AM, Dominique Devienne <>wrote:

> On Sat, Jun 26, 2010 at 6:54 PM, Jon Stevens <> wrote:
> > For example, attr="&amp;" comes out as attr="&amp;" and not attr="&"...
> > don't have to write attr="&amp;amp;" to get what I want. The same is true
> > with attr="&gt;"... it comes out as attr="&gt;" instead of attr=">".
> is
> > all because DOMElementWriter.encode() is smart about those entities.
> >
> > attr="&#10;" should come out as attr="&#10;", not attr="\n"
> Well, I'm afraid Antoine is right, and the comparison you make is not
> "fair".
> &, <, and > are "special" in XML, and must always be encoded in
> attribute values and textual content. \n is not.
> <echoxml> never sees the "&amp;" text, it sees whatever the XML parser
> reports, a "&", and the XML serializer Ant uses knows it must encode
> that char into "&amp;", thus it ends up back the way it was. But 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.

However, the character that went into the attribute was not a \n, it was a
&#10;. I'd expect ant to give me &#10; back out, not \n. The point of
<echoxml> is to echo xml, is it not? In that case, the point here should be
to echo out the encoded value as xml, not something that is useless.


  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message