You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Stefan Bodewig <bo...@apache.org> on 2001/12/03 16:03:57 UTC

Re: newbie: Now to append newline.

From: Stefan Bodewig <bo...@apache.org>

> <echo file="${classes.dir}/properties/release.txt" append="true">
> </echo>

OK, this doesn't work because of XML's notion of ignorable
whitespace.  We could "fix" that by supporting the xml:space attribute
as described in the XML spec
<http://www.w3.org/TR/1998/REC-xml-19980210#sec-white-space>, but an
easier solution to the specifc problem is:

<echo file="${classes.dir}/properties/release.txt" 
      append="true"
      message="${line.separator}" />

which will always append the "newline" character appropriate for the
current operating system.  Alternatives go along the lines of

<echo file="${classes.dir}/properties/release.txt" 
      append="true"
      message="&#13;&#10;" />

for a carriage-return line-feed sequence.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: newbie: Now to append newline.

Posted by Stefan Bodewig <bo...@apache.org>.
On Mon, 03 Dec 2001, Manik Surtani <ma...@silkroad.co.uk>
wrote:

> How about enclosing it in CDATA tags?

I thought it should work, but when I tried it, it didn't append
anything.

Stefan

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: newbie: Now to append newline.

Posted by Manik Surtani <ma...@silkroad.co.uk>.
How about enclosing it in CDATA tags?

E.g.,
<echo ....><![CDATA[

]]></echo>

?

Cheers,
Manik

Stefan Bodewig wrote:

>From: Stefan Bodewig <bo...@apache.org>
>
>><echo file="${classes.dir}/properties/release.txt" append="true">
>></echo>
>>
>
>OK, this doesn't work because of XML's notion of ignorable
>whitespace.  We could "fix" that by supporting the xml:space attribute
>as described in the XML spec
><http://www.w3.org/TR/1998/REC-xml-19980210#sec-white-space>, but an
>easier solution to the specifc problem is:
>
><echo file="${classes.dir}/properties/release.txt" 
>      append="true"
>      message="${line.separator}" />
>
>which will always append the "newline" character appropriate for the
>current operating system.  Alternatives go along the lines of
>
><echo file="${classes.dir}/properties/release.txt" 
>      append="true"
>      message="&#13;&#10;" />
>
>for a carriage-return line-feed sequence.
>
>Stefan
>
>--
>To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
>For additional commands, e-mail: <ma...@jakarta.apache.org>
>
>


-- 
Manik Surtani
Chief Technology Officer
Silk Road Limited

Telephone: 07786 702 706
Email: manik.surtani@silkroad.co.uk
Web: http://www.silkroad.co.uk