You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Graham Reeds <gr...@ntlworld.com> on 2004/03/17 15:19:55 UTC

HTML reduction

I've just looked on the ant.apache.org list of external tasks for a html
reduction tool.  Currently I am using 'bloated' html so I can view/debug the
source easily.  I was wondering if there is a tool available that would run
through html source and remove all comments and all unnessary whitespace.  I
would write one myself but my Java skills aren't '1337 3nuff' being a C++
man at heart.

P.S.  I've just recieved my copy of 'Java Development with Ant' - hope it
was worth it:-)

--

Graham Reeds,
grahamr@ntlworld.com



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


Re: HTML reduction

Posted by RADEMAKERS Tanguy <ta...@swift.com>.
Graham,

Take a look at <ReplaceRegExp> in the optional tasks - esp. the last 
example:

><replaceregexp match="\s+" replace=" " flags="g" byline="true">
>    <fileset dir="${html.dir}" includes="**/*.html" />
></replaceregexp>
>    
>
> replaces all whitespaces (blanks, tabs, etc) by one blank remaining 
> the line separator. So with input
>
><html>    <body>
><<TAB>><h1>    T E S T   </h1>  <<TAB>>    
><<TAB>> </body></html>
>    
>
> would converted to
>
><html> <body>
> <h1> T E S T </h1> </body></html>
>  
>
/t

Graham Reeds wrote:

>I've just looked on the ant.apache.org list of external tasks for a html
>reduction tool.  Currently I am using 'bloated' html so I can view/debug the
>source easily.  I was wondering if there is a tool available that would run
>through html source and remove all comments and all unnessary whitespace.  I
>would write one myself but my Java skills aren't '1337 3nuff' being a C++
>man at heart.
>
>P.S.  I've just recieved my copy of 'Java Development with Ant' - hope it
>was worth it:-)
>
>--
>
>Graham Reeds,
>grahamr@ntlworld.com
>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>
>
>  
>

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