|
[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message] RE: Removing dead targets from Ant build files
Many thanks Peter,
I have extended your solution very slightly.
Here it is:
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
exclude-result-prefixes="xsl">
<xsl:output method="xml" encoding="utf-8"/>
<xsl:template match="/project | description | comment()">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates></xsl:apply-templates>
</xsl:copy>
</xsl:template>
<xsl:template match="target">
<xsl:variable name="name" select="@name"></xsl:variable>
<xsl:if test="//target[contains(@depends,$name)] or
/project[@default=$name] or boolean(@description)"><xsl:copy-of
select="."/></xsl:if>
</xsl:template>
<xsl:template match="*">
<xsl:message terminate="yes">
<xsl:value-of select="concat('Unhandled tag=',name())"></xsl:value-of>
</xsl:message>
</xsl:template>
</xsl:stylesheet>
Happy New Year everybody,
Graham
|
PURCHASE STYLUS STUDIO ONLINE TODAY!Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced! Download The World's Best XML IDE!Accelerate XML development with our award-winning XML IDE - Download a free trial today! Subscribe in XML format
|






