metanorma-iso 1.8.2 → 1.8.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 35b59081db707249f715188c97e36d12b87d07bb80ce85d34246828a5ab1bec3
4
- data.tar.gz: 7c815a0b3bdaea0f9592068920aab0ce50fa60ded38e1b4ed8e35b0d2f15b35c
3
+ metadata.gz: cb8038b020aca28d9a8ac7faa9fd0c11157fb9bc380d291edcb05fb91f675683
4
+ data.tar.gz: af9152228cacb007d0e19bce254d89e4d524596c615aa8031b9348519996e6c9
5
5
  SHA512:
6
- metadata.gz: 79dfb38b8dde27b13ea207d8c7eb12f5395a4adf73a1b254bc179b8bff51bffe169885454aaff18ddd20e378f0e6e336869964293f7503f375892c91028403d0
7
- data.tar.gz: b22f9abeb337fd65d613e8cf6c6b76397c24de3cb9b27c4bca447f76e2c712130cde51034ed8cfbd7d7863bd4961170dfdf279ab18ecc366ba7d1887aa22b746
6
+ metadata.gz: 6de552f032b9f1a767a3dd9b8aecc4a3d73ef66bdb2bfcffa5b045a3e2c3557ddcd9b85af78134db5cdb21618f6d209abba095f5a24b0a9b04c6bbbc8e024bbb
7
+ data.tar.gz: f560fd265b804ab36ba2e304fc85c0d0353f99dbefe7af5bea3841306c70f78ca72b7827a4f0148483244bebd6c5ef976cb2a93e58843f92446b125001a7762e
@@ -787,6 +787,7 @@
787
787
  <value>adapted</value>
788
788
  <value>vote-started</value>
789
789
  <value>vote-ended</value>
790
+ <value>announced</value>
790
791
  </choice>
791
792
  </define>
792
793
  <define name="bdate">
@@ -1191,9 +1191,7 @@
1191
1191
  </define>
1192
1192
  <define name="IsoWorkgroup">
1193
1193
  <optional>
1194
- <attribute name="number">
1195
- <data type="int"/>
1196
- </attribute>
1194
+ <attribute name="number"/>
1197
1195
  </optional>
1198
1196
  <optional>
1199
1197
  <attribute name="type"/>
@@ -99,6 +99,7 @@ module Asciidoctor
99
99
  "//clause[descendant::references][not(parent::clause)]".freeze
100
100
 
101
101
  def sections_sequence_validate(root)
102
+ vocab = root&.at("//bibdata/ext/subdoctype")&.text == "vocabulary"
102
103
  names = root.xpath(SECTIONS_XPATH)
103
104
  names = seqcheck(names, SEQ[0][:msg], SEQ[0][:val])
104
105
  n = names[0]
@@ -112,21 +113,27 @@ module Asciidoctor
112
113
  n = names.shift
113
114
  end
114
115
  if n.nil? || n.name != "clause"
115
- @log.add("Style", nil, "Document must contain at least one clause")
116
+ @log.add("Style", n, "Document must contain at least one clause")
116
117
  end
117
118
  n&.at("./self::clause") ||
118
- @log.add("Style", nil, "Document must contain clause after "\
119
+ @log.add("Style", n, "Document must contain clause after "\
119
120
  "Terms and Definitions")
120
121
  n&.at("./self::clause[@type = 'scope']") &&
121
- @log.add("Style", nil, "Scope must occur before Terms and Definitions")
122
+ @log.add("Style", n, "Scope must occur before Terms and Definitions")
122
123
  n = names.shift
123
- while n&.name == "clause"
124
+ while n&.name == "clause" || (vocab && n&.name == "terms")
124
125
  n&.at("./self::clause[@type = 'scope']")
125
- @log.add("Style", nil, "Scope must occur before Terms and Definitions")
126
+ @log.add("Style", n, "Scope must occur before Terms and Definitions")
126
127
  n = names.shift
127
128
  end
128
- unless %w(annex references).include? n&.name
129
- @log.add("Style", nil, "Only annexes and references can follow clauses")
129
+ if vocab
130
+ unless %w(annex references terms).include? n&.name
131
+ @log.add("Style", n, "Only terms, annexes and references can follow clauses")
132
+ end
133
+ else
134
+ unless %w(annex references).include? n&.name
135
+ @log.add("Style", n, "Only annexes and references can follow clauses")
136
+ end
130
137
  end
131
138
  while n&.name == "annex"
132
139
  n = names.shift
@@ -140,9 +147,9 @@ module Asciidoctor
140
147
  "Normative References")
