changeset 7271:9543b768d740

Added check for duplicate macros.
author Sascha L. Teichmann <teichmann@intevation.de>
date Wed, 09 Oct 2013 16:17:22 +0200
parents a365e587af67
children f6e6e0e87426
files artifacts/contrib/list-unused-macros.xsl
diffstat 1 files changed, 10 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/artifacts/contrib/list-unused-macros.xsl	Wed Oct 09 13:05:37 2013 +0200
+++ b/artifacts/contrib/list-unused-macros.xsl	Wed Oct 09 16:17:22 2013 +0200
@@ -7,6 +7,16 @@
   <xsl:output method="text" encoding="UTF-8"/>
 
   <xsl:template match="/">
+    <xsl:text>Duplicate macros:&#xa;</xsl:text>
+    <xsl:for-each select="//dc:macro/@name">
+      <xsl:variable name="mname" select="."/>
+      <xsl:if test="count(//dc:macro[@name=$mname]) &gt; 1">
+        <xsl:text>  </xsl:text>
+        <xsl:value-of select="$mname"/>
+        <xsl:text>&#xa;</xsl:text>
+      </xsl:if>
+    </xsl:for-each>
+
     <xsl:text>Marcos defined but not called:&#xa;</xsl:text>
     <xsl:for-each select="//dc:macro/@name">
       <xsl:variable name="mname" select="."/>

http://dive4elements.wald.intevation.org