...Sure, I understand your points. And I also admit - the XML-spec does *not* say that; it does say white-space should be passed to the app! I just had a harder look.
But the same section (http://www.xml.com/axml/target.html#sec-white-space ) does say something about "In editing XML documents, it is often convenient to use "white space" ... to set apart the markup for greater readability". The "xml:space" is there for some reason. Is this formulation targeted at element-bodies? I am not at all sure, but the section does say "xml:space may be attached to an element to signal an intention that in that element, white space should be preserved by applications". Here, "in that element" can hardly mean anything but "within the body of that element"? Or can it? XML-spec or not, from what I have seen, it is somewhat common within XML-formats, that leading/trailing white-space is ignorable, I belive. ----- Regarding this "break"-thing - it is not I, who - back in January? - wrote e.g. the document "http://ant.apache.org/ant2/features.html" and said - "Ant2 is going to break Ant1 in several ways" - and - "Build files written for Ant1 will probably not be valid in Ant2 or at least not yield the same results. It is expected that Ant2 will come with a tool to translate Ant1 build files into equivalent Ant2 versions" *This* is what I had in mind; it is most certainly not I, who invented the "break" term. But of course, that is a long time ago. Opinions change. Regards, Morten Sabroe Mortensen -----Original Message----- From: Steve Loughran To: Ant Developers List Sent: 04-08-03 19:01 Subject: Re: "echo"-task, ignorable whitespace and CDATA-elements 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:- http://www.xml.com/axml/target.html#sec-white-space 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. -Steve --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]