</img>
</td>
<th>
- <a>
- <xsl:attribute name="name">
- <xsl:call-template name="object.id"/>
- </xsl:attribute>
- </a>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates select="." mode="object.title.markup"/>
</th>
</tr>
</xsl:if>
<h3 class="title">
- <a>
- <xsl:attribute name="name">
- <xsl:call-template name="object.id"/>
- </xsl:attribute>
- </a>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates select="." mode="object.title.markup"/>
</h3>
<xsl:template match="caution/title"></xsl:template>
<xsl:template match="tip/title"></xsl:template>
-<xsl:template match="title" mode="admonition.title.mode">
- <xsl:variable name="id">
- <xsl:call-template name="object.id">
- <xsl:with-param name="object" select=".."/>
- </xsl:call-template>
- </xsl:variable>
- <h3 class="title">
- <a name="{$id}">
- <xsl:apply-templates/>
- </a>
- </h3>
-</xsl:template>
-
-<xsl:template match="title" mode="graphic.admonition.title.mode">
- <xsl:variable name="id">
- <xsl:call-template name="object.id">
- <xsl:with-param name="object" select=".."/>
- </xsl:call-template>
- </xsl:variable>
- <b class="title">
- <a name="{$id}">
- <xsl:apply-templates/>
- </a>
- </b>
-</xsl:template>
-
</xsl:stylesheet>
<xsl:template match="bibliography/titleabbrev"></xsl:template>
<xsl:template match="bibliography/title" mode="component.title.mode">
- <xsl:variable name="id">
- <xsl:call-template name="object.id">
- <xsl:with-param name="object" select=".."/>
- </xsl:call-template>
- </xsl:variable>
<h2 class="title">
- <a name="{$id}">
- <xsl:apply-templates/>
- </a>
+ <xsl:call-template name="anchor">
+ <xsl:with-param name="node" select=".."/>
+ </xsl:call-template>
+ <xsl:apply-templates/>
</h2>
</xsl:template>
</xsl:template>
<xsl:template match="bibliodiv/title">
- <xsl:variable name="id">
- <xsl:call-template name="object.id">
- <xsl:with-param name="object" select=".."/>
- </xsl:call-template>
- </xsl:variable>
<h3 class="{name(.)}">
- <a name="{$id}">
- <xsl:apply-templates/>
- </a>
+ <xsl:call-template name="anchor">
+ <xsl:with-param name="node" select=".."/>
+ </xsl:call-template>
+ <xsl:apply-templates/>
</h3>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="biblioentry">
- <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+ <xsl:variable name="id">
+ <xsl:call-template name="object.id"/>
+ </xsl:variable>
+
<xsl:choose>
<xsl:when test="string(.) = ''">
<xsl:variable name="bib" select="document($bibliography.collection)"/>
<xsl:text> found in </xsl:text>
<xsl:value-of select="$bibliography.collection"/>
</xsl:message>
- <div id="{$id}" class="{name(.)}">
- <a name="{$id}"/>
+ <div class="{name(.)}">
+ <xsl:call-template name="anchor"/>
<p>
<xsl:text>Error: no bibliography entry: </xsl:text>
<xsl:value-of select="$id"/>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
- <div id="{$id}" class="{name(.)}">
- <a name="{$id}"/>
+ <div class="{name(.)}">
+ <xsl:call-template name="anchor"/>
<p>
<xsl:apply-templates mode="bibliography.mode"/>
</p>
</xsl:template>
<xsl:template match="bibliomixed">
- <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
+ <xsl:variable name="id">
+ <xsl:call-template name="object.id"/>
+ </xsl:variable>
+
<xsl:choose>
<xsl:when test="string(.) = ''">
<xsl:variable name="bib" select="document($bibliography.collection)"/>
<xsl:value-of select="$bibliography.collection"/>
</xsl:message>
<div id="{$id}" class="{name(.)}">
- <a name="{$id}"/>
+ <xsl:call-template name="anchor"/>
<p>
<xsl:text>Error: no bibliography entry: </xsl:text>
<xsl:value-of select="$id"/>
</xsl:when>
<xsl:otherwise>
<div id="{$id}" class="{name(.)}">
- <a name="{$id}"/>
+ <xsl:call-template name="anchor"/>
<p>
<xsl:choose>
<xsl:when test="local-name(*[1]) = 'abbrev'">
<xsl:template name="block.object">
<div class="{name(.)}">
- <a>
- <xsl:attribute name="name">
- <xsl:call-template name="object.id"/>
- </xsl:attribute>
- </a>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template match="para">
<p>
<xsl:if test="position() = 1 and parent::listitem">
- <a>
- <xsl:attribute name="name">
- <xsl:call-template name="object.id">
- <xsl:with-param name="object" select="parent::listitem"/>
- </xsl:call-template>
- </xsl:attribute>
- </a>
+ <xsl:call-template name="anchor">
+ <xsl:with-param name="node" select="parent::listitem"/>
+ </xsl:call-template>
</xsl:if>
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</p>
</xsl:template>
<xsl:template match="simpara">
<!-- see also listitem/simpara in lists.xsl -->
<p>
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</p>
</xsl:template>
<xsl:template match="formalpara">
<p>
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</p>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="blockquote">
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:choose>
<xsl:when test="attribution">
<table border="0" width="100%"
<xsl:template match="sidebar">
<div class="{name(.)}">
- <a>
- <xsl:attribute name="name">
- <xsl:call-template name="object.id"/>
- </xsl:attribute>
- </a>
-
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</div>
</xsl:template>
</xsl:template>
<xsl:template match="co">
- <a name="{@id}"/>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates select="." mode="callout-bug"/>
</xsl:template>
<xsl:template name="component.title">
<xsl:param name="node" select="."/>
- <xsl:variable name="id">
- <xsl:call-template name="object.id">
- <xsl:with-param name="object" select="$node"/>
- </xsl:call-template>
- </xsl:variable>
-
<h2 class="title">
- <a name="{$id}"/>
+ <xsl:call-template name="anchor">
+ <xsl:with-param name="node" select="$node"/>
+ </xsl:call-template>
<xsl:apply-templates select="$node" mode="object.title.markup"/>
</h2>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="dedication" mode="dedication">
- <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
- <div id="{$id}" class="{name(.)}">
+ <div class="{name(.)}">
<xsl:call-template name="dedication.titlepage"/>
<xsl:apply-templates/>
<xsl:call-template name="process.footnotes"/>
<!-- ==================================================================== -->
<xsl:template match="preface">
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
-
- <div id="{$id}" class="{name(.)}">
+ <div class="{name(.)}">
<xsl:call-template name="component.separator"/>
<xsl:call-template name="preface.titlepage"/>
<xsl:if test="$generate.preface.toc != '0'">
<!-- ==================================================================== -->
<xsl:template match="set">
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
-
- <div class="{name(.)}" id="{$id}">
+ <div class="{name(.)}">
<xsl:call-template name="set.titlepage"/>
<xsl:if test="$generate.set.toc != '0'">
<xsl:call-template name="set.toc"/>
<!-- ==================================================================== -->
<xsl:template match="book">
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
-
- <div class="{name(.)}" id="{$id}">
+ <div class="{name(.)}">
<xsl:call-template name="book.titlepage"/>
<xsl:apply-templates select="dedication" mode="dedication"/>
<xsl:if test="$generate.book.toc != '0'">
<!-- ==================================================================== -->
<xsl:template match="part">
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
-
- <div class="{name(.)}" id="{$id}">
+ <div class="{name(.)}">
<xsl:call-template name="part.titlepage"/>
<xsl:if test="not(partintro) and $generate.part.toc != '0'">
<xsl:call-template name="division.toc"/>
<xsl:template match="partintro/subtitle"></xsl:template>
<xsl:template match="partintro/title" mode="partintro.title.mode">
- <xsl:variable name="id">
- <xsl:call-template name="object.id">
- <xsl:with-param name="object" select=".."/>
- </xsl:call-template>
- </xsl:variable>
<h2>
- <a name="{$id}">
- <xsl:apply-templates/>
- </a>
+ <xsl:apply-templates/>
</h2>
</xsl:template>
<xsl:template match="production">
<xsl:param name="recap" select="false()"/>
- <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
<tr>
<td align="left" valign="top" width="3%">
<xsl:text>[</xsl:text>
</a>
</xsl:when>
<xsl:otherwise>
- <a name="{$id}"/>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates select="lhs"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template match="constraintdef">
- <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
<div class="{name(.)}">
- <a name="{$id}"/>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</div>
</xsl:template>
<xsl:template name="formal.object.heading">
<p>
- <a>
- <xsl:attribute name="name">
- <xsl:call-template name="object.id"/>
- </xsl:attribute>
- </a>
+ <xsl:call-template name="anchor"/>
<b>
<xsl:apply-templates select="." mode="object.title.markup">
<xsl:with-param name="allow-anchors" select="1"/>
</xsl:template>
<xsl:template name="informal.object">
- <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
-
- <div class="{name(.)}" id="{$id}">
+ <div class="{name(.)}">
<xsl:if test="$spacing.paras != 0"><p/></xsl:if>
- <a name="{$id}"/>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
<xsl:if test="$spacing.paras != 0"><p/></xsl:if>
</div>
<xsl:template match="glosslist">
<div class="{name(.)}">
- <a>
- <xsl:attribute name="name">
- <xsl:call-template name="object.id"/>
- </xsl:attribute>
- </a>
-
+ <xsl:call-template name="anchor"/>
<dl>
<xsl:apply-templates/>
</dl>
<xsl:template match="glossentry/glossterm[1]" priority="2">
<dt>
- <a>
- <xsl:attribute name="name">
- <xsl:call-template name="object.id">
- <xsl:with-param name="object" select=".."/>
- </xsl:call-template>
- </xsl:attribute>
-
- <xsl:apply-templates/>
- </a>
+ <xsl:call-template name="anchor">
+ <xsl:with-param name="node" select=".."/>
+ </xsl:call-template>
+ <xsl:apply-templates/>
</dt>
</xsl:template>
<xsl:template match="graphic">
<p>
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:call-template name="process.image"/>
</p>
</xsl:template>
******************************************************************** -->
+<xsl:template name="anchor">
+ <xsl:param name="node" select="."/>
+ <xsl:param name="conditional" select="1"/>
+ <xsl:variable name="id">
+ <xsl:call-template name="object.id">
+ <xsl:with-param name="object" select="$node"/>
+ </xsl:call-template>
+ </xsl:variable>
+ <xsl:if test="$conditional = 0 or $node/@id">
+ <a name="{$id}"/>
+ </xsl:if>
+</xsl:template>
+
<xsl:template name="dingbat">
<xsl:param name="dingbat">bullet</xsl:param>
<xsl:choose>
<!-- generated index should go. -->
<xsl:if test="count(*)>0 or $generate.index != '0'">
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
-
- <div id="{$id}" class="{name(.)}">
+ <div class="{name(.)}">
+ <xsl:call-template name="anchor"/>
<xsl:call-template name="index.titlepage"/>
<xsl:apply-templates/>
<xsl:template match="index/titleabbrev"></xsl:template>
<xsl:template match="index/title" mode="component.title.mode">
- <xsl:variable name="id">
- <xsl:call-template name="object.id">
- <xsl:with-param name="object" select=".."/>
- </xsl:call-template>
- </xsl:variable>
<h2 class="title">
- <a name="{$id}">
- <xsl:apply-templates/>
- </a>
+ <xsl:apply-templates/>
</h2>
</xsl:template>
<xsl:template match="indexdiv">
<div class="{name(.)}">
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates mode="not-indexentrys"/>
<dl>
<xsl:apply-templates select="indexentry"/>
</xsl:template>
<xsl:template match="indexdiv/title">
- <xsl:variable name="id">
- <xsl:call-template name="object.id">
- <xsl:with-param name="object" select=".."/>
- </xsl:call-template>
- </xsl:variable>
<h3 class="{name(.)}">
- <a name="{$id}">
- <xsl:apply-templates/>
- </a>
+ <xsl:apply-templates/>
</h3>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="indexterm">
+ <!-- this one must have a name, even if it doesn't have an ID -->
<xsl:variable name="id">
<xsl:call-template name="object.id"/>
</xsl:variable>
<xsl:template name="inline.charseq">
<xsl:param name="content">
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</xsl:param>
<xsl:copy-of select="$content"/>
<xsl:template name="inline.monoseq">
<xsl:param name="content">
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</xsl:param>
<tt><xsl:copy-of select="$content"/></tt>
<xsl:template name="inline.boldseq">
<xsl:param name="content">
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</xsl:param>
<!-- don't put <b> inside figure, example, or table titles -->
<xsl:template name="inline.italicseq">
<xsl:param name="content">
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</xsl:param>
<i><xsl:copy-of select="$content"/></i>
<xsl:template name="inline.boldmonoseq">
<xsl:param name="content">
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</xsl:param>
<!-- don't put <b> inside figure, example, or table titles -->
<xsl:template name="inline.italicmonoseq">
<xsl:param name="content">
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</xsl:param>
<i><tt><xsl:copy-of select="$content"/></tt></i>
<xsl:template name="inline.superscriptseq">
<xsl:param name="content">
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</xsl:param>
<sup><xsl:copy-of select="$content"/></sup>
<xsl:template name="inline.subscriptseq">
<xsl:param name="content">
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</xsl:param>
<sub><xsl:copy-of select="$content"/></sub>
</xsl:attribute>
</xsl:otherwise>
</xsl:choose>
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:choose>
<xsl:when test="@role = 'bold'">
<xsl:value-of select="@role"/>
</xsl:attribute>
</xsl:if>
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</span>
</xsl:template>
<xsl:template match="itemizedlist">
<div class="{name(.)}">
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:if test="title">
<xsl:apply-templates select="title"/>
</xsl:if>
</xsl:variable>
<div class="{name(.)}">
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:if test="title">
<xsl:apply-templates select="title"/>
</xsl:if>
<xsl:template match="variablelist">
<div class="{name(.)}">
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:if test="title">
<xsl:apply-templates select="title"/>
</xsl:if>
</xsl:template>
<xsl:template match="listitem">
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
<xsl:variable name="mark" select="ancestor-or-self::*/@mark"/>
<xsl:variable name="override" select="@override"/>
is a para, assume the para will put in the anchor. Otherwise,
put the anchor in anyway. -->
<xsl:if test="local-name(child::*[1]) != 'para'">
- <a name="{$id}"/>
+ <xsl:call-template name="anchor"/>
</xsl:if>
<xsl:choose>
<xsl:choose>
<xsl:when test="not(preceding-sibling::*)
and not (following-sibling::*)">
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</xsl:when>
<xsl:otherwise>
<p>
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</p>
</xsl:otherwise>
</xsl:template>
<xsl:template match="varlistentry">
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
- <dt><a name="{$id}"/><xsl:apply-templates select="term"/></dt>
- <dd><xsl:apply-templates select="listitem"/></dd>
+ <dt>
+ <xsl:call-template name="anchor"/>
+ <xsl:apply-templates select="term"/>
+ </dt>
+ <dd>
+ <xsl:apply-templates select="listitem"/>
+ </dd>
</xsl:template>
<xsl:template match="varlistentry/term">
<span class="term">
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
<xsl:text>, </xsl:text>
</span>
<xsl:template match="varlistentry/term[position()=last()]" priority="2">
<span class="term">
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</span>
</xsl:template>
<xsl:template match="simplelist">
<!-- with no type specified, the default is 'vert' -->
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<table class="simplelist" border="0" summary="Simple list">
<xsl:call-template name="simplelist.vert">
<xsl:with-param name="cols">
<xsl:template match="simplelist[@type='inline']">
<span class="{name(.)}">
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</span>
</xsl:template>
<xsl:template match="simplelist[@type='horiz']">
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<table class="simplelist" border="0" summary="Simple list">
<xsl:call-template name="simplelist.horiz">
<xsl:with-param name="cols">
</xsl:template>
<xsl:template match="simplelist[@type='vert']">
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<table class="simplelist" border="0" summary="Simple list">
<xsl:call-template name="simplelist.vert">
<xsl:with-param name="cols">
<xsl:template match="procedure">
<div class="{name(.)}">
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:if test="title or $formal.procedures != 0">
<xsl:call-template name="formal.object.heading"/>
</xsl:if>
<xsl:call-template name="procedure.step.numeration"/>
</xsl:variable>
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<ol type="{$numeration}">
<xsl:apply-templates/>
</xsl:template>
<xsl:template match="step">
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
-
<li>
- <a name="{$id}"/>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</li>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="segmentedlist">
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="calloutlist">
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
<div class="{name(.)}">
- <a name="{$id}"/>
+ <xsl:call-template name="anchor"/>
<xsl:if test="./title">
<p>
<b>
</xsl:template>
<xsl:template match="callout">
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
<xsl:choose>
<xsl:when test="$callout.list.table != 0">
<tr>
<td width="5%" valign="top" align="left">
- <a name="{$id}"/>
+ <xsl:call-template name="anchor"/>
<xsl:call-template name="callout.arearefs">
<xsl:with-param name="arearefs" select="@arearefs"/>
</xsl:call-template>
</xsl:when>
<xsl:otherwise>
<dt>
- <a name="{$id}"/>
+ <xsl:call-template name="anchor"/>
<xsl:call-template name="callout.arearefs">
<xsl:with-param name="arearefs" select="@arearefs"/>
</xsl:call-template>
<xsl:variable name="qalevel">
<xsl:call-template name="qandadiv.section.level"/>
</xsl:variable>
- <xsl:variable name="id">
- <xsl:call-template name="object.id">
- <xsl:with-param name="object" select="parent::*"/>
- </xsl:call-template>
- </xsl:variable>
<xsl:element name="h{string(number($qalevel)+1)}">
<xsl:attribute name="class">
<xsl:value-of select="name(.)"/>
</xsl:attribute>
- <a name="{$id}"/>
+ <xsl:call-template name="anchor">
+ <xsl:with-param name="node" select=".."/>
+ </xsl:call-template>
<xsl:apply-templates select="parent::qandadiv" mode="label.markup"/>
<xsl:text> </xsl:text>
<xsl:apply-templates/>
<div class="{name(.)}">
<p>
- <xsl:if test="../@id">
- <a>
- <xsl:attribute name="name">
- <xsl:call-template name="object.id">
- <xsl:with-param name="object" select="parent::*"/>
- </xsl:call-template>
- </xsl:attribute>
- </a>
- </xsl:if>
- <a name="{$id}"/>
+ <xsl:call-template name="anchor">
+ <xsl:with-param name="node" select=".."/>
+ </xsl:call-template>
+ <xsl:call-template name="anchor"/>
<xsl:choose>
<xsl:when test="$deflabel = 'none'">
<xsl:template match="answer">
<xsl:variable name="firstch" select="(*[name(.)!='label'])[1]"/>
<xsl:variable name="restch" select="(*[name(.)!='label'])[position()!=1]"/>
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
<div class="{name(.)}">
<p>
- <a name="{$id}"/>
+ <xsl:call-template name="anchor"/>
<b>
<xsl:apply-templates select="." mode="label.markup"/>
</b>
<!-- ==================================================================== -->
<xsl:template match="reference">
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
-
<div class="{name(.)}">
- <xsl:if test="@id">
- <a name="{$id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:call-template name="reference.titlepage"/>
<xsl:if test="not(partintro) and $generate.reference.toc != '0'">
<xsl:call-template name="division.toc"/>
<div class="{name(.)}">
<h1 class="title">
- <a>
- <xsl:attribute name="name">
- <xsl:call-template name="object.id"/>
- </xsl:attribute>
- </a>
+ <xsl:call-template name="anchor"/>
<xsl:copy-of select="$title"/>
</h1>
<xsl:apply-templates/>
<xsl:template match="refnamediv">
<div class="{name(.)}">
- <a>
- <xsl:attribute name="name">
- <xsl:call-template name="object.id"/>
- </xsl:attribute>
- </a>
+ <xsl:call-template name="anchor"/>
<xsl:if test="$refentry.generate.name != 0">
<h2>
<xsl:call-template name="gentext">
<xsl:template match="refsynopsisdiv">
<div class="{name(.)}">
- <a>
- <xsl:attribute name="name">
- <xsl:call-template name="object.id"/>
- </xsl:attribute>
- </a>
+ <xsl:call-template name="anchor"/>
<h2>
<xsl:choose>
<xsl:when test="refsynopsisdiv/title|title">
<!-- ==================================================================== -->
<xsl:template match="section">
- <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
<xsl:variable name="depth" select="count(ancestor::section)+1"/>
<div class="{name(.)}">
- <a name="{$id}"/>
<xsl:call-template name="section.titlepage"/>
<xsl:if test="($generate.section.toc != '0'
and $depth <= $generate.section.toc.level)
</xsl:template>
<xsl:template match="sect1">
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
-
<div class="{name(.)}">
- <a name="{$id}"/>
<xsl:call-template name="sect1.titlepage"/>
<xsl:if test="($generate.section.toc != '0'
and $generate.section.toc.level >= 1)
</xsl:template>
<xsl:template match="sect2">
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
-
<div class="{name(.)}">
- <a name="{$id}"/>
<xsl:call-template name="sect2.titlepage"/>
<xsl:if test="($generate.section.toc != '0'
and $generate.section.toc.level >= 2)
</xsl:template>
<xsl:template match="sect3">
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
-
<div class="{name(.)}">
- <a name="{$id}"/>
<xsl:call-template name="sect3.titlepage"/>
<xsl:if test="($generate.section.toc != '0'
and $generate.section.toc.level >= 3)
</xsl:template>
<xsl:template match="sect4">
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
-
<div class="{name(.)}">
- <a name="{$id}"/>
<xsl:call-template name="sect4.titlepage"/>
<xsl:if test="($generate.section.toc != '0'
and $generate.section.toc.level >= 4)
</xsl:template>
<xsl:template match="sect5">
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
-
<div class="{name(.)}">
- <a name="{$id}"/>
<xsl:call-template name="sect5.titlepage"/>
<xsl:if test="($generate.section.toc != '0'
and $generate.section.toc.level >= 5)
</xsl:template>
<xsl:template match="simplesect">
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
-
<div class="{name(.)}">
- <a name="{$id}"/>
<xsl:call-template name="simplesect.titlepage"/>
<xsl:apply-templates/>
</div>
<xsl:param name="section" select="."/>
<xsl:param name="level" select="'1'"/>
<xsl:param name="title"/>
+
+ <xsl:variable name="id">
+ <xsl:choose>
+ <!-- if title is in an *info wrapper, get the grandparent -->
+ <xsl:when test="contains(local-name(..), 'info')">
+ <xsl:call-template name="object.id">
+ <xsl:with-param name="object" select="../.."/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:call-template name="object.id">
+ <xsl:with-param name="object" select=".."/>
+ </xsl:call-template>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
+
<xsl:element name="h{$level}">
<xsl:attribute name="class">title</xsl:attribute>
<xsl:if test="$css.decoration != '0'">
<xsl:attribute name="style">clear: both</xsl:attribute>
</xsl:if>
</xsl:if>
- <a>
- <xsl:attribute name="name">
- <xsl:call-template name="object.id">
- <xsl:with-param name="object" select="$section"/>
- </xsl:call-template>
- </xsl:attribute>
- </a>
+ <xsl:call-template name="anchor">
+ <xsl:with-param name="node" select="$section"/>
+ <xsl:with-param name="conditional" select="0"/>
+ </xsl:call-template>
<xsl:copy-of select="$title"/>
</xsl:element>
</xsl:template>
</xsl:choose>
</xsl:variable>
- <xsl:variable name="id">
- <xsl:call-template name="object.id"/>
- </xsl:variable>
-
<xsl:element name="h{$level}">
- <a name="{$id}"/>
+ <xsl:call-template name="anchor">
+ <xsl:with-param name="conditional" select="0"/>
+ </xsl:call-template>
<xsl:apply-templates/>
</xsl:element>
</xsl:template>
<!-- ==================================================================== -->
<xsl:template match="cmdsynopsis">
- <xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
-
- <div class="{name(.)}" id="{$id}">
+ <div class="{name(.)}">
<p>
- <a name="{$id}"/>
+ <xsl:call-template name="anchor"/>
<xsl:apply-templates/>
</p>
</div>
<xsl:if test="not(preceding-sibling::*)
and ancestor::row/@id">
- <a name="{ancestor::row/@id}"/>
+ <xsl:call-template name="anchor">
+ <xsl:with-param name="node" select="ancestor::row[1]"/>
+ </xsl:call-template>
</xsl:if>
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:choose>
<xsl:when test="$empty.cell">
<xsl:variable name="vendor" select="system-property('xsl:vendor')"/>
<xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
- <xsl:if test="@id">
- <a href="{$id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:variable name="content">
<xsl:choose>
<!-- ==================================================================== -->
<xsl:template match="anchor">
- <a>
- <xsl:attribute name="name">
- <xsl:call-template name="object.id"/>
- </xsl:attribute>
- </a>
+ <xsl:call-template name="anchor"/>
</xsl:template>
<!-- ==================================================================== -->
<xsl:with-param name="linkend" select="@linkend"/>
</xsl:call-template>
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
+ <xsl:call-template name="anchor"/>
<xsl:choose>
<xsl:when test="count($target) = 0">
</xsl:template>
<xsl:template match="olink">
- <xsl:if test="@id">
- <a name="{@id}"/>
- </xsl:if>
-
+ <xsl:call-template name="anchor"/>
<xsl:variable name="localinfo" select="@localinfo"/>
<xsl:variable name="href">