summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Eisentraut2017-10-26 19:19:56 +0000
committerPeter Eisentraut2017-11-03 18:14:02 +0000
commit49df45acd8d40ee172c2f5491485de997c5f1020 (patch)
tree4caee3b08f0b526387850803f1aa00d455bb0ee1
parenta9fce66729ad5217e8219e22e595974059c21291 (diff)
doc: Convert ids to upper case at build time
This makes the produced HTML anchors upper case, making it backward compatible with the previous (9.6) build system. Reported-by: Thomas Kellerer <[email protected]>
-rw-r--r--doc/src/sgml/stylesheet-html-common.xsl25
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/src/sgml/stylesheet-html-common.xsl b/doc/src/sgml/stylesheet-html-common.xsl
index 72fac1e806..17b7230d2c 100644
--- a/doc/src/sgml/stylesheet-html-common.xsl
+++ b/doc/src/sgml/stylesheet-html-common.xsl
@@ -263,4 +263,29 @@ set toc,title
</xsl:if>
</xsl:template>
+
+<!-- upper case HTML anchors for backward compatibility -->
+
+<xsl:template name="object.id">
+ <xsl:param name="object" select="."/>
+ <xsl:choose>
+ <xsl:when test="$object/@id">
+ <xsl:value-of select="translate($object/@id, &lowercase;, &uppercase;)"/>
+ </xsl:when>
+ <xsl:when test="$object/@xml:id">
+ <xsl:value-of select="$object/@xml:id"/>
+ </xsl:when>
+ <xsl:when test="$generate.consistent.ids != 0">
+ <!-- Make $object the current node -->
+ <xsl:for-each select="$object">
+ <xsl:text>id-</xsl:text>
+ <xsl:number level="multiple" count="*"/>
+ </xsl:for-each>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="generate-id($object)"/>
+ </xsl:otherwise>
+ </xsl:choose>
+</xsl:template>
+
</xsl:stylesheet>