141
148
  n = names&.shift
142
149
  n&.at("./self::references[@normative = 'false']") ||
143
- @log.add("Style", nil, "Final section must be (references) Bibliography")
150
+ @log.add("Style", n, "Final section must be (references) Bibliography")
144
151
  names.empty? ||
145
- @log.add("Style", nil, "There are sections after the final Bibliography")
152
+ @log.add("Style", n, "There are sections after the final Bibliography")
146
153
  end
147
154
 
148
155
  def style_warning(node, msg, text = nil)
@@ -1425,7 +1425,7 @@
1425
1425
  </xsl:if>
1426
1426
  </xsl:template>
1427
1427
 
1428
-
1428
+ <xsl:template match="iso:p | iso:termsource | iso:termnote" mode="contents"/>
1429
1429
 
1430
1430
  <xsl:template name="getListItemFormat">
1431
1431
  <xsl:choose>
@@ -1752,61 +1752,7 @@
1752
1752
  <xsl:apply-templates/>
1753
1753
  </xsl:template>
1754
1754
 
1755
-
1756
-
1757
- <xsl:template match="iso:bibitem">
1758
- <fo:block id="{@id}" margin-bottom="6pt"> <!-- 12 pt -->
1759
- <xsl:variable name="docidentifier">
1760
- <xsl:if test="iso:docidentifier">
1761
- <xsl:choose>
1762
- <xsl:when test="iso:docidentifier/@type = 'metanorma'"/>
1763
- <xsl:otherwise><xsl:value-of select="iso:docidentifier"/></xsl:otherwise>
1764
- </xsl:choose>
1765
- </xsl:if>
1766
- </xsl:variable>
1767
- <xsl:value-of select="$docidentifier"/>
1768
- <xsl:apply-templates select="iso:note"/>
1769
- <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
1770
- <fo:inline font-style="italic">
1771
- <xsl:choose>
1772
- <xsl:when test="iso:title[@type = 'main' and @language = $lang]">
1773
- <xsl:value-of select="iso:title[@type = 'main' and @language = $lang]"/>
1774
- </xsl:when>
1775
- <xsl:when test="iso:title[@type = 'main' and @language = 'en']">
1776
- <xsl:value-of select="iso:title[@type = 'main' and @language = 'en']"/>
1777
- </xsl:when>
1778
- <xsl:otherwise>
1779
- <xsl:value-of select="iso:title"/>
1780
- </xsl:otherwise>
1781
- </xsl:choose>
1782
- </fo:inline>
1783
- </fo:block>
1784
- </xsl:template>
1785
-
1786
-
1787
- <xsl:template match="iso:bibitem/iso:note" priority="2">
1788
- <fo:footnote>
1789
- <xsl:variable name="number">
1790
- <xsl:number level="any" count="iso:bibitem/iso:note"/>
1791
- </xsl:variable>
1792
- <fo:inline font-size="8pt" keep-with-previous.within-line="always" baseline-shift="30%"> <!--85% vertical-align="super"-->
1793
- <fo:basic-link internal-destination="{generate-id()}" fox:alt-text="footnote {$number}">
1794
- <xsl:value-of select="$number"/><xsl:text>)</xsl:text>
1795
- </fo:basic-link>
1796
- </fo:inline>
1797
- <fo:footnote-body>
1798
- <fo:block font-size="10pt" margin-bottom="4pt" start-indent="0pt">
1799
- <fo:inline id="{generate-id()}" keep-with-next.within-line="always" alignment-baseline="hanging" padding-right="3mm"><!-- font-size="60%" -->
1800
- <xsl:value-of select="$number"/><xsl:text>)</xsl:text>
1801
- </fo:inline>
1802
- <xsl:apply-templates/>
1803
- </fo:block>
1804
- </fo:footnote-body>
1805
- </fo:footnote>
1806
- </xsl:template>
1807
-
1808
-
1809
-
1755
+
1810
1756
  <xsl:template match="iso:ul | iso:ol" mode="ul_ol">
