summaryrefslogtreecommitdiff
path: root/docs/manual.xsl
diff options
context:
space:
mode:
authorarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-07-15 17:01:57 +0000
committerarseny.kapoulkine <arseny.kapoulkine@99668b35-9821-0410-8761-19e4c4f06640>2010-07-15 17:01:57 +0000
commit197f1edfc13e6b3ce89af4ff9047feee75121455 (patch)
tree19702adc0b5fc6cb89034a7b82fe519d14f21f31 /docs/manual.xsl
parentcc78d73f343601e487c0d22cd31e1100b60c4b6d (diff)
docs: Fixed TOC links properly, got rid of pointer-based auto-generated ids
git-svn-id: http://pugixml.googlecode.com/svn/trunk@604 99668b35-9821-0410-8761-19e4c4f06640
Diffstat (limited to 'docs/manual.xsl')
-rw-r--r--docs/manual.xsl32
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>