Skip to content

Commit 639b7e7

Browse files
ISO xslt updated for metanorma/metanorma-iso#434
1 parent ad223c6 commit 639b7e7

File tree

2 files changed

+46
-7
lines changed

2 files changed

+46
-7
lines changed

xslt_src/common.presentation.xsl

+43-7
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,9 @@
8181
<xsl:if test="$namespace = 'iec' or $namespace = 'gb'">
8282
<xsl:text>Part #: </xsl:text>
8383
</xsl:if>
84+
<xsl:if test="$namespace = 'bipm'">
85+
<xsl:text>Part #</xsl:text>
86+
</xsl:if>
8487
</title-part>
8588
<title-part lang="fr">
8689
<xsl:if test="$namespace = 'iso'">
@@ -89,9 +92,23 @@
8992
<xsl:if test="$namespace = 'iec' or $namespace = 'gb'">
9093
<xsl:text>Partie #: </xsl:text>
9194
</xsl:if>
95+
<xsl:if test="$namespace = 'bipm'">
96+
<xsl:text>Partie #</xsl:text>
97+
</xsl:if>
9298
</title-part>
9399
<title-part lang="zh">第 # 部分:</title-part>
94100

101+
<title-subpart lang="en">
102+
<xsl:if test="$namespace = 'bipm'">
103+
<xsl:text>Sub-part #</xsl:text>
104+
</xsl:if>
105+
</title-subpart>
106+
<title-subpart lang="fr">
107+
<xsl:if test="$namespace = 'bipm'">
108+
<xsl:text>Partie de sub #</xsl:text>
109+
</xsl:if>
110+
</title-subpart>
111+
95112
<title-modified lang="en">modified</title-modified>
96113
<title-modified lang="fr">modifiée</title-modified>
97114
<xsl:if test="$namespace = 'iso' or $namespace = 'iec' or $namespace = 'itu' or $namespace = 'unece' or $namespace = 'unece-rec' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' or $namespace = 'rsd' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'm3d' or $namespace = 'iho' or $namespace = 'mpfd' or $namespace = 'bipm'">
@@ -2413,7 +2430,9 @@
24132430
<xsl:call-template name="display-align" />
24142431
<fo:block>
24152432
<xsl:if test="$namespace = 'bipm'">
2416-
<xsl:attribute name="line-stacking-strategy">font-height</xsl:attribute>
2433+
<xsl:if test="not(.//bipm:image)">
2434+
<xsl:attribute name="line-stacking-strategy">font-height</xsl:attribute>
2435+
</xsl:if>
24172436
</xsl:if>
24182437
<xsl:apply-templates />
24192438
</fo:block>
@@ -3831,10 +3850,18 @@
38313850

38323851
<xsl:template match="*[local-name() = 'modification']">
38333852
<xsl:variable name="title-modified">
3834-
<xsl:call-template name="getTitle">
3835-
<xsl:with-param name="name" select="'title-modified'"/>
3836-
</xsl:call-template>
3853+
<xsl:if test="$namespace = 'iso'">
3854+
<xsl:call-template name="getLocalizedString">
3855+
<xsl:with-param name="key">modified</xsl:with-param>
3856+
</xsl:call-template>
3857+
</xsl:if>
3858+
<xsl:if test="$namespace = 'bipm' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'iho' or $namespace = 'itu' or $namespace = 'm3d' or $namespace = 'mpfd' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' or $namespace = 'rsd' or $namespace = 'unece' or $namespace = 'unece-rec'">
3859+
<xsl:call-template name="getTitle">
3860+
<xsl:with-param name="name" select="'title-modified'"/>
3861+
</xsl:call-template>
3862+
</xsl:if>
38373863
</xsl:variable>
3864+
38383865
<xsl:choose>
38393866
<xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
38403867
<xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -5029,9 +5056,18 @@
50295056
<xsl:attribute name="font-weight">bold</xsl:attribute>
50305057
<xsl:attribute name="padding-right">1mm</xsl:attribute>
50315058
</xsl:if>
5032-
<xsl:call-template name="getTitle">
5033-
<xsl:with-param name="name" select="'title-source'"/>
5034-
</xsl:call-template>
5059+
5060+
<xsl:if test="$namespace = 'iso'">
5061+
<xsl:call-template name="getLocalizedString">
5062+
<xsl:with-param name="key">source</xsl:with-param>
5063+
</xsl:call-template>
5064+
</xsl:if>
5065+
<xsl:if test="$namespace = 'bipm' or $namespace = 'csa' or $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'iho' or $namespace = 'itu' or $namespace = 'm3d' or $namespace = 'mpfd' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' or $namespace = 'rsd' or $namespace = 'unece' or $namespace = 'unece-rec'">
5066+
<xsl:call-template name="getTitle">
5067+
<xsl:with-param name="name" select="'title-source'"/>
5068+
</xsl:call-template>
5069+
</xsl:if>
5070+
50355071
<xsl:text>: </xsl:text>
50365072
</fo:inline>
50375073
</xsl:if>

xslt_src/iso.international-standard.presentation.core.xsl

+3
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,9 @@
177177
<xsl:template match="/">
178178
<xsl:call-template name="namespaceCheck"/>
179179
<fo:root xmlns:fo="http://www.w3.org/1999/XSL/Format" font-family="Cambria, Times New Roman, Cambria Math, HanSans" font-size="11pt" xml:lang="{$lang}"> <!-- -->
180+
<xsl:if test="$lang = 'zh'">
181+
<xsl:attribute name="font-family">HanSans, Times New Roman, Cambria Math</xsl:attribute>
182+
</xsl:if>
180183
<fo:layout-master-set>
181184

182185
<!-- cover page -->

0 commit comments

Comments
 (0)