mirror of
https://github.com/boostorg/boostbook.git
synced 2025-05-08 18:33:58 +00:00
Use object.id in boostbook to docbook conversion
Will generate more consistent ids if generate.consistent.ids is set to 1.
This commit is contained in:
parent
6740d35836
commit
1b8441c17c
@ -9,12 +9,16 @@
|
||||
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
|
||||
xmlns:xi="http://www.w3.org/2001/XInclude"
|
||||
version="1.0">
|
||||
<xsl:import href="http://docbook.sourceforge.net/release/xsl/current/common/common.xsl"/>
|
||||
<xsl:include href="reference.xsl"/>
|
||||
|
||||
<xsl:output method="xml"
|
||||
doctype-public="-//OASIS//DTD DocBook XML V4.2//EN"
|
||||
doctype-system="http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"/>
|
||||
|
||||
<!-- Generate consistent id values if document is unchanged -->
|
||||
<xsl:param name="generate.consistent.ids" select="0"/>
|
||||
|
||||
<!-- The maximum number of columns allowed in preformatted text -->
|
||||
<xsl:param name="max-columns" select="78"/>
|
||||
|
||||
|
@ -22,7 +22,7 @@
|
||||
</xsl:template>
|
||||
|
||||
<xsl:template match="*" mode="generate.id">
|
||||
<xsl:value-of select="generate-id(.)"/>
|
||||
<xsl:call-template name="object.id"/>
|
||||
<xsl:text>-bb</xsl:text>
|
||||
</xsl:template>
|
||||
|
||||
@ -185,7 +185,7 @@
|
||||
<xsl:template match="*" mode="preprocess-ids">
|
||||
<element>
|
||||
<xsl:attribute name="id">
|
||||
<xsl:value-of select="generate-id()"/>
|
||||
<xsl:call-template name="object.id"/>
|
||||
</xsl:attribute>
|
||||
<xsl:attribute name="part-id">
|
||||
<xsl:call-template name="print-id-part"/>
|
||||
@ -234,10 +234,11 @@
|
||||
translate($part, '.<>;\:*?"| ', '') != $part
|
||||
)">
|
||||
<xsl:variable name="normalized" select="translate(normalize-space(translate($part, '.<>;\:*?"|_', ' ')), ' ', '_')"/>
|
||||
<xsl:variable name="id"><xsl:call-template name="object.id"/></xsl:variable>
|
||||
<xsl:value-of select =
|
||||
"concat(
|
||||
substring($normalized, 1, $boost.max.id.part.length - string-length(generate-id(.)) - 1),
|
||||
concat('_', generate-id(.)))"/>
|
||||
substring($normalized, 1, $boost.max.id.part.length - string-length($id) - 1),
|
||||
concat('_', $id))"/>
|
||||
</xsl:when>
|
||||
<xsl:otherwise>
|
||||
<xsl:value-of select="$part"/>
|
||||
|
@ -115,7 +115,7 @@
|
||||
<xsl:if test="count(key('named-entities',
|
||||
translate(@name, $uppercase-letters, $lowercase-letters)))!=1">
|
||||
<xsl:text>_</xsl:text>
|
||||
<xsl:value-of select="generate-id(.)"/>
|
||||
<xsl:call-template name="object.id"/>
|
||||
</xsl:if>
|
||||
</xsl:template>
|
||||
</xsl:stylesheet>
|
||||
|
Loading…
x
Reference in New Issue
Block a user