ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Prashant Reddy <>
Subject RE: Formatter for ant scripts ?
Date Mon, 09 Jul 2007 12:42:32 GMT
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:
For additional commands, e-mail:

View raw message