annotate artifacts/contrib/list-unused-macros.xsl @ 8150:fe67edde6189

Do not put metadata on series if there are none (avoid NPE).
author Tom Gottfried <tom@intevation.de>
date Thu, 28 Aug 2014 15:34:57 +0200
parents 9543b768d740
children
rev   line source
5987
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
1 <?xml version="1.0" encoding="UTF-8"?>
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
2 <xsl:stylesheet
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
3 xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
4 xmlns:dc="http://www.intevation.org/2011/Datacage"
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
5 version="1.0">
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
6
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
7 <xsl:output method="text" encoding="UTF-8"/>
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
8
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
9 <xsl:template match="/">
7271
9543b768d740 Added check for duplicate macros.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5987
diff changeset
10 <xsl:text>Duplicate macros:&#xa;</xsl:text>
9543b768d740 Added check for duplicate macros.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5987
diff changeset
11 <xsl:for-each select="//dc:macro/@name">
9543b768d740 Added check for duplicate macros.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5987
diff changeset
12 <xsl:variable name="mname" select="."/>
9543b768d740 Added check for duplicate macros.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5987
diff changeset
13 <xsl:if test="count(//dc:macro[@name=$mname]) &gt; 1">
9543b768d740 Added check for duplicate macros.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5987
diff changeset
14 <xsl:text> </xsl:text>
9543b768d740 Added check for duplicate macros.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5987
diff changeset
15 <xsl:value-of select="$mname"/>
9543b768d740 Added check for duplicate macros.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5987
diff changeset
16 <xsl:text>&#xa;</xsl:text>
9543b768d740 Added check for duplicate macros.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5987
diff changeset
17 </xsl:if>
9543b768d740 Added check for duplicate macros.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5987
diff changeset
18 </xsl:for-each>
9543b768d740 Added check for duplicate macros.
Sascha L. Teichmann <teichmann@intevation.de>
parents: 5987
diff changeset
19
5987
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
20 <xsl:text>Marcos defined but not called:&#xa;</xsl:text>
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
21 <xsl:for-each select="//dc:macro/@name">
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
22 <xsl:variable name="mname" select="."/>
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
23 <xsl:if test="count(//dc:call-macro[@name=$mname]) = 0">
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
24 <xsl:text> </xsl:text>
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
25 <xsl:value-of select="$mname"/>
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
26 <xsl:text>&#xa;</xsl:text>
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
27 </xsl:if>
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
28 </xsl:for-each>
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
29
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
30 <xsl:text>Marcos called but not defined:&#xa;</xsl:text>
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
31 <xsl:for-each select="//dc:call-macro/@name">
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
32 <xsl:variable name="mname" select="."/>
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
33 <xsl:if test="count(//dc:macro[@name=$mname]) = 0">
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
34 <xsl:text> </xsl:text>
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
35 <xsl:value-of select="$mname"/>
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
36 <xsl:text>&#xa;</xsl:text>
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
37 </xsl:if>
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
38 </xsl:for-each>
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
39 </xsl:template>
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
40 </xsl:stylesheet>
e5e2b0630855 Datacage: Added stylesheet to detect macros which are defined and not called and vice versa.
Sascha L. Teichmann <teichmann@intevation.de>
parents:
diff changeset
41

http://dive4elements.wald.intevation.org