1811
1757
  <fo:list-block provisional-distance-between-starts="7mm" margin-top="8pt"> <!-- margin-bottom="8pt" -->
1812
1758
  <xsl:apply-templates/>
@@ -1872,6 +1818,34 @@
1872
1818
  </xsl:template>
1873
1819
 
1874
1820
 
1821
+ <xsl:template match="iso:bibitem">
1822
+ <fo:block id="{@id}" margin-bottom="6pt">
1823
+ <xsl:call-template name="processBibitem"/>
1824
+ </fo:block>
1825
+ </xsl:template>
1826
+
1827
+
1828
+ <xsl:template match="iso:bibitem/iso:note" priority="2">
1829
+ <fo:footnote>
1830
+ <xsl:variable name="number">
1831
+ <xsl:number level="any" count="iso:bibitem/iso:note"/>
1832
+ </xsl:variable>
1833
+ <fo:inline font-size="8pt" keep-with-previous.within-line="always" baseline-shift="30%"> <!--85% vertical-align="super"-->
1834
+ <fo:basic-link internal-destination="{generate-id()}" fox:alt-text="footnote {$number}">
1835
+ <xsl:value-of select="$number"/><xsl:text>)</xsl:text>
1836
+ </fo:basic-link>
1837
+ </fo:inline>
1838
+ <fo:footnote-body>
1839
+ <fo:block font-size="10pt" margin-bottom="4pt" start-indent="0pt">
1840
+ <fo:inline id="{generate-id()}" keep-with-next.within-line="always" alignment-baseline="hanging" padding-right="3mm"><!-- font-size="60%" -->
1841
+ <xsl:value-of select="$number"/><xsl:text>)</xsl:text>
1842
+ </fo:inline>
1843
+ <xsl:apply-templates/>
1844
+ </fo:block>
1845
+ </fo:footnote-body>
1846
+ </fo:footnote>
1847
+ </xsl:template>
1848
+
1875
1849
  <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
1876
1850
  <!-- <xsl:template match="iso:references[@id = '_bibliography']/iso:bibitem"> -->
1877
1851
  <xsl:template match="iso:references[not(@normative='true')]/iso:bibitem">
@@ -1886,40 +1860,18 @@
1886
1860
  </fo:list-item-label>
1887
1861
  <fo:list-item-body start-indent="body-start()">
1888
1862
  <fo:block>
1889
- <xsl:variable name="docidentifier">
1890
- <xsl:if test="iso:docidentifier">
1891
- <xsl:choose>
1892
- <xsl:when test="iso:docidentifier/@type = 'metanorma'"/>
1893
- <xsl:otherwise><xsl:value-of select="iso:docidentifier"/></xsl:otherwise>
1894
- </xsl:choose>
1895
- </xsl:if>
1896
- </xsl:variable>
1897
- <xsl:value-of select="$docidentifier"/>
1898
- <xsl:apply-templates select="iso:note"/>
1899
- <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
1900
- <xsl:choose>
1901
- <xsl:when test="iso:title[@type = 'main' and @language = $lang]">
1902
- <xsl:apply-templates select="iso:title[@type = 'main' and @language = $lang]"/>
1903
- </xsl:when>
1904
- <xsl:when test="iso:title[@type = 'main' and @language = 'en']">
1905
- <xsl:apply-templates select="iso:title[@type = 'main' and @language = 'en']"/>
1906
- </xsl:when>
1907
- <xsl:otherwise>
1908
- <xsl:apply-templates select="iso:title"/>
1909
- </xsl:otherwise>
1910
- </xsl:choose>
1911
- <xsl:apply-templates select="iso:formattedref"/>
1863
+ <xsl:call-template name="processBibitem"/>
1912
1864
  </fo:block>
