ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From weiji <nabbl...@hotmail.com>
Subject Re: AW: help with filterchain: using regex filter...
Date Tue, 11 Aug 2009 18:45:17 GMT



Jan.Materne wrote:
> 
> Wouldnt be a XSLT easier?
> 
> Jan
> 
> 
> <?xml version="1.0" encoding="ISO-8859-1"?>
> <xsl:stylesheet
>   version="1.0"
>   xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
> 
> <xsl:template match="/">
> <xsl:comment>generated file - do not change</xsl:comment>
> <componentPackage>
>     <xsl:apply-templates/>
> </componentPackage>
> </xsl:template>
> 
> 
> <xsl:template match="classEntry">
>   <component class="{@path}">
>     <xsl:attribute name="id">
>       <xsl:call-template name="substring-after-last">
>         <xsl:with-param name="string" select="@path" />
>         <xsl:with-param name="delimiter" select="'.'" />
>       </xsl:call-template>
>     </xsl:attribute>
>   </component>
> </xsl:template>
> 
> 
> <xsl:template name="substring-after-last">
>   <xsl:param name="string" />
>   <xsl:param name="delimiter" />
>   <xsl:choose>
>     <xsl:when test="contains($string, $delimiter)">
>       <xsl:call-template name="substring-after-last">
>         <xsl:with-param name="string"
>           select="substring-after($string, $delimiter)" />
>         <xsl:with-param name="delimiter" select="$delimiter" />
>       </xsl:call-template>
>     </xsl:when>
>     <xsl:otherwise><xsl:value-of select="$string" /></xsl:otherwise>
>   </xsl:choose>
> </xsl:template>
> 
> </xsl:stylesheet> 
> 
> 


Jan - this worked perfectly!  It was actually very easy to set up.  My
target only uses a single task now:
        <xslt in=".flexLibProperties" out="manifest.xml"
style="build-manifest-style.xsl"/>

... where build-manifest-style.xsl contains the xml you provided.

Thanks again,
KaJun
-- 
View this message in context: http://www.nabble.com/help-with-filterchain%3A-using-regex-filter...-tp24912535p24923469.html
Sent from the Ant - Users mailing list archive at Nabble.com.


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


Mime
View raw message