summaryrefslogtreecommitdiff
path: root/xslt/xsldoc
diff options
context:
space:
mode:
Diffstat (limited to 'xslt/xsldoc')
-rw-r--r--xslt/xsldoc/xsldoc.xsl27
1 files changed, 27 insertions, 0 deletions
diff --git a/xslt/xsldoc/xsldoc.xsl b/xslt/xsldoc/xsldoc.xsl
index 914890a..3a5322d 100644
--- a/xslt/xsldoc/xsldoc.xsl
+++ b/xslt/xsldoc/xsldoc.xsl
@@ -63,6 +63,8 @@
</doc:template>
<xsl:template name="xsldoc.checks">
+ <xsl:variable name="stylesheet" select="."/>
+
<!-- Check for orphaned doc:parameter -->
<xsl:for-each select="doc:parameter">
<xsl:if test="not(following-sibling::*[1]/
@@ -111,6 +113,20 @@
</xsl:if>
</xsl:for-each>
+ <!-- Check for orphaned doc:mode -->
+ <xsl:for-each select="doc:mode">
+ <xsl:if test="not($stylesheet/xsl:template[@mode = current()/doc:name])">
+ <xsl:if test="not($stylesheet/xsl:template//
+ xsl:call-template[@mode = current()/doc:name])">
+ <xsl:message>
+ <xsl:value-of select="$xsldoc.id"/>
+ <xsl:text>: Orphaned doc:mode </xsl:text>
+ <xsl:value-of select="doc:name"/>
+ </xsl:message>
+ </xsl:if>
+ </xsl:if>
+ </xsl:for-each>
+
<!-- Check for undocumented xsl:template/@mode -->
<xsl:for-each select="xsl:template[@mode]">
<xsl:if test="not(preceding-sibling::xsl:template[@mode = current()/@mode])">
@@ -123,6 +139,17 @@
</xsl:if>
</xsl:if>
</xsl:for-each>
+
+ <!-- Check for undocumented xsl:call-template/@mode -->
+ <xsl:for-each select="xsl:template//xsl:call-template[@mode]">
+ <xsl:if test="not($stylesheet/doc:mode[doc:name = current()/@mode])">
+ <xsl:message>
+ <xsl:value-of select="$xsldoc.id"/>
+ <xsl:text>: Undocumented xsl:call-template/@mode </xsl:text>
+ <xsl:value-of select="@mode"/>
+ </xsl:message>
+ </xsl:if>
+ </xsl:for-each>
</xsl:template>