lib/isodoc/un/un.plenary-attachment.xsl in metanorma-un-0.6.2 vs lib/isodoc/un/un.plenary-attachment.xsl in metanorma-un-0.6.3
- old
+ new
@@ -1324,10 +1324,13 @@
<title-amendment lang="en">AMENDMENT</title-amendment>
<title-continued lang="en">(continued)</title-continued>
<title-continued lang="fr">(continué)</title-continued>
+ </xsl:variable><xsl:variable name="bibdata">
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
</xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
<xsl:param name="name"/>
<xsl:param name="lang"/>
<xsl:variable name="lang_">
<xsl:choose>
@@ -1354,10 +1357,11 @@
</xsl:attribute-set><xsl:attribute-set name="link-style">
+
</xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
<xsl:attribute name="white-space">pre</xsl:attribute>
<xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -1467,10 +1471,11 @@
</xsl:attribute-set><xsl:attribute-set name="table-name-style">
<xsl:attribute name="keep-with-next">always</xsl:attribute>
+
@@ -1498,10 +1503,11 @@
</xsl:attribute-set><xsl:attribute-set name="xref-style">
+
</xsl:attribute-set><xsl:attribute-set name="eref-style">
@@ -1509,10 +1515,11 @@
</xsl:attribute-set><xsl:attribute-set name="note-style">
+
@@ -1534,10 +1541,11 @@
+
<xsl:attribute name="padding-right">4mm</xsl:attribute>
</xsl:attribute-set><xsl:attribute-set name="note-p-style">
@@ -1558,15 +1566,17 @@
</xsl:attribute-set><xsl:attribute-set name="termnote-style">
+
<xsl:attribute name="margin-top">4pt</xsl:attribute>
</xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
+
</xsl:attribute-set><xsl:attribute-set name="quote-style">
@@ -1583,18 +1593,20 @@
+
</xsl:attribute-set><xsl:attribute-set name="origin-style">
</xsl:attribute-set><xsl:attribute-set name="term-style">
</xsl:attribute-set><xsl:attribute-set name="figure-name-style">
+
@@ -1619,10 +1631,11 @@
</xsl:attribute-set><xsl:attribute-set name="image-style">
<xsl:attribute name="text-align">center</xsl:attribute>
+
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
<xsl:attribute name="keep-with-next">always</xsl:attribute>
<xsl:attribute name="border">2pt solid black</xsl:attribute>
@@ -1630,10 +1643,11 @@
</xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
</xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
+
<xsl:attribute name="width">100%</xsl:attribute>
<xsl:attribute name="content-height">100%</xsl:attribute>
<xsl:attribute name="content-width">scale-to-fit</xsl:attribute>
<xsl:attribute name="scaling">uniform</xsl:attribute>
@@ -1659,10 +1673,11 @@
</xsl:attribute-set><xsl:attribute-set name="deprecates-style">
</xsl:attribute-set><xsl:attribute-set name="definition-style">
+
</xsl:attribute-set><xsl:variable name="color-added-text">
<xsl:text>rgb(0, 255, 0)</xsl:text>
</xsl:variable><xsl:attribute-set name="add-style">
<xsl:attribute name="color">red</xsl:attribute>
<xsl:attribute name="text-decoration">underline</xsl:attribute>
@@ -1797,10 +1812,11 @@
<fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
+
<xsl:attribute name="margin-bottom">18pt</xsl:attribute>
<xsl:attribute name="font-size">8pt</xsl:attribute>
@@ -1812,10 +1828,12 @@
+
+
<xsl:variable name="table_width">
<!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
@@ -1834,10 +1852,11 @@
+
<attribute name="border-top">0.5pt solid black</attribute>
@@ -1975,15 +1994,26 @@
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
+ <xsl:param name="continued"/>
<xsl:if test="normalize-space() != ''">
<fo:block xsl:use-attribute-sets="table-name-style">
- <xsl:apply-templates/>
+ <xsl:choose>
+ <xsl:when test="$continued = 'true'">
+ <!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
+
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:apply-templates/>
+ </xsl:otherwise>
+ </xsl:choose>
+
+
</fo:block>
</xsl:if>
</xsl:template><xsl:template name="calculate-columns-numbers">
<xsl:param name="table-row"/>
<xsl:variable name="columns-count" select="count($table-row/*)"/>
@@ -2119,22 +2149,22 @@
<fo:table-header>
<xsl:apply-templates/>
</fo:table-header>
</xsl:template><xsl:template name="table-header-title">
- <xsl:param name="cols-count"/>
+ <xsl:param name="cols-count"/>
<!-- row for title -->
<fo:table-row>
<fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black">
- <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
+
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
+ <xsl:with-param name="continued">true</xsl:with-param>
+ </xsl:apply-templates>
<xsl:for-each select="ancestor::*[local-name()='table'][1]">
<xsl:call-template name="fn_name_display"/>
- </xsl:for-each>
- <fo:block text-align="right" font-style="italic">
- <xsl:text> </xsl:text>
- <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
- </fo:block>
+ </xsl:for-each>
+
</fo:table-cell>
</fo:table-row>
</xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
<fo:table-body>
<xsl:apply-templates/>
@@ -2351,10 +2381,11 @@
+
</xsl:if>
<xsl:if test="$parent-name = 'tfoot'">
</xsl:if>
@@ -2390,10 +2421,11 @@
+
<xsl:attribute name="display-align">center</xsl:attribute>
<xsl:attribute name="font-style">italic</xsl:attribute>
<xsl:attribute name="font-weight">normal</xsl:attribute>
<xsl:attribute name="padding-top">2mm</xsl:attribute>
<xsl:attribute name="padding-left">2mm</xsl:attribute>
@@ -3087,10 +3119,11 @@
+
</xsl:variable>
<xsl:variable name="font-size" select="normalize-space($_font-size)"/>
<xsl:if test="$font-size != ''">
<xsl:attribute name="font-size">
@@ -3468,15 +3501,19 @@
<xsl:apply-templates select="following-sibling::tr[1]" mode="simple-table-rowspan">
<xsl:with-param name="previousRow" select="$newRow"/>
</xsl:apply-templates>
</xsl:template><xsl:template name="getLang">
<xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
<xsl:variable name="language">
<xsl:choose>
<xsl:when test="$language_current != ''">
<xsl:value-of select="$language_current"/>
</xsl:when>
+ <xsl:when test="$language_current_2 != ''">
+ <xsl:value-of select="$language_current_2"/>
+ </xsl:when>
<xsl:otherwise>
<xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
@@ -3694,10 +3731,11 @@
<fo:inline xsl:use-attribute-sets="note-name-style">
+
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
</fo:inline>
<xsl:apply-templates/>
</fo:block>
@@ -3720,10 +3758,11 @@
</xsl:otherwise>
</xsl:choose>
</xsl:template><xsl:template match="*[local-name() = 'termnote']">
<fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
<fo:inline xsl:use-attribute-sets="termnote-name-style">
+
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
</fo:inline>
<xsl:apply-templates/>
</fo:block>
</xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name'] | *[local-name() = 'termnote']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']" mode="presentation">
@@ -3801,11 +3840,14 @@
</fo:block>
<xsl:call-template name="fn_display_figure"/>
<xsl:for-each select="*[local-name() = 'note']">
<xsl:call-template name="note"/>
</xsl:for-each>
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
+
+
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
+
</fo:block-container>
</xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
<fo:block id="{@id}">
<xsl:apply-templates/>
</fo:block>
@@ -3920,19 +3962,19 @@
<xsl:apply-templates mode="contents"/>
<xsl:text> </xsl:text>
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
<xsl:apply-templates mode="bookmarks"/>
<xsl:text> </xsl:text>
- </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
+ </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2">
<xsl:value-of select="."/>
- </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
+ </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
<xsl:value-of select="."/>
</xsl:template><xsl:template match="node()" mode="contents">
<xsl:apply-templates mode="contents"/>
</xsl:template><xsl:template match="node()" mode="bookmarks">
<xsl:apply-templates mode="bookmarks"/>
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
+ </xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
<xsl:apply-templates select="."/>
</xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
<xsl:apply-templates mode="bookmarks"/>
</xsl:template><xsl:template name="addBookmarks">
<xsl:param name="contents"/>
@@ -4127,10 +4169,12 @@
</xsl:choose>
</fo:block>
</fo:list-item-body>
</fo:list-item>
</fo:list-block>
+ </xsl:template><xsl:template name="extractSection">
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
</xsl:template><xsl:template name="extractTitle">
<xsl:choose>
<xsl:when test="*[local-name() = 'tab']">
<xsl:apply-templates select="*[local-name() = 'tab'][1]/following-sibling::node()"/>
</xsl:when>
@@ -4174,10 +4218,11 @@
+
@@ -4501,38 +4546,47 @@
<fo:inline xsl:use-attribute-sets="example-p-style">
<xsl:apply-templates/>
</fo:inline>
</xsl:otherwise>
</xsl:choose>
- </xsl:template><xsl:template match="*[local-name() = 'termsource']">
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
<fo:block xsl:use-attribute-sets="termsource-style">
<!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
<xsl:variable name="termsource_text">
<xsl:apply-templates/>
</xsl:variable>
<xsl:choose>
<xsl:when test="starts-with(normalize-space($termsource_text), '[')">
- <xsl:apply-templates/>
+ <!-- <xsl:apply-templates /> -->
+ <xsl:copy-of select="$termsource_text"/>
</xsl:when>
<xsl:otherwise>
<xsl:text>[</xsl:text>
- <xsl:apply-templates/>
+ <!-- <xsl:apply-templates /> -->
+ <xsl:copy-of select="$termsource_text"/>
<xsl:text>]</xsl:text>
</xsl:otherwise>
</xsl:choose>
</fo:block>
</xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
<xsl:if test="normalize-space() != ''">
<xsl:value-of select="."/>
</xsl:if>
- </xsl:template><xsl:template match="*[local-name() = 'origin']">
+ </xsl:template><xsl:variable name="localized.source">
+ <xsl:call-template name="getLocalizedString">
+ <xsl:with-param name="key">source</xsl:with-param>
+ </xsl:call-template>
+ </xsl:variable><xsl:template match="*[local-name() = 'origin']">
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
+ <xsl:if test="normalize-space(@citeas) = ''">
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
+ </xsl:if>
<fo:inline xsl:use-attribute-sets="origin-style">
<xsl:apply-templates/>
</fo:inline>
</fo:basic-link>
@@ -4737,11 +4791,10 @@
<xsl:if test="$num = 1">
<xsl:attribute name="margin-top">20pt</xsl:attribute>
</xsl:if>
-
<xsl:apply-templates/>
</fo:block>
@@ -4785,20 +4838,21 @@
</xsl:template><xsl:template match="*[local-name() = 'name']/text()">
<!-- 0xA0 to space replacement -->
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
</xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
<xsl:choose>
- <xsl:when test="parent::*[local-name() = 'note']">
+ <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
<fo:block-container>
<xsl:attribute name="margin-left">
<xsl:choose>
<xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
<xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
</xsl:choose>
</xsl:attribute>
+
<fo:block-container margin-left="0mm">
<fo:block>
<xsl:apply-templates select="." mode="ul_ol"/>
</fo:block>
</fo:block-container>
@@ -4996,10 +5050,14 @@
+
+
+
+
</xsl:template><xsl:template name="processBibitemDocId">
<xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
<xsl:choose>
<xsl:when test="normalize-space($_doc_ident) != ''">
<xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
@@ -5381,10 +5439,11 @@
<xsl:variable name="XSLNS">
+
<xsl:value-of select="document('')//*/namespace::un"/>
@@ -5447,16 +5506,21 @@
<xsl:with-param name="char" select="$char"/>
<xsl:with-param name="count" select="$count - 1"/>
</xsl:call-template>
</xsl:if>
</xsl:template><xsl:template name="getLocalizedString">
- <xsl:param name="key"/>
+ <xsl:param name="key"/>
<xsl:variable name="curr_lang">
<xsl:call-template name="getLang"/>
</xsl:variable>
+ <xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
+
<xsl:choose>
+ <xsl:when test="$data_value != ''">
+ <xsl:value-of select="$data_value"/>
+ </xsl:when>
<xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
</xsl:when>
<xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
</xsl:choose>
\ No newline at end of file