1913
1865
  </fo:list-item-body>
1914
1866
  </fo:list-item>
1915
1867
  </fo:list-block>
1916
1868
  </xsl:template>
1917
1869
 
1918
- <!-- <xsl:template match="iso:references[@id = '_bibliography']/iso:bibitem" mode="contents"/> -->
1919
- <xsl:template match="iso:references[not(@normative='true')]/iso:bibitem" mode="contents"/>
1870
+ <!-- <xsl:template match="iso:references[@id = '_bibliography']/iso:bibitem" mode="contents"/> [not(@normative='true')] -->
1871
+ <xsl:template match="iso:references/iso:bibitem" mode="contents"/>
1920
1872
 
1921
- <!-- <xsl:template match="iso:references[@id = '_bibliography']/iso:bibitem/iso:title"> -->
1922
- <xsl:template match="iso:references[not(@normative='true')]/iso:bibitem/iso:title">
1873
+ <!-- <xsl:template match="iso:references[@id = '_bibliography']/iso:bibitem/iso:title"> iso:references[not(@normative='true')]/ -->
1874
+ <xsl:template match="iso:bibitem/iso:title">
1923
1875
  <fo:inline font-style="italic">
1924
1876
  <xsl:apply-templates/>
1925
1877
  </fo:inline>
@@ -2673,6 +2625,9 @@
2673
2625
  <title-continued lang="en">(continued)</title-continued>
2674
2626
  <title-continued lang="fr">(continué)</title-continued>
2675
2627
 
2628
+ </xsl:variable><xsl:variable name="bibdata">
2629
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
2630
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
2676
2631
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
2677
2632
  <xsl:param name="name"/>
2678
2633
  <xsl:param name="lang"/>
@@ -2701,6 +2656,7 @@
2701
2656
 
2702
2657
  </xsl:attribute-set><xsl:attribute-set name="link-style">
2703
2658
 
2659
+
2704
2660
  <xsl:attribute name="color">blue</xsl:attribute>
2705
2661
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
2706
2662
 
@@ -2828,6 +2784,7 @@
2828
2784
 
2829
2785
  </xsl:attribute-set><xsl:attribute-set name="table-name-style">
2830
2786
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2787
+
2831
2788
 
2832
2789
 
2833
2790
 
@@ -2866,6 +2823,7 @@
2866
2823
  </xsl:attribute-set><xsl:attribute-set name="xref-style">
2867
2824
 
2868
2825
 
2826
+
2869
2827
  <xsl:attribute name="color">blue</xsl:attribute>
2870
2828
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
2871
2829
 
@@ -2879,6 +2837,7 @@
2879
2837
 
2880
2838
 
2881
2839
 
2840
+
2882
2841
 
2883
2842
 
2884
2843
 
@@ -2902,6 +2861,7 @@
2902
2861
 
2903
2862
 
2904
2863
 
2864
+
2905
2865
  <xsl:attribute name="padding-right">6mm</xsl:attribute>
2906
2866
 
2907
2867
 
@@ -2931,6 +2891,7 @@
2931
2891
 
2932
2892
 
2933
2893
 
2894
+
2934
2895
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2935
2896
  <xsl:attribute name="margin-top">8pt</xsl:attribute>
2936
2897
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
@@ -2939,6 +2900,7 @@
2939
2900
 
2940
2901
 
2941
2902
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
2903
+
2942
2904
 
2943
2905
 
2944
2906
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
@@ -2965,6 +2927,7 @@
2965
2927
 
2966
2928
 
2967
2929
 
2930
+
2968
2931
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
2969
2932
 
2970
2933
  </xsl:attribute-set><xsl:attribute-set name="origin-style">
@@ -2977,6 +2940,7 @@
2977
2940
 
