lib/isodoc/itu/itu.technical-report.xsl in metanorma-itu-2.4.4 vs lib/isodoc/itu/itu.technical-report.xsl in metanorma-itu-2.4.5
- old
+ new
@@ -141,11 +141,11 @@
<xsl:variable name="en_dash_separator"> – </xsl:variable>
<xsl:variable name="document_scheme" select="normalize-space(/itu:itu-standard/itu:metanorma-extension/itu:presentation-metadata[itu:name = 'document-scheme']/itu:value)"/>
<xsl:variable name="layoutVersion_">
<xsl:choose>
- <xsl:when test="$document_scheme = ''">2023</xsl:when>
+ <xsl:when test="$document_scheme = '' or $document_scheme = 'current'">2023</xsl:when>
<xsl:otherwise>default</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="layoutVersion" select="normalize-space($layoutVersion_)"/>
@@ -168,10 +168,24 @@
<xsl:value-of select="$color_cover_itu_logo_value"/>
<xsl:if test="$color_cover_itu_logo_value = ''">#1DA0DB</xsl:if>
</xsl:variable>
<xsl:variable name="color_cover_itu_logo" select="normalize-space($color_cover_itu_logo_)"/>
+ <xsl:variable name="i18n_international_telecommunication_union"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">international_telecommunication_union</xsl:with-param></xsl:call-template></xsl:variable>
+ <xsl:variable name="i18n_edition"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">edition</xsl:with-param></xsl:call-template></xsl:variable>
+ <xsl:variable name="i18n_edition_Capitalized"><xsl:call-template name="capitalize"><xsl:with-param name="str" select="$i18n_edition"/></xsl:call-template></xsl:variable>
+ <xsl:variable name="i18n_annex"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">annex</xsl:with-param></xsl:call-template></xsl:variable>
+ <xsl:variable name="i18n_annex_to_itu_ob"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">annex_to_itu_ob</xsl:with-param></xsl:call-template></xsl:variable>
+ <xsl:variable name="i18n_number_abbrev"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">number_abbrev</xsl:with-param></xsl:call-template></xsl:variable>
+ <xsl:variable name="i18n_tsb"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">tsb</xsl:with-param></xsl:call-template></xsl:variable>
+ <xsl:variable name="i18n_tsb_full"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">tsb_full</xsl:with-param><xsl:with-param name="formatted">true</xsl:with-param></xsl:call-template></xsl:variable>
+ <xsl:variable name="i18n_placedate"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">placedate</xsl:with-param></xsl:call-template></xsl:variable>
+ <xsl:variable name="i18n_series"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">series</xsl:with-param></xsl:call-template></xsl:variable>
+ <xsl:variable name="i18n_series_Capitalized"><xsl:call-template name="capitalize"><xsl:with-param name="str" select="$i18n_series"/></xsl:call-template></xsl:variable>
+ <xsl:variable name="i18n_keywords"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">keywords</xsl:with-param></xsl:call-template></xsl:variable>
+ <xsl:variable name="i18n_page"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">Page.sg</xsl:with-param></xsl:call-template></xsl:variable>
+
<xsl:template match="/">
<xsl:call-template name="namespaceCheck"/>
<fo:root xml:lang="{$lang}">
<xsl:variable name="root-style">
<root-style xsl:use-attribute-sets="root-style">
@@ -338,30 +352,25 @@
</xsl:choose>
</fo:block>
</fo:table-cell>
<fo:table-cell text-align="end" display-align="center">
<fo:block>
- <xsl:call-template name="getLocalizedString">
- <xsl:with-param name="key">international_telecommunication_union</xsl:with-param>
- </xsl:call-template>
+ <xsl:value-of select="$i18n_international_telecommunication_union"/>
</fo:block>
</fo:table-cell>
</fo:table-row>
<fo:table-row>
<!-- collection/series (optional) -->
<fo:table-cell text-align="start">
<fo:block>
- <xsl:variable name="collection" select="normalize-space(/itu:itu-standard/itu:metanorma-extension/itu:presentation-metadata/itu:collection)"/>
- <xsl:if test="$collection != ''">
- <xsl:value-of select="$collection"/>
- </xsl:if>
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'collection']"/>
</fo:block>
</fo:table-cell>
<!-- Sector or Bureau name -->
<fo:table-cell text-align="end">
<fo:block>
- <xsl:variable name="sector" select="normalize-space(/itu:itu-standard/itu:metanorma-extension/itu:presentation-metadata/itu:sector)"/>
+ <xsl:variable name="sector" select="normalize-space(/itu:itu-standard/itu:bibdata/itu:ext/itu:editorialgroup/itu:sector)"/>
<xsl:value-of select="$sector"/>
<xsl:if test="$sector = ''">
<xsl:variable name="bureau_key">
<xsl:choose>
<xsl:when test="$bureau = 'T'">tsb</xsl:when>
@@ -406,47 +415,45 @@
<fo:block-container font-size="22pt" font-weight="bold" color="{$color_cover_title}">
<xsl:call-template name="setWritingMode"/>
<xsl:choose>
- <xsl:when test="$doctype = 'service-publication'">
- <fo:block margin-top="11.5mm" font-size="26pt">
+ <xsl:when test="$doctype = 'service-publication'"> <!-- Flagship -->
+ <fo:block margin-top="11.5mm" font-size="34pt">
<xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'main' and @language = $lang]"/>
</fo:block>
- <fo:block margin-top="2mm">
+ <fo:block margin-top="2mm" font-size="26pt">
<xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'subtitle' and @language = $lang]"/>
</fo:block>
+ <!-- https://github.com/metanorma/metanorma-itu/issues/474#issuecomment-1966298384 -->
+ <xsl:variable name="title_slogan" select="normalize-space(/itu:itu-standard/itu:bibdata/itu:title[@type = 'slogan'])"/>
+ <xsl:if test="$title_slogan != ''">
+ <fo:block margin-top="2mm" font-family="Adelle Devanagari" font-size="26pt">
+ <xsl:choose>
+ <xsl:when test="$lang = 'ar'"><xsl:attribute name="font-family">Traditional Arabic</xsl:attribute></xsl:when>
+ <xsl:when test="$lang = 'zh'"><xsl:attribute name="font-family">STKaiti</xsl:attribute></xsl:when>
+ <!-- <xsl:otherwise><xsl:attribute name="font-style">italic</xsl:attribute></xsl:otherwise> -->
+ </xsl:choose>
+ <xsl:value-of select="$title_slogan"/>
+ </fo:block>
+ </xsl:if>
<xsl:variable name="year_published" select="substring($date_published,1,4)"/>
<xsl:if test="$year_published != ''">
<!-- Examples:
2020 edition
Édition 2020
Edición 2020
طبعة 2020
2020 年版
Издание 2020 года -->
- <fo:block margin-top="3mm" font-size="18pt">
- <xsl:variable name="editionTitle">
- <xsl:call-template name="getLocalizedString">
- <xsl:with-param name="key">edition</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:variable name="editionTitleCapitalized">
- <xsl:call-template name="capitalize">
- <xsl:with-param name="str" select="$editionTitle"/>
- </xsl:call-template>
- </xsl:variable>
+ <fo:block margin-top="3mm" font-size="22pt">
<xsl:choose>
<xsl:when test="$lang = 'en' or $lang = 'ar' or $lang = 'zh'">
- <xsl:value-of select="$year_published"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="$editionTitle"/>
+ <xsl:value-of select="concat($year_published, ' ', $i18n_edition)"/>
</xsl:when>
<xsl:otherwise>
- <xsl:value-of select="$editionTitleCapitalized"/>
- <xsl:text> </xsl:text>
- <xsl:value-of select="$year_published"/>
+ <xsl:value-of select="concat($i18n_edition_Capitalized, ' ', $year_published)"/>
<xsl:if test="$lang = 'ru'"> года</xsl:if>
</xsl:otherwise>
</xsl:choose>
</fo:block>
</xsl:if>
@@ -506,13 +513,11 @@
</xsl:if>
<xsl:if test="$annexid != ''">
<fo:block-container>
<xsl:call-template name="setWritingMode"/>
<fo:block>
- <xsl:call-template name="getLocalizedString">
- <xsl:with-param name="key">annex</xsl:with-param>
- </xsl:call-template>
+ <xsl:value-of select="$i18n_annex"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$annexid"/>
</fo:block>
</fo:block-container>
</xsl:if>
@@ -609,13 +614,11 @@
</fo:block>
<!-- Example: Annex F1 - ... -->
<xsl:for-each select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'annex' and @language = $lang]">
<fo:block font-size="18pt" margin-top="3mm" role="H1">
- <xsl:call-template name="getLocalizedString">
- <xsl:with-param name="key">annex</xsl:with-param>
- </xsl:call-template>
+ <xsl:value-of select="$i18n_annex"/>
<xsl:text> </xsl:text>
<xsl:value-of select="$annexid"/>
<xsl:value-of select="$en_dash_separator"/>
<xsl:value-of select="."/>
</fo:block>
@@ -822,18 +825,14 @@
<fo:block font-size="10pt" font-style="italic" text-align="center">
<xsl:if test="$lang = 'ar'"> <!-- to prevent rendering `###` due the missing Arabic glyphs in the italic font (Times New Roman) -->
<xsl:attribute name="font-style">normal</xsl:attribute>
</xsl:if>
<fo:block>
- <xsl:call-template name="getLocalizedString">
- <xsl:with-param name="key">annex_to_itu_ob</xsl:with-param>
- </xsl:call-template>
+ <xsl:value-of select="$i18n_annex_to_itu_ob"/>
</fo:block>
<fo:block>
- <xsl:call-template name="getLocalizedString">
- <xsl:with-param name="key">number_abbrev</xsl:with-param>
- </xsl:call-template>
+ <xsl:value-of select="$i18n_number_abbrev"/>
<xsl:value-of select="/*/itu:bibdata/itu:docnumber"/>
<xsl:text> – </xsl:text>
<xsl:value-of select="translate(normalize-space(/*/itu:bibdata/itu:date[@type='published' and @format]),' ','')"/>
</fo:block>
</fo:block>
@@ -847,34 +846,21 @@
</xsl:if>
<fo:instream-foreign-object content-height="18.5mm" content-width="16.1mm" fox:alt-text="Image Logo">
<xsl:copy-of select="$Image-ITU-Globe-Logo"/>
</fo:instream-foreign-object>
</fo:inline>
- <xsl:variable name="itu_name">
- <xsl:call-template name="getLocalizedString">
- <xsl:with-param name="key">international_telecommunication_union</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($itu_name))"/>
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($i18n_international_telecommunication_union))"/>
</fo:block>
</fo:block>
<fo:block-container margin-left="10mm">
<fo:block-container margin-left="0mm">
<fo:block font-size="20pt" font-weight="bold" space-before="30mm">
- <xsl:call-template name="getLocalizedString">
- <xsl:with-param name="key">tsb</xsl:with-param>
- </xsl:call-template>
+ <xsl:value-of select="$i18n_tsb"/>
</fo:block>
<fo:block font-size="14pt" font-weight="bold">
- <xsl:variable name="tsb_full">
- <xsl:call-template name="getLocalizedString">
- <xsl:with-param name="key">tsb_full</xsl:with-param>
- <xsl:with-param name="formatted">true</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($tsb_full))"/>
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($i18n_tsb_full))"/>
</fo:block>
<fo:block-container height="20mm" display-align="center" width="90%">
<fo:block font-weight="bold">
<!-- complements -->
<!-- To do: Example: COMPLEMENT TO ITU-T RECOMMENDATIONS F.69 (06/1994) AND F.68 (11/1988) -->
@@ -966,18 +952,13 @@
</fo:block-container>
</fo:block-container>
<fo:block space-before="25mm" font-weight="bold">
- <xsl:variable name="placedate">
- <xsl:call-template name="getLocalizedString">
- <xsl:with-param name="key">placedate</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
<xsl:variable name="year" select="substring(/*/itu:bibdata/itu:date[@type = 'published']/itu:on,1,4)"/>
<xsl:if test="normalize-space($year) != ''">
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($placedate),'%',$year)"/>
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($i18n_placedate),'%',$year)"/>
</xsl:if>
</fo:block>
</fo:flow>
</fo:page-sequence>
</xsl:when>
@@ -1036,11 +1017,11 @@
</xsl:call-template>
</fo:block>
</fo:block-container>
</fo:table-cell>
</fo:table-row>
- <fo:table-row border="1pt solid green">
+ <fo:table-row>
<fo:table-cell>
<fo:block> </fo:block>
</fo:table-cell>
<fo:table-cell padding-top="2mm" padding-bottom="-1mm">
<fo:block-container>
@@ -1066,18 +1047,11 @@
<xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:doctype[@language = $lang]"/>
</xsl:when>
<xsl:when test="$doctype = 'resolution'"/>
<xsl:when test="$doctype = 'recommendation-supplement'">
<!-- Series L -->
- <xsl:variable name="title-series">
- <xsl:call-template name="getLocalizedString">
- <xsl:with-param name="key">series</xsl:with-param>
- </xsl:call-template>
- </xsl:variable>
- <xsl:call-template name="capitalize">
- <xsl:with-param name="str" select="$title-series"/>
- </xsl:call-template>
+ <xsl:value-of select="$i18n_series_Capitalized"/>
<xsl:text> </xsl:text>
<xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:series[@type='main']/itu:title[@type='abbrev']"/>
<!-- Ex. Supplement 37 -->
<fo:block font-size="18pt">
<xsl:call-template name="getLocalizedString">
@@ -1110,15 +1084,11 @@
</xsl:if>
<xsl:if test="$annexid != ''">
<fo:block-container>
<xsl:call-template name="setWritingMode"/>
<fo:block font-size="18pt" font-weight="bold">
- <xsl:call-template name="getLocalizedString">
- <xsl:with-param name="key">annex</xsl:with-param>
- </xsl:call-template>
- <xsl:text> </xsl:text>
- <xsl:value-of select="$annexid"/>
+ <xsl:value-of select="concat($i18n_annex, ' ', $annexid)"/>
</fo:block>
</fo:block-container>
</xsl:if>
<xsl:if test="$isAmendment != ''">
<fo:block-container>
@@ -1135,11 +1105,11 @@
<xsl:value-of select="$isCorrigendum"/>
</fo:block>
</fo:block-container>
</xsl:if>
</xsl:variable>
- <fo:table-row height="17.2mm" border="1pt solid blue">
+ <fo:table-row height="17.2mm">
<fo:table-cell>
<fo:block> </fo:block>
</fo:table-cell>
<fo:table-cell font-size="10pt" number-columns-spanned="2" padding-top="1mm">
<fo:block-container>
@@ -1173,11 +1143,11 @@
</xsl:choose>
</fo:block>
</fo:table-cell>
</fo:table-row>
<xsl:variable name="countAdditionalNumbers" select="count(xalan:nodeset($additionalNumbers)/*)"/>
- <fo:table-row height="64mm" border="1pt solid red"> <!-- 59mm -->
+ <fo:table-row height="64mm"> <!-- 59mm -->
<xsl:if test="$countAdditionalNumbers != 0">
<xsl:attribute name="height"><xsl:value-of select="64 - $countAdditionalNumbers * 5"/>mm</xsl:attribute>
</xsl:if>
<fo:table-cell>
<fo:block> </fo:block>
@@ -1208,11 +1178,11 @@
</xsl:choose>
</fo:block>
</fo:block-container>
</fo:table-cell>
</fo:table-row>
- <fo:table-row height="40mm" border="1pt solid green">
+ <fo:table-row height="40mm">
<fo:table-cell>
<fo:block> </fo:block>
</fo:table-cell>
<fo:table-cell font-size="18pt" number-columns-spanned="3">
<fo:block-container>
@@ -1261,11 +1231,11 @@
</fo:block>
</xsl:if>
</fo:block-container>
</fo:table-cell>
</fo:table-row>
- <fo:table-row height="40mm" border="1pt solid blue">
+ <fo:table-row height="40mm">
<fo:table-cell>
<fo:block> </fo:block>
</fo:table-cell>
<fo:table-cell number-columns-spanned="3">
<fo:block-container>
@@ -1282,11 +1252,11 @@
</xsl:otherwise>
</xsl:choose>
</fo:block-container>
</fo:table-cell>
</fo:table-row>
- <fo:table-row height="25mm" border="1pt solid red">
+ <fo:table-row height="25mm">
<fo:table-cell>
<fo:block> </fo:block>
</fo:table-cell>
<fo:table-cell number-columns-spanned="3">
<fo:block-container>
@@ -1341,16 +1311,11 @@
</xsl:if>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="$annexid != ''">
- <xsl:text> — </xsl:text>
- <xsl:call-template name="getLocalizedString">
- <xsl:with-param name="key">annex</xsl:with-param>
- </xsl:call-template>
- <xsl:text> </xsl:text>
- <xsl:value-of select="$annexid"/>
+ <xsl:value-of select="concat(' — ', $i18n_annex, ' ', $annexid)"/>
</xsl:if>
</fo:block>
</fo:block-container>
</fo:table-cell>
</fo:table-row>
@@ -1416,13 +1381,11 @@
<fo:block font-size="12pt">
<xsl:value-of select="$linebreak"/>
<xsl:value-of select="$linebreak"/>
</fo:block>
<fo:block font-weight="bold" margin-top="18pt" margin-bottom="18pt">
- <xsl:call-template name="getLocalizedString">
- <xsl:with-param name="key">keywords</xsl:with-param>
- </xsl:call-template>
+ <xsl:value-of select="$i18n_keywords"/>
</fo:block>
<fo:block>
<xsl:call-template name="insertKeywords"/>
</fo:block>
</xsl:if>
@@ -1601,13 +1564,11 @@
</xsl:if>
</xsl:variable>
<xsl:if test="$series_title != ''">
<!-- Series -->
<fo:inline text-transform="uppercase">
- <xsl:call-template name="getLocalizedString">
- <xsl:with-param name="key">series</xsl:with-param>
- </xsl:call-template>
+ <xsl:value-of select="$i18n_series"/>
</fo:inline>
<xsl:text> </xsl:text>
<xsl:value-of select="$series_title"/>
</xsl:if>
</xsl:template>
@@ -1712,13 +1673,11 @@
<xsl:if test="$contents//tables/table">
<xsl:call-template name="insertListOf_Title">
<xsl:with-param name="title" select="$title-list-tables"/>
</xsl:call-template>
<fo:block margin-top="6pt" text-align="end" font-weight="bold" keep-with-next="always">
- <xsl:call-template name="getLocalizedString">
- <xsl:with-param name="key">Page.sg</xsl:with-param>
- </xsl:call-template>
+ <xsl:value-of select="$i18n_page"/>
</fo:block>
<fo:block-container>
<xsl:for-each select="$contents//tables/table">
<xsl:call-template name="insertListOf_Item"/>
</xsl:for-each>
@@ -1729,13 +1688,11 @@
<xsl:if test="$contents//figures/figure">
<xsl:call-template name="insertListOf_Title">
<xsl:with-param name="title" select="$title-list-figures"/>
</xsl:call-template>
<fo:block margin-top="6pt" text-align="end" font-weight="bold" keep-with-next="always">
- <xsl:call-template name="getLocalizedString">
- <xsl:with-param name="key">Page.sg</xsl:with-param>
- </xsl:call-template>
+ <xsl:value-of select="$i18n_page"/>
</fo:block>
<fo:block-container>
<xsl:for-each select="$contents//figures/figure">
<xsl:call-template name="insertListOf_Item"/>
</xsl:for-each>
@@ -1755,13 +1712,11 @@
<xsl:with-param name="key">table_of_contents</xsl:with-param>
</xsl:call-template> -->
<xsl:apply-templates/>
</fo:block>
<fo:block margin-top="6pt" text-align="end" font-weight="bold">
- <xsl:call-template name="getLocalizedString">
- <xsl:with-param name="key">Page.sg</xsl:with-param>
- </xsl:call-template>
+ <xsl:value-of select="$i18n_page"/>
</fo:block>
</xsl:template>
<xsl:template match="itu:clause[@type = 'keyword']" priority="4"/>
@@ -3019,10 +2974,11 @@
<xsl:variable name="non_breaking_hyphen">‑</xsl:variable>
<xsl:variable name="thin_space"> </xsl:variable>
<xsl:variable name="zero_width_space"></xsl:variable>
<xsl:variable name="hair_space"> </xsl:variable>
<xsl:variable name="en_dash">–</xsl:variable>
+ <xsl:variable name="em_dash">—</xsl:variable>
<xsl:template name="getTitle">
<xsl:param name="name"/>
<xsl:param name="lang"/>
<xsl:variable name="lang_">
@@ -3333,10 +3289,14 @@
<xsl:attribute name="keep-with-next">always</xsl:attribute>
<xsl:attribute name="font-weight">bold</xsl:attribute>
</xsl:attribute-set> <!-- example-name-style -->
+ <xsl:template name="refine_example-name-style">
+
+ </xsl:template>
+
<xsl:attribute-set name="example-p-style">
<xsl:attribute name="font-size">10pt</xsl:attribute>
<xsl:attribute name="margin-top">12pt</xsl:attribute>
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -3349,10 +3309,14 @@
<xsl:attribute-set name="termexample-name-style">
</xsl:attribute-set> <!-- termexample-name-style -->
+ <xsl:template name="refine_termexample-name-style">
+
+ </xsl:template>
+
<!-- ========================== -->
<!-- Table styles -->
<!-- ========================== -->
<xsl:variable name="table-border_">
@@ -3552,20 +3516,28 @@
<xsl:attribute name="text-indent">-5mm</xsl:attribute>
<xsl:attribute name="start-indent">5mm</xsl:attribute>
</xsl:attribute-set> <!-- table-fn-style -->
+ <xsl:template name="refine_table-fn-style">
+
+ </xsl:template>
+
<xsl:attribute-set name="table-fn-number-style">
<xsl:attribute name="font-size">80%</xsl:attribute>
<xsl:attribute name="padding-right">5mm</xsl:attribute>
<xsl:attribute name="vertical-align">super</xsl:attribute>
<xsl:attribute name="padding-right">3mm</xsl:attribute>
<xsl:attribute name="font-size">70%</xsl:attribute>
</xsl:attribute-set> <!-- table-fn-number-style -->
+ <xsl:template name="refine_table-fn-number-style">
+
+ </xsl:template>
+
<xsl:attribute-set name="fn-container-body-style">
<xsl:attribute name="text-indent">0</xsl:attribute>
<xsl:attribute name="start-indent">0</xsl:attribute>
</xsl:attribute-set>
@@ -4894,10 +4866,11 @@
<xsl:when test="@width and @width != 'full-page-width' and @width != 'text-width'">
<!-- centered table when table name is centered (see table-name-style) -->
<fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table-container-style">
+
<fo:table-column column-width="proportional-column-width(1)"/>
<fo:table-column column-width="{@width}"/>
<fo:table-column column-width="proportional-column-width(1)"/>
<fo:table-body>
<fo:table-row>
@@ -5949,12 +5922,13 @@
<xsl:for-each select="xalan:nodeset($references)//fn">
<xsl:variable name="reference" select="@reference"/>
<xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
<fo:block xsl:use-attribute-sets="table-fn-style">
-
+ <xsl:call-template name="refine_table-fn-style"/>
<fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
+ <xsl:call-template name="refine_table-fn-number-style"/>
<xsl:value-of select="@reference"/>
<xsl:text>)</xsl:text>
@@ -7140,15 +7114,20 @@
</xsl:template>
<xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
<!-- <xsl:variable name="text" select="normalize-space(.)"/> --> <!-- https://github.com/metanorma/metanorma-iso/issues/1115 -->
<xsl:variable name="text" select="."/>
- <fo:inline font-size="75%" role="SKIP">
+ <xsl:variable name="ratio_">
+ 0.75
+ </xsl:variable>
+ <xsl:variable name="ratio" select="number(normalize-space($ratio_))"/>
+ <fo:inline font-size="{$ratio * 100}%" role="SKIP">
<xsl:if test="string-length($text) > 0">
<xsl:variable name="smallCapsText">
<xsl:call-template name="recursiveSmallCaps">
<xsl:with-param name="text" select="$text"/>
+ <xsl:with-param name="ratio" select="$ratio"/>
</xsl:call-template>
</xsl:variable>
<!-- merge neighboring fo:inline -->
<xsl:for-each select="xalan:nodeset($smallCapsText)/node()">
<xsl:choose>
@@ -7181,26 +7160,28 @@
</fo:inline>
</xsl:template>
<xsl:template name="recursiveSmallCaps">
<xsl:param name="text"/>
+ <xsl:param name="ratio"/>
<xsl:variable name="char" select="substring($text,1,1)"/>
<!-- <xsl:variable name="upperCase" select="translate($char, $lower, $upper)"/> -->
<xsl:variable name="upperCase" select="java:toUpperCase(java:java.lang.String.new($char))"/>
<xsl:choose>
<xsl:when test="$char=$upperCase">
- <fo:inline font-size="{100 div 0.75}%" role="SKIP">
+ <fo:inline font-size="{100 div $ratio}%" role="SKIP">
<xsl:value-of select="$upperCase"/>
</fo:inline>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="$upperCase"/>
</xsl:otherwise>
</xsl:choose>
<xsl:if test="string-length($text) > 1">
<xsl:call-template name="recursiveSmallCaps">
<xsl:with-param name="text" select="substring($text,2)"/>
+ <xsl:with-param name="ratio" select="$ratio"/>
</xsl:call-template>
</xsl:if>
</xsl:template>
<xsl:template match="*[local-name() = 'pagebreak']">
@@ -7233,10 +7214,13 @@
</xsl:choose>
</xsl:variable>
<xsl:if test="$key = 'font-family' or $key = 'font-size' or $key = 'color'">
<style name="{$key}"><xsl:value-of select="$value"/></style>
</xsl:if>
+ <xsl:if test="$key = 'text-indent'">
+ <style name="padding-left"><xsl:value-of select="$value"/></style>
+ </xsl:if>
</xsl:for-each>
</xsl:variable>
<xsl:variable name="styles" select="xalan:nodeset($styles_)"/>
<xsl:choose>
<xsl:when test="$styles/style">
@@ -8635,10 +8619,15 @@
</fo:basic-link>
</xsl:with-param>
</xsl:call-template>
</xsl:template>
+ <!-- command between two xref points to non-standard bibitem -->
+ <xsl:template match="text()[. = ','][preceding-sibling::node()[1][local-name() = 'sup'][*[local-name() = 'xref'][@type = 'footnote']] and following-sibling::node()[1][local-name() = 'sup'][*[local-name() = 'xref'][@type = 'footnote']]]">
+ <xsl:value-of select="."/>
+ </xsl:template>
+
<!-- ====== -->
<!-- formula -->
<!-- ====== -->
<xsl:template match="*[local-name() = 'formula']" name="formula">
<fo:block-container margin-left="0mm" role="SKIP">
@@ -9344,10 +9333,12 @@
<xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
<xsl:value-of select="."/>
</xsl:attribute>
</xsl:template>
+ <xsl:variable name="regex_starts_with_digit">^[0-9].*</xsl:variable>
+
<xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
<xsl:copy>
<xsl:apply-templates select="@*" mode="svg_update"/>
<xsl:variable name="viewbox_">
<xsl:call-template name="split">
@@ -9362,20 +9353,22 @@
<xsl:variable name="parent_image_width" select="normalize-space(ancestor::*[1][local-name() = 'image']/@width)"/>
<xsl:variable name="parent_image_height" select="normalize-space(ancestor::*[1][local-name() = 'image']/@height)"/>
<xsl:attribute name="width">
<xsl:choose>
- <xsl:when test="$parent_image_width != '' and $parent_image_width != 'auto'"><xsl:value-of select="$parent_image_width"/></xsl:when>
+ <!-- width is non 'auto', 'text-width', 'full-page-width' or 'narrow' -->
+ <xsl:when test="$parent_image_width != '' and normalize-space(java:matches(java:java.lang.String.new($parent_image_width), $regex_starts_with_digit)) = 'true'"><xsl:value-of select="$parent_image_width"/></xsl:when>
<xsl:when test="$width != ''">
<xsl:value-of select="round($width)"/>
</xsl:when>
<xsl:otherwise>400</xsl:otherwise> <!-- default width -->
</xsl:choose>
</xsl:attribute>
<xsl:attribute name="height">
<xsl:choose>
- <xsl:when test="$parent_image_height != '' and $parent_image_height != 'auto'"><xsl:value-of select="$parent_image_height"/></xsl:when>
+ <!-- height non 'auto', 'text-width', 'full-page-width' or 'narrow' -->
+ <xsl:when test="$parent_image_height != '' and normalize-space(java:matches(java:java.lang.String.new($parent_image_height), $regex_starts_with_digit)) = 'true'"><xsl:value-of select="$parent_image_height"/></xsl:when>
<xsl:when test="$height != ''">
<xsl:value-of select="round($height)"/>
</xsl:when>
<xsl:otherwise>400</xsl:otherwise> <!-- default height -->
</xsl:choose>
@@ -9388,22 +9381,22 @@
<xsl:template match="*[local-name() = 'svg']/@width" mode="svg_update">
<!-- image[@width]/svg -->
<xsl:variable name="parent_image_width" select="normalize-space(ancestor::*[2][local-name() = 'image']/@width)"/>
<xsl:attribute name="width">
<xsl:choose>
- <xsl:when test="$parent_image_width != '' and $parent_image_width != 'auto'"><xsl:value-of select="$parent_image_width"/></xsl:when>
+ <xsl:when test="$parent_image_width != '' and normalize-space(java:matches(java:java.lang.String.new($parent_image_width), $regex_starts_with_digit)) = 'true'"><xsl:value-of select="$parent_image_width"/></xsl:when>
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:template>
<xsl:template match="*[local-name() = 'svg']/@height" mode="svg_update">
<!-- image[@height]/svg -->
<xsl:variable name="parent_image_height" select="normalize-space(ancestor::*[2][local-name() = 'image']/@height)"/>
<xsl:attribute name="height">
<xsl:choose>
- <xsl:when test="$parent_image_height != '' and $parent_image_height != 'auto'"><xsl:value-of select="$parent_image_height"/></xsl:when>
+ <xsl:when test="$parent_image_height != '' and normalize-space(java:matches(java:java.lang.String.new($parent_image_height), $regex_starts_with_digit)) = 'true'"><xsl:value-of select="$parent_image_height"/></xsl:when>
<xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
</xsl:choose>
</xsl:attribute>
</xsl:template>
@@ -10862,10 +10855,11 @@
</xsl:template>
<xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']">
<xsl:if test="normalize-space() != ''">
<fo:inline xsl:use-attribute-sets="termexample-name-style">
+ <xsl:call-template name="refine_termexample-name-style"/>
<xsl:apply-templates/>
</fo:inline>
</xsl:if>
</xsl:template>
@@ -11012,10 +11006,11 @@
<xsl:apply-templates/>
</fo:block>
</xsl:when>
<xsl:otherwise>
<fo:inline xsl:use-attribute-sets="example-name-style">
+ <xsl:call-template name="refine_example-name-style"/>
<xsl:apply-templates/>
</fo:inline>
</xsl:otherwise>
</xsl:choose>
@@ -12225,10 +12220,11 @@
<!-- Normative references -->
<xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2">
<fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
+
<xsl:call-template name="processBibitem"/>
</fo:block>
</xsl:template> <!-- bibitem -->
@@ -12245,10 +12241,11 @@
<xsl:template name="insertListItem_Bibitem">
<xsl:choose>
<xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
<xsl:otherwise>
<fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
+
<fo:list-item-label end-indent="label-end()">
<fo:block role="SKIP">
<fo:inline role="SKIP">
<xsl:apply-templates select="*[local-name() = 'biblio-tag']">
<xsl:with-param name="biblio_tag_part">first</xsl:with-param>
@@ -14058,7 +14055,9 @@
<xsl:value-of select="local-name()"/>
<xsl:text>></xsl:text>
</fo:block>
</xsl:if>
</xsl:template>
+
+ <!-- update -->
</xsl:stylesheet>
\ No newline at end of file