ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <stev...@iseran.com>
Subject Re: "echo"-task, ignorable whitespace and CDATA-elements
Date Tue, 05 Aug 2003 01:25:31 GMT
Morten Mortensen wrote:
> ...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.

dont worry about it, XML is a complex little spec. And then there is XSD...

> 
> 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". 

yes, they sort of hint that, dont they. I think the hints go on DTDs, 
but of course ant is too complex for a classic DTD, only schema and relaxng

> 
> 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. 

Certainly everything I know ignores whitespace in places other than 
inside pure text elements, because it removes the ability to choose a 
layout of choice.

We do it inline because (a) its always been that way and (b) it was 
that way originally because it was easier for end users.

Ant build files have been, by and large, hand edited. You can see that 
in the build files, and you can see that in how ant works with it. There 
are some features that are just hard to parse (why arent dependency 
targets a proper XML list, for example), but easy for humans. That does 
make it harder for machines, but easier for people to use, which helped 
ant succeed.

If you are doing some automated thing, incidentally, can you try and 
preserve whitespace wherever possible. I abhor ant gui tools that make 
the build file unreadable afterwards. Even reordering attributes can be 
distracting...





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


Mime
View raw message