1 <?xml version=
"1.0" encoding=
"utf-8"?>
2 <xsl:stylesheet xmlns:
xsl=
"http://www.w3.org/1999/XSL/Transform"
5 <!-- Performance-optimized versions of some upstream templates from common/
8 <!-- from common/labels.xsl -->
10 <xsl:template match=
"chapter" mode=
"label.markup">
12 <xsl:when test=
"@label">
13 <xsl:value-of select=
"@label"/>
15 <xsl:when test=
"string($chapter.autolabel) != 0">
16 <xsl:if test=
"$component.label.includes.part.label != 0 and
18 <xsl:variable name=
"part.label">
19 <xsl:apply-templates select=
"ancestor::part"
22 <xsl:if test=
"$part.label != ''">
23 <xsl:value-of select=
"$part.label"/>
24 <xsl:apply-templates select=
"ancestor::part"
25 mode=
"intralabel.punctuation">
26 <xsl:with-param name=
"object" select=
"."/>
27 </xsl:apply-templates>
30 <xsl:variable name=
"format">
31 <xsl:call-template name=
"autolabel.format">
32 <xsl:with-param name=
"format" select=
"$chapter.autolabel"/>
36 <xsl:when test=
"$label.from.part != 0 and ancestor::part">
37 <xsl:number from=
"part" count=
"chapter" format=
"{$format}" level=
"any"/>
40 <!-- Optimization for pgsql-docs: When counting to get label for
41 this chapter, preceding chapters can only be our siblings or
42 children of a preceding part, so only count those instead of
43 scanning the entire node tree. -->
44 <!-- <xsl:number from="book" count="chapter" format="{$format}" level="any"/> -->
45 <xsl:number value=
"count(../preceding-sibling::part/chapter) + count(preceding-sibling::chapter) + 1" format=
"{$format}"/>
52 <xsl:template match=
"appendix" mode=
"label.markup">
54 <xsl:when test=
"@label">
55 <xsl:value-of select=
"@label"/>
57 <xsl:when test=
"string($appendix.autolabel) != 0">
58 <xsl:if test=
"$component.label.includes.part.label != 0 and
60 <xsl:variable name=
"part.label">
61 <xsl:apply-templates select=
"ancestor::part"
64 <xsl:if test=
"$part.label != ''">
65 <xsl:value-of select=
"$part.label"/>
66 <xsl:apply-templates select=
"ancestor::part"
67 mode=
"intralabel.punctuation">
68 <xsl:with-param name=
"object" select=
"."/>
69 </xsl:apply-templates>
72 <xsl:variable name=
"format">
73 <xsl:call-template name=
"autolabel.format">
74 <xsl:with-param name=
"format" select=
"$appendix.autolabel"/>
78 <xsl:when test=
"$label.from.part != 0 and ancestor::part">
79 <xsl:number from=
"part" count=
"appendix" format=
"{$format}" level=
"any"/>
82 <!-- Optimization for pgsql-docs: When counting to get label for
83 this appendix, preceding appendixes can only be our siblings or
84 children of a preceding part, so only count those instead of
85 scanning the entire node tree. -->
86 <!-- <xsl:number from="book|article" count="appendix" format="{$format}" level="any"/> -->
87 <xsl:number value=
"count(../preceding-sibling::part/appendix) + count(preceding-sibling::appendix) + 1" format=
"{$format}"/>
94 <!-- from common/l10n.xsl -->
96 <!-- Just hardcode the language for the whole document, to make it faster. -->
98 <xsl:template name=
"l10n.language">en
</xsl:template>