2978
2941
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
2979
2942
 
2943
+
2980
2944
 
2981
2945
 
2982
2946
 
@@ -3009,10 +2973,12 @@
3009
2973
 
3010
2974
 
3011
2975
 
2976
+
3012
2977
  </xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
3013
2978
 
3014
2979
  </xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
3015
2980
 
2981
+
3016
2982
  <xsl:attribute name="width">100%</xsl:attribute>
3017
2983
  <xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
3018
2984
  <xsl:attribute name="scaling">uniform</xsl:attribute>
@@ -3046,6 +3012,7 @@
3046
3012
 
3047
3013
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
3048
3014
 
3015
+
3049
3016
  </xsl:attribute-set><xsl:variable name="color-added-text">
3050
3017
  <xsl:text>rgb(0, 255, 0)</xsl:text>
3051
3018
  </xsl:variable><xsl:attribute-set name="add-style">
@@ -3181,6 +3148,7 @@
3181
3148
 
3182
3149
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
3183
3150
 
3151
+
3184
3152
  <xsl:attribute name="font-size">10pt</xsl:attribute>
3185
3153
 
3186
3154
 
@@ -3192,6 +3160,7 @@
3192
3160
 
3193
3161
 
3194
3162
 
3163
+
3195
3164
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
3196
3165
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
3197
3166
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
@@ -3201,6 +3170,7 @@
3201
3170
 
3202
3171
 
3203
3172
 
3173
+
3204
3174
  <xsl:variable name="table_width">
3205
3175
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
3206
3176
  100%
@@ -3214,6 +3184,7 @@
3214
3184
  <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
3215
3185
  <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
3216
3186
 
3187
+
3217
3188
  <attribute name="border">1.5pt solid black</attribute>
3218
3189
  <xsl:if test="*[local-name()='thead']">
3219
3190
  <attribute name="border-top">1pt solid black</attribute>
@@ -3373,13 +3344,26 @@
3373
3344
  </xsl:choose>
3374
3345
 
3375
3346
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
3347
+ <xsl:param name="continued"/>
3376
3348
  <xsl:if test="normalize-space() != ''">
3377
3349
  <fo:block xsl:use-attribute-sets="table-name-style">
3378
3350
 
3379
3351
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
3380
3352
 
3381
3353
 
3382
- <xsl:apply-templates/>
3354
+ <xsl:choose>
3355
+ <xsl:when test="$continued = 'true'">
3356
+ <!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
3357
+
3358
+ <xsl:apply-templates/>
3359
+
3360
+ </xsl:when>
3361
+ <xsl:otherwise>
3362
+ <xsl:apply-templates/>
3363
+ </xsl:otherwise>
3364
+ </xsl:choose>
3365
+
3366
+
3383
3367
  </fo:block>
3384
3368
  </xsl:if>
3385
3369
  </xsl:template><xsl:template name="calculate-columns-numbers">
@@ -3523,18 +3507,23 @@
3523
3507
  <xsl:apply-templates/>
3524
3508
  </fo:table-header>
3525
3509
  </xsl:template><xsl:template name="table-header-title">
3526
- <xsl:param name="cols-count"/>
3510
+ <xsl:param name="cols-count"/>
3527
3511
  <!-- row for title -->
3528
3512
  <fo:table-row>
3529
3513
  <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">
3530
- <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
3514
+
3515
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
3516
+ <xsl:with-param name="continued">true</xsl:with-param>
3517
+ </xsl:apply-templates>
3531
3518
  <xsl:for-each select="ancestor::*[local-name()='table'][1]">
3532
3519
  <xsl:call-template name="fn_name_display"/>
3533
- </xsl:for-each>
3534
- <fo:block text-align="right" font-style="italic">
3535
- <xsl:text> </xsl:text>
3536
- <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
3537
- </fo:block>
3520
+ </xsl:for-each>
3521
+
3522
+ <fo:block text-align="right" font-style="italic">
3523
+ <xsl:text> </xsl:text>
3524
+ <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
3525
+ </fo:block>
3526
+
3538
3527
  </fo:table-cell>
