Bug 10402

Summary: adding the ability of html like whitespace preservence to echo task
Product: Ant Reporter: Sascha C. <wtff>
Component: Core tasksAssignee: Ant Notifications List <notifications>
Status: NEW ---    
Severity: enhancement CC: mfaltaie
Priority: P3 Keywords: PatchAvailable
Version: unspecified   
Target Milestone: ---   
Hardware: Other   
OS: other   
Attachments: Patch for this feature

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:

    <echo>
        Hello World,
        line with lt. 80 digits,
        line two w. lt. 80 digits,
        a.s.o.
    </echo>

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