ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <ddevie...@gmail.com>
Subject Re: bug in DOMElementWriter
Date Mon, 28 Jun 2010 02:14:47 GMT
On Sun, Jun 27, 2010 at 8:55 PM, Jon Stevens <latchkey@gmail.com> wrote:
> 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.

Jon, in XML land &#10; *is* \n, whatever you say about it.

See http://en.wikipedia.org/wiki/List_of_XML_and_HTML_character_entity_references

You *can* have a plain '\n' char (i.e. an actual LF, not '\\' and 'n')
in XML, and for the parser that's the *same*.

Furthermore, whatever you feed your <echoxml>-generated XML file to,
will / should not care either whether it see a '\n' or a "&#10;" if it
uses a compliant XML parser.

Don't get hand up on the textual  representation of the XML file. This

<foo>&#10;</foo>

and this

<foo>
</foo>

is exactly the same thing as far as XML is concerned.

If you absolutely want your &#10; in the <echoxml> output, you must
follow Antoine's advice.

I suggest you read more on XML and again Ant, for better or worse,
uses an XML parser so will only see '\n' and not your XML char entity.
--DD

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


Mime
View raw message