<!-- ==================================================================== -->
<xsl:template match="bibliography">
+ <xsl:call-template name="id.warning"/>
+
<div class="{name(.)}">
<xsl:if test="$generate.id.attributes != 0">
<xsl:attribute name="id">
<!-- ==================================================================== -->
<xsl:template match="bibliodiv">
+ <xsl:call-template name="id.warning"/>
+
<div class="{name(.)}">
<xsl:apply-templates/>
</div>
<!-- ==================================================================== -->
<xsl:template match="dedication" mode="dedication">
+ <xsl:call-template name="id.warning"/>
+
<div class="{name(.)}">
<xsl:call-template name="dir">
<xsl:with-param name="inherit" select="1"/>
<!-- ==================================================================== -->
<xsl:template match="colophon">
+ <xsl:call-template name="id.warning"/>
+
<div class="{name(.)}">
<xsl:call-template name="dir">
<xsl:with-param name="inherit" select="1"/>
<!-- ==================================================================== -->
<xsl:template match="preface">
+ <xsl:call-template name="id.warning"/>
+
<div class="{name(.)}">
<xsl:call-template name="dir">
<xsl:with-param name="inherit" select="1"/>
<!-- ==================================================================== -->
<xsl:template match="chapter">
+ <xsl:call-template name="id.warning"/>
+
<div class="{name(.)}">
<xsl:call-template name="dir">
<xsl:with-param name="inherit" select="1"/>
<xsl:call-template name="chunk"/>
</xsl:variable>
+ <xsl:call-template name="id.warning"/>
+
<div class="{name(.)}">
<xsl:call-template name="dir">
<xsl:with-param name="inherit" select="1"/>
<!-- ==================================================================== -->
<xsl:template match="article">
+ <xsl:call-template name="id.warning"/>
+
<div class="{name(.)}">
<xsl:call-template name="dir">
<xsl:with-param name="inherit" select="1"/>
<!-- ==================================================================== -->
<xsl:template match="set">
+ <xsl:call-template name="id.warning"/>
+
<div class="{name(.)}">
<xsl:call-template name="dir">
<xsl:with-param name="inherit" select="1"/>
<!-- ==================================================================== -->
<xsl:template match="book">
+ <xsl:call-template name="id.warning"/>
+
<div class="{name(.)}">
<xsl:call-template name="dir">
<xsl:with-param name="inherit" select="1"/>
<!-- ==================================================================== -->
<xsl:template match="part">
+ <xsl:call-template name="id.warning"/>
+
<div class="{name(.)}">
<xsl:call-template name="dir">
<xsl:with-param name="inherit" select="1"/>
<xsl:template match="part/subtitle"></xsl:template>
<xsl:template match="partintro">
+ <xsl:call-template name="id.warning"/>
+
<div class="{name(.)}">
<xsl:call-template name="dir">
<xsl:with-param name="inherit" select="1"/>
<xsl:param name="placement" select="'before'"/>
<xsl:param name="class" select="local-name(.)"/>
+ <xsl:call-template name="id.warning"/>
+
<div class="{$class}">
<xsl:call-template name="anchor">
<xsl:with-param name="conditional" select="0"/>
<!-- ==================================================================== -->
<xsl:template match="glossary">
+ <xsl:call-template name="id.warning"/>
+
<div class="{name(.)}">
<xsl:if test="$generate.id.attributes != 0">
<xsl:attribute name="id">
<!-- ==================================================================== -->
<xsl:template match="glossdiv">
+ <xsl:call-template name="id.warning"/>
+
<div class="{name(.)}">
<xsl:apply-templates select="(glossentry[1]/preceding-sibling::*)"/>
<xsl:variable name="terms" select="//glossterm[not(parent::glossdef)]|//firstterm"/>
<xsl:variable name="collection" select="document($glossary.collection, .)"/>
+ <xsl:call-template name="id.warning"/>
+
<xsl:if test="$glossary.collection = ''">
<xsl:message>
<xsl:text>Warning: processing automatic glossary </xsl:text>
</xsl:choose>
</xsl:template>
+<xsl:template name="id.warning">
+ <xsl:if test="not(@id) and not(@xml:id) and parent::*">
+ <xsl:variable name="title">
+ <xsl:choose>
+ <xsl:when test="title">
+ <xsl:value-of select="title[1]"/>
+ </xsl:when>
+ <xsl:when test="contains(local-name(*[1]),'info')">
+ <xsl:value-of select="*[1]/title[1]"/>
+ </xsl:when>
+ <xsl:when test="refmeta/refentrytitle">
+ <xsl:value-of select="refmeta/refentrytitle"/>
+ </xsl:when>
+ <xsl:when test="refnamediv/refname">
+ <xsl:value-of select="refnamediv/refname[1]"/>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:variable>
+
+ <xsl:message>
+ <xsl:text>ID recommended on </xsl:text>
+ <xsl:value-of select="local-name(.)"/>
+ <xsl:if test="$title != ''">
+ <xsl:text>: </xsl:text>
+ <xsl:choose>
+ <xsl:when test="string-length($title) > 40">
+ <xsl:value-of select="substring($title,1,40)"/>
+ <xsl:text>...</xsl:text>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$title"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:if>
+ </xsl:message>
+ </xsl:if>
+</xsl:template>
+
</xsl:stylesheet>
<!-- is non-zero, in which case, this is where the automatically -->
<!-- generated index should go. -->
+ <xsl:call-template name="id.warning"/>
+
<xsl:if test="count(*)>0 or $generate.index != '0'">
<div class="{name(.)}">
<xsl:if test="$generate.id.attributes != 0">
<!-- is non-zero, in which case, this is where the automatically -->
<!-- generated index should go. -->
+ <xsl:call-template name="id.warning"/>
+
<xsl:if test="count(*)>0 or $generate.index != '0'">
<div class="{name(.)}">
<xsl:if test="$generate.id.attributes != 0">
<!-- ==================================================================== -->
<xsl:template match="indexdiv">
+ <xsl:call-template name="id.warning"/>
+
<div class="{name(.)}">
<xsl:if test="$generate.id.attributes != 0">
<xsl:attribute name="id">
<!ENTITY annotation.graphic.close SYSTEM "../params/annotation.graphic.close.xml">
<!ENTITY annotation.css SYSTEM "../params/annotation.css.xml">
<!ENTITY keep.relative.image.uris SYSTEM "../params/keep.relative.image.uris.xml">
+<!ENTITY id.warnings SYSTEM "../params/id.warnings.xml">
&suppress.footer.navigation;
&header.rule;
&footer.rule;
+&id.warnings;
</reference>
<reference id="meta"><title>Meta/*Info</title>
<src:fragref linkend="htmlhelp.use.hhk.frag"/>
<src:fragref linkend="htmlhelp.window.geometry.frag"/>
<src:fragref linkend="img.src.path.frag"/>
+<src:fragref linkend="id.warnings.frag"/>
<src:fragref linkend="index.on.role.frag"/>
<src:fragref linkend="index.on.type.frag"/>
<src:fragref linkend="index.prefer.titleabbrev.frag"/>
<!-- ==================================================================== -->
<xsl:template match="reference">
+ <xsl:call-template name="id.warning"/>
+
<div class="{name(.)}">
<xsl:call-template name="dir">
<xsl:with-param name="inherit" select="1"/>
</xsl:template>
<xsl:template match="refentry">
+ <xsl:call-template name="id.warning"/>
+
<div class="{name(.)}">
<xsl:call-template name="dir">
<xsl:with-param name="inherit" select="1"/>
<xsl:template match="section">
<xsl:variable name="depth" select="count(ancestor::section)+1"/>
+ <xsl:call-template name="id.warning"/>
+
<div class="{name(.)}">
<xsl:call-template name="dir">
<xsl:with-param name="inherit" select="1"/>
</xsl:template>
<xsl:template match="sect1">
+ <xsl:call-template name="id.warning"/>
+
<div class="{name(.)}">
<xsl:call-template name="dir">
<xsl:with-param name="inherit" select="1"/>
</xsl:template>
<xsl:template match="sect2">
+ <xsl:call-template name="id.warning"/>
+
<div class="{name(.)}">
<xsl:call-template name="dir">
<xsl:with-param name="inherit" select="1"/>
</xsl:template>
<xsl:template match="sect2/title" mode="titlepage.mode" priority="2">
+ <xsl:call-template name="id.warning"/>
+
<xsl:call-template name="section.title"/>
</xsl:template>
<xsl:template match="sect3">
+ <xsl:call-template name="id.warning"/>
+
<div class="{name(.)}">
<xsl:call-template name="dir">
<xsl:with-param name="inherit" select="1"/>
</xsl:template>
<xsl:template match="sect4">
+ <xsl:call-template name="id.warning"/>
+
<div class="{name(.)}">
<xsl:call-template name="dir">
<xsl:with-param name="inherit" select="1"/>
</xsl:template>
<xsl:template match="sect5">
+ <xsl:call-template name="id.warning"/>
+
<div class="{name(.)}">
<xsl:call-template name="dir">
<xsl:with-param name="inherit" select="1"/>
</xsl:template>
<xsl:template match="simplesect">
+ <xsl:call-template name="id.warning"/>
+
<div class="{name(.)}">
<xsl:call-template name="dir">
<xsl:with-param name="inherit" select="1"/>
--- /dev/null
+<refentry id="id.warnings">
+<refmeta>
+<refentrytitle>id.warnings</refentrytitle>
+<refmiscinfo role="type">boolean</refmiscinfo>
+</refmeta>
+<refnamediv>
+<refname>id.warnings</refname>
+<refpurpose>Should warnings be generated for titled elements without IDs?</refpurpose>
+</refnamediv>
+
+<refsynopsisdiv>
+<src:fragment id='id.warnings.frag'>
+<xsl:param name="id.warnings" select="1"/>
+</src:fragment>
+</refsynopsisdiv>
+
+<refsect1><title>Description</title>
+
+<para>If non-zero, the stylesheet will issue a warning for
+any element (other than the root element) which
+has a title but does not have an ID.</para>
+
+</refsect1>
+</refentry>