3539
3528
  </fo:table-row>
3540
3529
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
@@ -3755,19 +3744,25 @@
3755
3744
  <xsl:call-template name="getTitle">
3756
3745
  <xsl:with-param name="name" select="'title-continued'"/>
3757
3746
  </xsl:call-template>
3758
- </xsl:variable>
3747
+ </xsl:variable>
3748
+
3749
+ <xsl:variable name="title_start" select="ancestor::*[local-name()='table'][1]/*[local-name()='name']/node()[1][self::text()]"/>
3750
+ <xsl:variable name="table_number" select="substring-before($title_start, '—')"/>
3751
+
3759
3752
  <fo:table-row height="0" keep-with-next.within-page="always">
3760
3753
  <fo:table-cell>
3761
- <fo:marker marker-class-name="table_continued"/>
3754
+
3755
+
3756
+ <fo:marker marker-class-name="table_continued"/>
3757
+
3762
3758
  <fo:block/>
3763
3759
  </fo:table-cell>
3764
3760
  </fo:table-row>
3765
3761
  <fo:table-row height="0" keep-with-next.within-page="always">
3766
3762
  <fo:table-cell>
3767
- <fo:marker marker-class-name="table_continued">
3768
- <!-- <fo:inline font-style="italic" font-weight="normal"> -->
3769
- <xsl:value-of select="$title_continued"/>
3770
- <!-- </fo:inline> -->
3763
+
3764
+ <fo:marker marker-class-name="table_continued">
3765
+ <xsl:value-of select="$title_continued"/>
3771
3766
  </fo:marker>
3772
3767
  <fo:block/>
3773
3768
  </fo:table-cell>
@@ -3805,6 +3800,7 @@
3805
3800
 
3806
3801
 
3807
3802
 
3803
+
3808
3804
  </xsl:if>
3809
3805
  <xsl:if test="$parent-name = 'tfoot'">
3810
3806
 
@@ -3836,6 +3832,7 @@
3836
3832
  </xsl:choose>
3837
3833
  </xsl:attribute>
3838
3834
 
3835
+
3839
3836
  <xsl:attribute name="padding-top">1mm</xsl:attribute>
3840
3837
 
3841
3838
 
@@ -4549,6 +4546,7 @@
4549
4546
 
4550
4547
 
4551
4548
 
4549
+
4552
4550
 
4553
4551
  </xsl:variable>
4554
4552
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -4930,11 +4928,15 @@
4930
4928
  </xsl:apply-templates>
4931
4929
  </xsl:template><xsl:template name="getLang">
4932
4930
  <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4931
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4933
4932
  <xsl:variable name="language">
4934
4933
  <xsl:choose>
4935
4934
  <xsl:when test="$language_current != ''">
4936
4935
  <xsl:value-of select="$language_current"/>
4937
4936
  </xsl:when>
4937
+ <xsl:when test="$language_current_2 != ''">
4938
+ <xsl:value-of select="$language_current_2"/>
4939
+ </xsl:when>
4938
4940
  <xsl:otherwise>
4939
4941
  <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
4940
4942
  </xsl:otherwise>
@@ -5154,6 +5156,7 @@
5154
5156
 
5155
5157
 
5156
5158
  <fo:inline xsl:use-attribute-sets="note-name-style">
5159
+
5157
5160
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
5158
5161
  </fo:inline>
5159
5162
  <xsl:apply-templates/>
@@ -5180,6 +5183,7 @@
5180
5183
  </xsl:template><xsl:template match="*[local-name() = 'termnote']">
5181
5184
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
5182
5185
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
5186
+
5183
5187
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
5184
5188
  </fo:inline>
5185
5189
  <xsl:apply-templates/>
@@ -5259,7 +5263,10 @@
5259
5263
  <xsl:for-each select="*[local-name() = 'note']">
5260
5264
  <xsl:call-template name="note"/>
5261
5265
  </xsl:for-each>
