ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <>
Subject Re: "echo"-task, ignorable whitespace and CDATA-elements
Date Mon, 04 Aug 2003 17:01:11 GMT
Morten Mortensen wrote:

> It will break things? That, of course, is between "bad" and "annoing".
> But technically, I am right?
> There are other people out there - e.g. me - who are trying to automate
> things - reformatting XML, in particular Ant-files, and who refer to the XML
> specification to see, what is and is not allowed.

Well the rules are simple. Look at the XML spec, see that
"An XML processor must always pass all characters in a document that are 
not markup through to the application". That is what Ant expects, and 
this is used to lay out text:-

There is nowhere in the XML spec that says "anything that processes XML 
is allowed to assume that the final destination of the XML does not care 
about white space".

And does care about white space in text elements, so if you have written 
code based on the assumption that it is irrelevant, then your assumption 
was invalid and your code doesnt work. Your problem, not mine.

> I kind of think, that those Python-script-like-people should learn to use
> CDATA-elements. That would solve the problem!?

you mean 'breaking every single build file out there that used <echo> 
for formatted printing would solve the problem'? It is not going to 
happen. And, as far as I am concerned, not necessary.

> Ant-files should be XML, not just pretend to. -Is my opinion.

Ant is XML. It just happens to be sensitive about spaces in element 
content, is all. Which is something the XML specification explicitly allows.

If it wasnt valid XML, Ant wouldn't be parsable by XML parsers, or 
editable by XML editors. It is, therefore it is.


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

View raw message