ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Morten Mortensen <>
Subject "echo"-task, ignorable whitespace and CDATA-elements
Date Wed, 30 Jul 2003 19:03:39 GMT

Hi all,

It would be nice, if the "echo" task worked a bit different - actually
*ignored* leading and trailing whitespace in the body of the text.

The reason is, that XML-pretty-formatters - which does not change the
semantics of the XML formatted relative to the specification - may alter the
action performed by the "echo" task.


<echo>This is text!</echo>

- and -

  This is text!

- produce two different results.


A longer story is, that I am creating a tool for building Ant-files. The
final files are written out from DOM-structures. This means that they may
look... *special* in their formatting.

Built files are formatted - I have made a generic XML-formatter, which can
format XML in different ways. It uses SAX to read its input. The formatting
may be applied for other reasons - messy build-files.

To the best of my knowledge, the XML specification indicates, that the two
variants in the example should have the exact same interpretation!! With
Ant, this is not the case.

I think, that the right way to include leading and trailing
whitespaces/carriage-returns, the CDATA-element should be used.

What do you think? Am I right or wrong here? 
Even though Ant does not really have a DTD/XSD, build-files are supposed to
be valid XML?

Med venlig hilsen 
  Morten Sabroe Mortensen 
  TietoEnator A/S, Ved Lunden 12, 8230 Åbyhøj, Danmark

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

View raw message