Mercurial > dive4elements > river
comparison artifacts/contrib/list-unused-macros.xsl @ 7271:9543b768d740
Added check for duplicate macros.
author | Sascha L. Teichmann <teichmann@intevation.de> |
---|---|
date | Wed, 09 Oct 2013 16:17:22 +0200 |
parents | e5e2b0630855 |
children |
comparison
equal
deleted
inserted
replaced
7270:a365e587af67 | 7271:9543b768d740 |
---|---|
5 version="1.0"> | 5 version="1.0"> |
6 | 6 |
7 <xsl:output method="text" encoding="UTF-8"/> | 7 <xsl:output method="text" encoding="UTF-8"/> |
8 | 8 |
9 <xsl:template match="/"> | 9 <xsl:template match="/"> |
10 <xsl:text>Duplicate macros:
</xsl:text> | |
11 <xsl:for-each select="//dc:macro/@name"> | |
12 <xsl:variable name="mname" select="."/> | |
13 <xsl:if test="count(//dc:macro[@name=$mname]) > 1"> | |
14 <xsl:text> </xsl:text> | |
15 <xsl:value-of select="$mname"/> | |
16 <xsl:text>
</xsl:text> | |
17 </xsl:if> | |
18 </xsl:for-each> | |
19 | |
10 <xsl:text>Marcos defined but not called:
</xsl:text> | 20 <xsl:text>Marcos defined but not called:
</xsl:text> |
11 <xsl:for-each select="//dc:macro/@name"> | 21 <xsl:for-each select="//dc:macro/@name"> |
12 <xsl:variable name="mname" select="."/> | 22 <xsl:variable name="mname" select="."/> |
13 <xsl:if test="count(//dc:call-macro[@name=$mname]) = 0"> | 23 <xsl:if test="count(//dc:call-macro[@name=$mname]) = 0"> |
14 <xsl:text> </xsl:text> | 24 <xsl:text> </xsl:text> |