5262
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
5266
+
5267
+
5268
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
5269
+
5263
5270
  </fo:block-container>
5264
5271
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
5265
5272
  <fo:block id="{@id}">
@@ -5378,15 +5385,15 @@
5378
5385
  </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">
5379
5386
  <xsl:apply-templates mode="bookmarks"/>
5380
5387
  <xsl:text> </xsl:text>
5381
- </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
5388
+ </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">
5382
5389
  <xsl:value-of select="."/>
5383
- </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
5390
+ </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">
5384
5391
  <xsl:value-of select="."/>
5385
5392
  </xsl:template><xsl:template match="node()" mode="contents">
5386
5393
  <xsl:apply-templates mode="contents"/>
5387
5394
  </xsl:template><xsl:template match="node()" mode="bookmarks">
5388
5395
  <xsl:apply-templates mode="bookmarks"/>
5389
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
5396
+ </xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
5390
5397
  <xsl:apply-templates select="."/>
5391
5398
  </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
5392
5399
  <xsl:apply-templates mode="bookmarks"/>
@@ -5585,6 +5592,8 @@
5585
5592
  </fo:list-item-body>
5586
5593
  </fo:list-item>
5587
5594
  </fo:list-block>
5595
+ </xsl:template><xsl:template name="extractSection">
5596
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
5588
5597
  </xsl:template><xsl:template name="extractTitle">
5589
5598
  <xsl:choose>
5590
5599
  <xsl:when test="*[local-name() = 'tab']">
@@ -5632,6 +5641,7 @@
5632
5641
  9
5633
5642
 
5634
5643
 
5644
+
5635
5645
 
5636
5646
 
5637
5647
 
@@ -5959,7 +5969,7 @@
5959
5969
  </fo:inline>
5960
5970
  </xsl:otherwise>
5961
5971
  </xsl:choose>
5962
- </xsl:template><xsl:template match="*[local-name() = 'termsource']">
5972
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
5963
5973
  <fo:block xsl:use-attribute-sets="termsource-style">
5964
5974
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
5965
5975
  <xsl:variable name="termsource_text">
@@ -5968,13 +5978,15 @@
5968
5978
 
5969
5979
  <xsl:choose>
5970
5980
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
5971
- <xsl:apply-templates/>
5981
+ <!-- <xsl:apply-templates /> -->
5982
+ <xsl:copy-of select="$termsource_text"/>
5972
5983
  </xsl:when>
5973
5984
  <xsl:otherwise>
5974
5985
 
5975
5986
  <xsl:text>[</xsl:text>
5976
5987
 
5977
- <xsl:apply-templates/>
5988
+ <!-- <xsl:apply-templates /> -->
5989
+ <xsl:copy-of select="$termsource_text"/>
5978
5990
 
5979
5991
  <xsl:text>]</xsl:text>
5980
5992
 
@@ -5985,16 +5997,23 @@
5985
5997
  <xsl:if test="normalize-space() != ''">
5986
5998
  <xsl:value-of select="."/>
5987
5999
  </xsl:if>
5988
- </xsl:template><xsl:template match="*[local-name() = 'origin']">
6000
+ </xsl:template><xsl:variable name="localized.source">
6001
+ <xsl:call-template name="getLocalizedString">
6002
+ <xsl:with-param name="key">source</xsl:with-param>
6003
+ </xsl:call-template>
6004
+ </xsl:variable><xsl:template match="*[local-name() = 'origin']">
5989
6005
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
6006
+ <xsl:if test="normalize-space(@citeas) = ''">
6007
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
6008
+ </xsl:if>
5990
6009
 
5991
6010
  <fo:inline>
5992
6011
 
5993
6012
 
5994
-
5995
- <xsl:call-template name="getLocalizedString">
6013
+ <!-- <xsl:call-template name="getLocalizedString">
5996
6014
  <xsl:with-param name="key">source</xsl:with-param>
5997
- </xsl:call-template>
6015
+ </xsl:call-template> -->
6016
+ <xsl:value-of select="$localized.source"/>
5998
6017
 
