|
Subject: RE: [xsl] Removing dead targets from Ant build files From: "Heath, Graham" <Graham.Heath@xxxxxxxxxxxxxxxxxxx> Date: Wed, 2 Jan 2008 11:17:36 +0100 |
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
| Current Thread |
|---|
|
| <- Previous | Index | Next -> |
|---|---|---|
| RE: [xsl] Apache FOP Processor Erro, Angela Williams | Thread | Re: [xsl] Removing dead targets fro, J.Pietschmann |
| [xsl] Apache FOP Processor Error, Vanaja Selvaraj | Date | Re: [xsl] Replacing values in xml f, Mukul Gandhi |
| Month |