diff options
Diffstat (limited to 'docs/manual.xsl')
-rw-r--r-- | docs/manual.xsl | 32 |
1 files changed, 25 insertions, 7 deletions
diff --git a/docs/manual.xsl b/docs/manual.xsl index 1875f6e..58d2d99 100644 --- a/docs/manual.xsl +++ b/docs/manual.xsl @@ -86,14 +86,32 @@ </xsl:template>
<xsl:template match="section[@id='manual.toc']/para[normalize-space(text())='toc-placeholder']">
- <!-- trick to switch context node to root element -->
- <xsl:for-each select="/*">
- <xsl:call-template name="component.toc">
- <xsl:with-param name="toc.title.p" select="false()" />
- </xsl:call-template>
- </xsl:for-each>
+ <xsl:call-template name="make.toc">
+ <xsl:with-param name="toc-context" select="." />
+ <xsl:with-param name="toc.title.p" select="false()" />
+ <xsl:with-param name="nodes" select="/book/section" />
+ </xsl:call-template>
</xsl:template>
<xsl:template name="book.titlepage" />
-</xsl:stylesheet>
+ <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:choose>
+ <xsl:when test="$node/@id or $node/@xml:id">
+ <a name="{$id}"/>
+ </xsl:when>
+ <xsl:when test="$conditional = 0 and local-name($node) != 'bridgehead'">
+ <xsl:message terminate="yes">
+ <xsl:text>ERROR: Autogenerated id detected for element </xsl:text><xsl:value-of select="local-name($node)" />
+ </xsl:message>
+ </xsl:when>
+ </xsl:choose>
+ </xsl:template>
+</xsl:stylesheet>
|