5999
6018
 
6000
6019
 
@@ -6206,7 +6225,6 @@
6206
6225
 
6207
6226
 
6208
6227
 
6209
-
6210
6228
  <xsl:apply-templates/>
6211
6229
  </fo:block>
6212
6230
 
@@ -6249,7 +6267,7 @@
6249
6267
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
6250
6268
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
6251
6269
  <xsl:choose>
6252
- <xsl:when test="parent::*[local-name() = 'note']">
6270
+ <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
6253
6271
  <fo:block-container>
6254
6272
  <xsl:attribute name="margin-left">
6255
6273
  <xsl:choose>
@@ -6259,6 +6277,7 @@
6259
6277
  </xsl:attribute>
6260
6278
 
6261
6279
 
6280
+
6262
6281
  <fo:block-container margin-left="0mm">
6263
6282
  <fo:block>
6264
6283
  <xsl:apply-templates select="." mode="ul_ol"/>
@@ -6460,6 +6479,36 @@
6460
6479
 
6461
6480
 
6462
6481
 
6482
+
6483
+
6484
+ <!-- start ISO bibtem processing -->
6485
+ <xsl:variable name="docidentifier">
6486
+ <xsl:if test="*[local-name() = 'docidentifier']">
6487
+ <xsl:choose>
6488
+ <xsl:when test="*[local-name() = 'docidentifier']/@type = 'metanorma'"/>
6489
+ <xsl:otherwise><xsl:value-of select="*[local-name() = 'docidentifier']"/></xsl:otherwise>
6490
+ </xsl:choose>
6491
+ </xsl:if>
6492
+ </xsl:variable>
6493
+ <xsl:value-of select="$docidentifier"/>
6494
+ <xsl:apply-templates select="*[local-name() = 'note']"/>
6495
+ <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
6496
+ <xsl:choose>
6497
+ <xsl:when test="*[local-name() = 'title'][@type = 'main' and @language = $lang]">
6498
+ <xsl:apply-templates select="*[local-name() = 'title'][@type = 'main' and @language = $lang]"/>
6499
+ </xsl:when>
6500
+ <xsl:when test="*[local-name() = 'title'][@type = 'main' and @language = 'en']">
6501
+ <xsl:apply-templates select="*[local-name() = 'title'][@type = 'main' and @language = 'en']"/>
6502
+ </xsl:when>
6503
+ <xsl:otherwise>
6504
+ <xsl:apply-templates select="*[local-name() = 'title']"/>
6505
+ </xsl:otherwise>
6506
+ </xsl:choose>
6507
+ <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
6508
+ <!-- end ISO bibitem processing -->
6509
+
6510
+
6511
+
6463
6512
  </xsl:template><xsl:template name="processBibitemDocId">
6464
6513
  <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')]"/>
6465
6514
  <xsl:choose>
@@ -6842,6 +6891,7 @@
6842
6891
  <xsl:variable name="documentNS" select="namespace-uri(/*)"/>
6843
6892
  <xsl:variable name="XSLNS">
6844
6893
 
6894
+
6845
6895
  <xsl:value-of select="document('')//*/namespace::iso"/>
6846
6896
 
6847
6897
 
@@ -6911,13 +6961,18 @@
6911
6961
  </xsl:call-template>
6912
6962
  </xsl:if>
6913
6963
  </xsl:template><xsl:template name="getLocalizedString">
6914
- <xsl:param name="key"/>
6964
+ <xsl:param name="key"/>
6915
6965
 
6916
6966
  <xsl:variable name="curr_lang">
6917
6967
  <xsl:call-template name="getLang"/>
6918
6968
  </xsl:variable>
6919
6969
 
6970
+ <xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
6971
+
6920
6972
  <xsl:choose>
6973
+ <xsl:when test="$data_value != ''">
6974
+ <xsl:value-of select="$data_value"/>
6975
+ </xsl:when>
6921
6976
  <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
6922
6977
  <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6923
6978
  </xsl:when>