Java Mailing List Archive

Apache Ant Archive

» Ant Users List
» Ant Developers List
Formatter for ant scripts ?

Formatter for ant scripts ?

2007-07-09       - By Prashant Reddy
Reply:     <<     11  

On Mon, 2007-07-09 at 13:48 +0200, Rebhan, Gilbert wrote:
> Beside that, there maybe a solution with xslt, but i'm no specialist
> for xslt !?

I have used the following xsl successfully to pretty print a XML.

It should not hard to hook this XSL up with xslt task.

Hope this helps

<xsl:stylesheet version="1.0"
   <xsl:output method="xml" indent="yes"/>
   <xsl:param name="indent-increment" select="'   '"/>

   <xsl:template match="*">
       <xsl:param name="indent" select="'&#xA;'"/>

       <xsl:value-of select="$indent" />
           <xsl:copy-of select="@*"/>
               <xsl:with-param name="indent"
                   select="concat($indent, $indent-increment)"/>
           <xsl:if test="*">
               <xsl:value-of select="$indent"/>

   <xsl:template match="comment()|processing-instruction()">

   <!-- WARNING: this is dangerous. Handle with care -->
   <xsl:template match="text()[normalize-space(.)='']"/>



Don't upload, just share :

To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 - Jax Systems, LLC, U.S.A.