Bug 10402 - adding the ability of html like whitespace preservence to echo task
Summary: adding the ability of html like whitespace preservence to echo task
Status: NEW
Alias: None
Product: Ant
Classification: Unclassified
Component: Core tasks (show other bugs)
Version: unspecified
Hardware: Other other
: P3 enhancement (vote)
Target Milestone: ---
Assignee: Ant Notifications List
Keywords: PatchAvailable
Depends on:
Reported: 2002-07-02 12:15 UTC by Sascha C.
Modified: 2013-03-04 17:17 UTC (History)
1 user (show)

Patch for this feature (7.95 KB, patch)
2013-03-03 10:53 UTC, Patrick Altaie
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Sascha C. 2002-07-02 12:15:10 UTC
In order to make ant scripts look nicer and at the same time allowing for nice 
screen outputs, the echo task should maybe get an attribute by which one could 
specify that the whitespace within the text should be transformed in an html 
like way:

Consider the following:

        Hello World,
        line with lt. 80 digits,
        line two w. lt. 80 digits,

Echo will print the text with leading whitespacees. Within html, several 
whitespace characters before and after a linebreak are condensed into a single 
space. (And in xml schema one can specify such an option as well)

Maybe it would make sense to have s.th. similar for the echo task as well.
A second mode, which would condense the sequence of (whitespace + linebreak + 
whitespace) into a single space like in html or into a single linebreak.
Comment 1 Patrick Altaie 2013-03-03 10:53:39 UTC
Created attachment 30010 [details]
Patch for this feature

I realise this request is over a decade old, but this is a patch with modifications to the Echo task, tests and documentation for a modification to allow the user to specify whether they would like to preserve (default), replace or collapse whitespace, according to the W3C standard for XML Schema: http://www.w3.org/TR/2001/REC-xmlschema-2-20010502/datatypes.html#rf-whiteSpace

Working on Windows 7 and Ubuntu 12.04