metanorma-un 0.10.10 → 0.10.11

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 97b538520143d4dd803f58fe306198e1deaeb8c06fbe5ea07fa4055ea3541f1e
4
- data.tar.gz: 4eaa116630755926a0f21d775d751ae30d090c878a69f6444e99b4fe44017459
3
+ metadata.gz: 44b206001d6db1ddd4899f7c2f9554855c0f0888d4aa6d6379b63e2b6872a515
4
+ data.tar.gz: 70a0d21ad1ec44c8cb897e97219ab627c14fa22b0880f3ae04265fe38acaf549
5
5
  SHA512:
6
- metadata.gz: 5a6d85f8e2d49d36002a5c4769a5cf6eea769e09924f98313ae428cf07e49bf984ba6b240604d7f9bf7f4f79d7b6ecf83e5c9cedd233c171648b50e79f4e221d
7
- data.tar.gz: 3674711e675dd9b7c9ad3ae62ace63a908513d19c12f432ab696c0a1233934876abb977698c9a7f7b72d471bf956938bdc5446ef04c8b51dd3423ab54de568e8
6
+ metadata.gz: bd8e8c78fde157cc7740f56c6499e65a0c328edd8a64db4d2852891a5ebf3f98d92d8f19d641a70f77ee8849ec1210d476469d899abffcb78a14aa4c03822a75
7
+ data.tar.gz: 641505f4668757c5c3e27e3eee4ee3cc747cc6d15505f637da1b0a706fa20e7ec9bb1dd6036595c7f2f7d41b917b1704c01b422764e88cdbc55592fb160d1c41
@@ -1724,6 +1724,10 @@
1724
1724
  </xsl:attribute-set> <!-- formula-stem-number-style -->
1725
1725
  <!-- End Formula's styles -->
1726
1726
 
1727
+ <xsl:template name="refine_formula-stem-number-style">
1728
+
1729
+ </xsl:template>
1730
+
1727
1731
  <xsl:attribute-set name="image-style">
1728
1732
  <xsl:attribute name="text-align">center</xsl:attribute>
1729
1733
 
@@ -2213,13 +2217,13 @@
2213
2217
 
2214
2218
  <xsl:template name="processPrefaceSectionsDefault_Contents">
2215
2219
  <xsl:variable name="nodes_preface_">
2216
- <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
2220
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition' or @type = 'toc')]">
2217
2221
  <node id="{@id}"/>
2218
2222
  </xsl:for-each>
2219
2223
  </xsl:variable>
2220
2224
  <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
2221
2225
 
2222
- <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
2226
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition' or @type = 'toc')]">
2223
2227
  <xsl:sort select="@displayorder" data-type="number"/>
2224
2228
 
2225
2229
  <!-- process Section's title -->
@@ -2253,12 +2257,12 @@
2253
2257
  <xsl:apply-templates select="." mode="contents"/>
2254
2258
  </xsl:for-each>
2255
2259
 
2256
- <xsl:for-each select="/*/*[local-name()='annex']">
2260
+ <!-- <xsl:for-each select="/*/*[local-name()='annex']">
2257
2261
  <xsl:sort select="@displayorder" data-type="number"/>
2258
2262
  <xsl:apply-templates select="." mode="contents"/>
2259
- </xsl:for-each>
2263
+ </xsl:for-each> -->
2260
2264
 
2261
- <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true') and not(*[local-name()='references'][@normative='true'])][count(.//*[local-name() = 'bibitem'][not(@hidden) = 'true']) &gt; 0] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]][count(.//*[local-name() = 'bibitem'][not(@hidden) = 'true']) &gt; 0]">
2265
+ <xsl:for-each select="/*/*[local-name()='annex'] | /*/*[local-name()='bibliography']/*[not(@normative='true') and not(*[local-name()='references'][@normative='true'])][count(.//*[local-name() = 'bibitem'][not(@hidden) = 'true']) &gt; 0] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]][count(.//*[local-name() = 'bibitem'][not(@hidden) = 'true']) &gt; 0]">
2262
2266
  <xsl:sort select="@displayorder" data-type="number"/>
2263
2267
  <xsl:apply-templates select="." mode="contents"/>
2264
2268
  </xsl:for-each>
@@ -2759,7 +2763,7 @@
2759
2763
  <xsl:param name="continued"/>
2760
2764
  <xsl:if test="normalize-space() != ''">
2761
2765
 
2762
- <fo:block xsl:use-attribute-sets="table-name-style">
2766
+ <fo:block xsl:use-attribute-sets="table-name-style" role="SKIP">
2763
2767
 
2764
2768
  <xsl:call-template name="refine_table-name-style">
2765
2769
  <xsl:with-param name="continued" select="$continued"/>
@@ -3144,8 +3148,8 @@
3144
3148
  <xsl:template name="table-header-title">
3145
3149
  <xsl:param name="cols-count"/>
3146
3150
  <!-- row for title -->
3147
- <fo:table-row>
3148
- <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">
3151
+ <fo:table-row role="SKIP">
3152
+ <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" role="SKIP">
3149
3153
 
3150
3154
  <xsl:call-template name="refine_table-header-title-style"/>
3151
3155
 
@@ -3154,7 +3158,7 @@
3154
3158
  </xsl:apply-templates>
3155
3159
 
3156
3160
  <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
3157
- <fo:block/>
3161
+ <fo:block role="SKIP"/>
3158
3162
  </xsl:if>
3159
3163
 
3160
3164
  </fo:table-cell>
@@ -3469,7 +3473,7 @@
3469
3473
 
3470
3474
  <xsl:call-template name="refine_table-header-cell-style"/>
3471
3475
 
3472
- <fo:block>
3476
+ <fo:block role="SKIP">
3473
3477
  <xsl:apply-templates/>
3474
3478
  </fo:block>
3475
3479
  </fo:table-cell>
@@ -3522,7 +3526,7 @@
3522
3526
  <xsl:attribute name="text-align">left</xsl:attribute>
3523
3527
  </xsl:if>
3524
3528
 
3525
- <fo:block>
3529
+ <fo:block role="SKIP">
3526
3530
 
3527
3531
  <xsl:if test="$isGenerateTableIF = 'true'">
3528
3532
  <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
@@ -4385,7 +4389,7 @@
4385
4389
  -->
4386
4390
  <fo:table-row>
4387
4391
  <fo:table-cell number-columns-spanned="2">
4388
- <fo:block>
4392
+ <fo:block role="SKIP">
4389
4393
  <xsl:call-template name="note"/>
4390
4394
  </fo:block>
4391
4395
  </fo:table-cell>
@@ -4450,7 +4454,7 @@
4450
4454
 
4451
4455
  <xsl:call-template name="refine_dt-cell-style"/>
4452
4456
 
4453
- <fo:block xsl:use-attribute-sets="dt-block-style">
4457
+ <fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
4454
4458
  <xsl:copy-of select="@id"/>
4455
4459
 
4456
4460
  <xsl:if test="normalize-space($key_iso) = 'true'">
@@ -4480,7 +4484,7 @@
4480
4484
 
4481
4485
  <xsl:call-template name="refine_dd-cell-style"/>
4482
4486
 
4483
- <fo:block>
4487
+ <fo:block role="SKIP">
4484
4488
 
4485
4489
  <xsl:if test="$isGenerateTableIF = 'true'">
4486
4490
  <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
@@ -4853,11 +4857,41 @@
4853
4857
 
4854
4858
  <xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
4855
4859
  <xsl:variable name="text" select="normalize-space(.)"/>
4856
- <fo:inline font-size="75%">
4860
+ <fo:inline font-size="75%" role="SKIP">
4857
4861
  <xsl:if test="string-length($text) &gt; 0">
4858
- <xsl:call-template name="recursiveSmallCaps">
4859
- <xsl:with-param name="text" select="$text"/>
4860
- </xsl:call-template>
4862
+ <xsl:variable name="smallCapsText">
4863
+ <xsl:call-template name="recursiveSmallCaps">
4864
+ <xsl:with-param name="text" select="$text"/>
4865
+ </xsl:call-template>
4866
+ </xsl:variable>
4867
+ <!-- merge neighboring fo:inline -->
4868
+ <xsl:for-each select="xalan:nodeset($smallCapsText)/node()">
4869
+ <xsl:choose>
4870
+ <xsl:when test="self::fo:inline and preceding-sibling::node()[1][self::fo:inline]"><!-- <xsl:copy-of select="."/> --></xsl:when>
4871
+ <xsl:when test="self::fo:inline and @font-size">
4872
+ <xsl:variable name="curr_pos" select="count(preceding-sibling::node()) + 1"/>
4873
+ <!-- <curr_pos><xsl:value-of select="$curr_pos"/></curr_pos> -->
4874
+ <xsl:variable name="next_text_" select="count(following-sibling::node()[not(local-name() = 'inline')][1]/preceding-sibling::node())"/>
4875
+ <xsl:variable name="next_text">
4876
+ <xsl:choose>
4877
+ <xsl:when test="$next_text_ = 0">99999999</xsl:when>
4878
+ <xsl:otherwise><xsl:value-of select="$next_text_ + 1"/></xsl:otherwise>
4879
+ </xsl:choose>
4880
+ </xsl:variable>
4881
+ <!-- <next_text><xsl:value-of select="$next_text"/></next_text> -->
4882
+ <fo:inline>
4883
+ <xsl:copy-of select="@*"/>
4884
+ <xsl:copy-of select="./node()"/>
4885
+ <xsl:for-each select="following-sibling::node()[position() &lt; $next_text - $curr_pos]"> <!-- [self::fo:inline] -->
4886
+ <xsl:copy-of select="./node()"/>
4887
+ </xsl:for-each>
4888
+ </fo:inline>
4889
+ </xsl:when>
4890
+ <xsl:otherwise>
4891
+ <xsl:copy-of select="."/>
4892
+ </xsl:otherwise>
4893
+ </xsl:choose>
4894
+ </xsl:for-each>
4861
4895
  </xsl:if>
4862
4896
  </fo:inline>
4863
4897
  </xsl:template>
@@ -4869,7 +4903,7 @@
4869
4903
  <xsl:variable name="upperCase" select="java:toUpperCase(java:java.lang.String.new($char))"/>
4870
4904
  <xsl:choose>
4871
4905
  <xsl:when test="$char=$upperCase">
4872
- <fo:inline font-size="{100 div 0.75}%">
4906
+ <fo:inline font-size="{100 div 0.75}%" role="SKIP">
4873
4907
  <xsl:value-of select="$upperCase"/>
4874
4908
  </fo:inline>
4875
4909
  </xsl:when>
@@ -5031,6 +5065,10 @@
5031
5065
 
5032
5066
  <xsl:when test="not(contains($text, $separator))">
5033
5067
  <word>
5068
+ <xsl:if test="ancestor::*[local-name() = 'p'][@from_dl = 'true']">
5069
+ <xsl:text>
5070
+  </xsl:text> <!-- to add distance between dt and dd -->
5071
+ </xsl:if>
5034
5072
  <xsl:call-template name="enclose_text_in_tags">
5035
5073
  <xsl:with-param name="text" select="normalize-space($text)"/>
5036
5074
  <xsl:with-param name="tags" select="$tags"/>
@@ -5039,6 +5077,10 @@
5039
5077
  </xsl:when>
5040
5078
  <xsl:otherwise>
5041
5079
  <word>
5080
+ <xsl:if test="ancestor::*[local-name() = 'p'][@from_dl = 'true']">
5081
+ <xsl:text>
5082
+  </xsl:text> <!-- to add distance between dt and dd -->
5083
+ </xsl:if>
5042
5084
  <xsl:call-template name="enclose_text_in_tags">
5043
5085
  <xsl:with-param name="text" select="normalize-space(substring-before($text, $separator))"/>
5044
5086
  <xsl:with-param name="tags" select="$tags"/>
@@ -5222,6 +5264,10 @@
5222
5264
  <xsl:template name="getSimpleTable">
5223
5265
  <xsl:param name="id"/>
5224
5266
 
5267
+ <!-- <test0>
5268
+ <xsl:copy-of select="."/>
5269
+ </test0> -->
5270
+
5225
5271
  <xsl:variable name="simple-table">
5226
5272
 
5227
5273
  <!-- Step 0. replace <br/> to <p>...</p> -->
@@ -6267,7 +6313,7 @@
6267
6313
  <fo:table-body>
6268
6314
  <fo:table-row>
6269
6315
  <fo:table-cell display-align="center">
6270
- <fo:block xsl:use-attribute-sets="formula-stem-block-style">
6316
+ <fo:block xsl:use-attribute-sets="formula-stem-block-style" role="SKIP">
6271
6317
 
6272
6318
  <xsl:call-template name="refine_formula-stem-block-style"/>
6273
6319
 
@@ -6275,7 +6321,10 @@
6275
6321
  </fo:block>
6276
6322
  </fo:table-cell>
6277
6323
  <fo:table-cell display-align="center">
6278
- <fo:block xsl:use-attribute-sets="formula-stem-number-style">
6324
+ <fo:block xsl:use-attribute-sets="formula-stem-number-style" role="SKIP">
6325
+
6326
+ <xsl:call-template name="refine_formula-stem-number-style"/>
6327
+
6279
6328
  <xsl:apply-templates select="../*[local-name() = 'name']"/>
6280
6329
  </fo:block>
6281
6330
  </fo:table-cell>
@@ -7797,7 +7846,7 @@
7797
7846
  <!-- second td with sourcecode -->
7798
7847
  <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
7799
7848
  <fo:table-cell>
7800
- <fo:block>
7849
+ <fo:block role="SKIP">
7801
7850
  <xsl:apply-templates/>
7802
7851
  </fo:block>
7803
7852
  </fo:table-cell>
@@ -8284,7 +8333,7 @@
8284
8333
 
8285
8334
  <xsl:call-template name="setTableCellAttributes"/>
8286
8335
 
8287
- <fo:block>
8336
+ <fo:block role="SKIP">
8288
8337
  <xsl:apply-templates/>
8289
8338
  </fo:block>
8290
8339
  </fo:table-cell>
@@ -8306,7 +8355,7 @@
8306
8355
 
8307
8356
  <xsl:call-template name="setTableCellAttributes"/>
8308
8357
 
8309
- <fo:block>
8358
+ <fo:block role="SKIP">
8310
8359
  <xsl:apply-templates/>
8311
8360
  </fo:block>
8312
8361
  </fo:table-cell>
@@ -9084,7 +9133,48 @@
9084
9133
  </xsl:choose>
9085
9134
  </xsl:when>
9086
9135
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
9087
- <xsl:value-of select="@label"/>
9136
+
9137
+ <xsl:variable name="label">
9138
+
9139
+ <xsl:variable name="type" select="../@type"/>
9140
+
9141
+ <xsl:variable name="style_prefix_">
9142
+ <xsl:if test="$type = 'roman'">
9143
+ <!-- Example: (i) -->
9144
+ </xsl:if>
9145
+ </xsl:variable>
9146
+ <xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
9147
+
9148
+ <xsl:variable name="style_suffix_">
9149
+ <xsl:choose>
9150
+ <xsl:when test="$type = 'arabic'">
9151
+ .
9152
+ </xsl:when>
9153
+ <xsl:when test="$type = 'alphabet' or $type = 'alphabetic'">
9154
+ )
9155
+ </xsl:when>
9156
+ <xsl:when test="$type = 'alphabet_upper' or $type = 'alphabetic_upper'">
9157
+ .
9158
+ </xsl:when>
9159
+ <xsl:when test="$type = 'roman'">
9160
+ )
9161
+ </xsl:when>
9162
+ <xsl:when test="$type = 'roman_upper'">.</xsl:when> <!-- Example: I. -->
9163
+ </xsl:choose>
9164
+ </xsl:variable>
9165
+ <xsl:variable name="style_suffix" select="normalize-space($style_suffix_)"/>
9166
+
9167
+ <xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
9168
+ <xsl:value-of select="$style_prefix"/>
9169
+ </xsl:if>
9170
+ <xsl:value-of select="@label"/>
9171
+ <xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
9172
+ <xsl:value-of select="$style_suffix"/>
9173
+ </xsl:if>
9174
+ </xsl:variable>
9175
+
9176
+ <xsl:value-of select="normalize-space($label)"/>
9177
+
9088
9178
  </xsl:when>
9089
9179
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
9090
9180
 
@@ -9281,7 +9371,7 @@
9281
9371
  <xsl:call-template name="refine_list-item-style"/>
9282
9372
 
9283
9373
  <fo:list-item-label end-indent="label-end()">
9284
- <fo:block xsl:use-attribute-sets="list-item-label-style">
9374
+ <fo:block xsl:use-attribute-sets="list-item-label-style" role="SKIP">
9285
9375
 
9286
9376
  <xsl:call-template name="refine_list-item-label-style"/>
9287
9377
 
@@ -9295,7 +9385,7 @@
9295
9385
  </fo:block>
9296
9386
  </fo:list-item-label>
9297
9387
  <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
9298
- <fo:block>
9388
+ <fo:block role="SKIP">
9299
9389
 
9300
9390
  <xsl:call-template name="refine_list-item-body-style"/>
9301
9391
 
@@ -9574,10 +9664,10 @@
9574
9664
  <fo:table-body>
9575
9665
  <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
9576
9666
 
9577
- <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
9578
- <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
9579
- <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
9580
- <fo:table-cell border="1pt solid black"><fo:block>Pages</fo:block></fo:table-cell>
9667
+ <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Date</fo:block></fo:table-cell>
9668
+ <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Type</fo:block></fo:table-cell>
9669
+ <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Change</fo:block></fo:table-cell>
9670
+ <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Pages</fo:block></fo:table-cell>
9581
9671
  </fo:table-row>
9582
9672
  <xsl:apply-templates/>
9583
9673
  </fo:table-body>
@@ -9592,7 +9682,7 @@
9592
9682
 
9593
9683
  <xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']/*">
9594
9684
  <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
9595
- <fo:block><xsl:apply-templates/></fo:block>
9685
+ <fo:block role="SKIP"><xsl:apply-templates/></fo:block>
9596
9686
  </fo:table-cell>
9597
9687
  </xsl:template>
9598
9688
  <!-- ============ -->
@@ -9874,7 +9964,7 @@
9874
9964
  <xsl:for-each select="*[local-name() = 'tab']">
9875
9965
  <xsl:variable name="current_id" select="generate-id()"/>
9876
9966
  <fo:table-cell>
9877
- <fo:block line-height-shift-adjustment="disregard-shifts">
9967
+ <fo:block line-height-shift-adjustment="disregard-shifts" role="SKIP">
9878
9968
  <xsl:call-template name="insert_basic_link">
9879
9969
  <xsl:with-param name="element">
9880
9970
  <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
@@ -9892,7 +9982,7 @@
9892
9982
  </xsl:for-each>
9893
9983
  <!-- last column - for page numbers -->
9894
9984
  <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
9895
- <fo:block>
9985
+ <fo:block role="SKIP">
9896
9986
  <xsl:call-template name="insert_basic_link">
9897
9987
  <xsl:with-param name="element">
9898
9988
  <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
@@ -1724,6 +1724,10 @@
1724
1724
  </xsl:attribute-set> <!-- formula-stem-number-style -->
1725
1725
  <!-- End Formula's styles -->
1726
1726
 
1727
+ <xsl:template name="refine_formula-stem-number-style">
1728
+
1729
+ </xsl:template>
1730
+
1727
1731
  <xsl:attribute-set name="image-style">
1728
1732
  <xsl:attribute name="text-align">center</xsl:attribute>
1729
1733
 
@@ -2213,13 +2217,13 @@
2213
2217
 
2214
2218
  <xsl:template name="processPrefaceSectionsDefault_Contents">
2215
2219
  <xsl:variable name="nodes_preface_">
2216
- <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
2220
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition' or @type = 'toc')]">
2217
2221
  <node id="{@id}"/>
2218
2222
  </xsl:for-each>
2219
2223
  </xsl:variable>
2220
2224
  <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
2221
2225
 
2222
- <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
2226
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition' or @type = 'toc')]">
2223
2227
  <xsl:sort select="@displayorder" data-type="number"/>
2224
2228
 
2225
2229
  <!-- process Section's title -->
@@ -2253,12 +2257,12 @@
2253
2257
  <xsl:apply-templates select="." mode="contents"/>
2254
2258
  </xsl:for-each>
2255
2259
 
2256
- <xsl:for-each select="/*/*[local-name()='annex']">
2260
+ <!-- <xsl:for-each select="/*/*[local-name()='annex']">
2257
2261
  <xsl:sort select="@displayorder" data-type="number"/>
2258
2262
  <xsl:apply-templates select="." mode="contents"/>
2259
- </xsl:for-each>
2263
+ </xsl:for-each> -->
2260
2264
 
2261
- <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true') and not(*[local-name()='references'][@normative='true'])][count(.//*[local-name() = 'bibitem'][not(@hidden) = 'true']) &gt; 0] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]][count(.//*[local-name() = 'bibitem'][not(@hidden) = 'true']) &gt; 0]">
2265
+ <xsl:for-each select="/*/*[local-name()='annex'] | /*/*[local-name()='bibliography']/*[not(@normative='true') and not(*[local-name()='references'][@normative='true'])][count(.//*[local-name() = 'bibitem'][not(@hidden) = 'true']) &gt; 0] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]][count(.//*[local-name() = 'bibitem'][not(@hidden) = 'true']) &gt; 0]">
2262
2266
  <xsl:sort select="@displayorder" data-type="number"/>
2263
2267
  <xsl:apply-templates select="." mode="contents"/>
2264
2268
  </xsl:for-each>
@@ -2759,7 +2763,7 @@
2759
2763
  <xsl:param name="continued"/>
2760
2764
  <xsl:if test="normalize-space() != ''">
2761
2765
 
2762
- <fo:block xsl:use-attribute-sets="table-name-style">
2766
+ <fo:block xsl:use-attribute-sets="table-name-style" role="SKIP">
2763
2767
 
2764
2768
  <xsl:call-template name="refine_table-name-style">
2765
2769
  <xsl:with-param name="continued" select="$continued"/>
@@ -3144,8 +3148,8 @@
3144
3148
  <xsl:template name="table-header-title">
3145
3149
  <xsl:param name="cols-count"/>
3146
3150
  <!-- row for title -->
3147
- <fo:table-row>
3148
- <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">
3151
+ <fo:table-row role="SKIP">
3152
+ <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" role="SKIP">
3149
3153
 
3150
3154
  <xsl:call-template name="refine_table-header-title-style"/>
3151
3155
 
@@ -3154,7 +3158,7 @@
3154
3158
  </xsl:apply-templates>
3155
3159
 
3156
3160
  <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
3157
- <fo:block/>
3161
+ <fo:block role="SKIP"/>
3158
3162
  </xsl:if>
3159
3163
 
3160
3164
  </fo:table-cell>
@@ -3469,7 +3473,7 @@
3469
3473
 
3470
3474
  <xsl:call-template name="refine_table-header-cell-style"/>
3471
3475
 
3472
- <fo:block>
3476
+ <fo:block role="SKIP">
3473
3477
  <xsl:apply-templates/>
3474
3478
  </fo:block>
3475
3479
  </fo:table-cell>
@@ -3522,7 +3526,7 @@
3522
3526
  <xsl:attribute name="text-align">left</xsl:attribute>
3523
3527
  </xsl:if>
3524
3528
 
3525
- <fo:block>
3529
+ <fo:block role="SKIP">
3526
3530
 
3527
3531
  <xsl:if test="$isGenerateTableIF = 'true'">
3528
3532
  <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
@@ -4385,7 +4389,7 @@
4385
4389
  -->
4386
4390
  <fo:table-row>
4387
4391
  <fo:table-cell number-columns-spanned="2">
4388
- <fo:block>
4392
+ <fo:block role="SKIP">
4389
4393
  <xsl:call-template name="note"/>
4390
4394
  </fo:block>
4391
4395
  </fo:table-cell>
@@ -4450,7 +4454,7 @@
4450
4454
 
4451
4455
  <xsl:call-template name="refine_dt-cell-style"/>
4452
4456
 
4453
- <fo:block xsl:use-attribute-sets="dt-block-style">
4457
+ <fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
4454
4458
  <xsl:copy-of select="@id"/>
4455
4459
 
4456
4460
  <xsl:if test="normalize-space($key_iso) = 'true'">
@@ -4480,7 +4484,7 @@
4480
4484
 
4481
4485
  <xsl:call-template name="refine_dd-cell-style"/>
4482
4486
 
4483
- <fo:block>
4487
+ <fo:block role="SKIP">
4484
4488
 
4485
4489
  <xsl:if test="$isGenerateTableIF = 'true'">
4486
4490
  <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
@@ -4853,11 +4857,41 @@
4853
4857
 
4854
4858
  <xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
4855
4859
  <xsl:variable name="text" select="normalize-space(.)"/>
4856
- <fo:inline font-size="75%">
4860
+ <fo:inline font-size="75%" role="SKIP">
4857
4861
  <xsl:if test="string-length($text) &gt; 0">
4858
- <xsl:call-template name="recursiveSmallCaps">
4859
- <xsl:with-param name="text" select="$text"/>
4860
- </xsl:call-template>
4862
+ <xsl:variable name="smallCapsText">
4863
+ <xsl:call-template name="recursiveSmallCaps">
4864
+ <xsl:with-param name="text" select="$text"/>
4865
+ </xsl:call-template>
4866
+ </xsl:variable>
4867
+ <!-- merge neighboring fo:inline -->
4868
+ <xsl:for-each select="xalan:nodeset($smallCapsText)/node()">
4869
+ <xsl:choose>
4870
+ <xsl:when test="self::fo:inline and preceding-sibling::node()[1][self::fo:inline]"><!-- <xsl:copy-of select="."/> --></xsl:when>
4871
+ <xsl:when test="self::fo:inline and @font-size">
4872
+ <xsl:variable name="curr_pos" select="count(preceding-sibling::node()) + 1"/>
4873
+ <!-- <curr_pos><xsl:value-of select="$curr_pos"/></curr_pos> -->
4874
+ <xsl:variable name="next_text_" select="count(following-sibling::node()[not(local-name() = 'inline')][1]/preceding-sibling::node())"/>
4875
+ <xsl:variable name="next_text">
4876
+ <xsl:choose>
4877
+ <xsl:when test="$next_text_ = 0">99999999</xsl:when>
4878
+ <xsl:otherwise><xsl:value-of select="$next_text_ + 1"/></xsl:otherwise>
4879
+ </xsl:choose>
4880
+ </xsl:variable>
4881
+ <!-- <next_text><xsl:value-of select="$next_text"/></next_text> -->
4882
+ <fo:inline>
4883
+ <xsl:copy-of select="@*"/>
4884
+ <xsl:copy-of select="./node()"/>
4885
+ <xsl:for-each select="following-sibling::node()[position() &lt; $next_text - $curr_pos]"> <!-- [self::fo:inline] -->
4886
+ <xsl:copy-of select="./node()"/>
4887
+ </xsl:for-each>
4888
+ </fo:inline>
4889
+ </xsl:when>
4890
+ <xsl:otherwise>
4891
+ <xsl:copy-of select="."/>
4892
+ </xsl:otherwise>
4893
+ </xsl:choose>
4894
+ </xsl:for-each>
4861
4895
  </xsl:if>
4862
4896
  </fo:inline>
4863
4897
  </xsl:template>
@@ -4869,7 +4903,7 @@
4869
4903
  <xsl:variable name="upperCase" select="java:toUpperCase(java:java.lang.String.new($char))"/>
4870
4904
  <xsl:choose>
4871
4905
  <xsl:when test="$char=$upperCase">
4872
- <fo:inline font-size="{100 div 0.75}%">
4906
+ <fo:inline font-size="{100 div 0.75}%" role="SKIP">
4873
4907
  <xsl:value-of select="$upperCase"/>
4874
4908
  </fo:inline>
4875
4909
  </xsl:when>
@@ -5031,6 +5065,10 @@
5031
5065
 
5032
5066
  <xsl:when test="not(contains($text, $separator))">
5033
5067
  <word>
5068
+ <xsl:if test="ancestor::*[local-name() = 'p'][@from_dl = 'true']">
5069
+ <xsl:text>
5070
+  </xsl:text> <!-- to add distance between dt and dd -->
5071
+ </xsl:if>
5034
5072
  <xsl:call-template name="enclose_text_in_tags">
5035
5073
  <xsl:with-param name="text" select="normalize-space($text)"/>
5036
5074
  <xsl:with-param name="tags" select="$tags"/>
@@ -5039,6 +5077,10 @@
5039
5077
  </xsl:when>
5040
5078
  <xsl:otherwise>
5041
5079
  <word>
5080
+ <xsl:if test="ancestor::*[local-name() = 'p'][@from_dl = 'true']">
5081
+ <xsl:text>
5082
+  </xsl:text> <!-- to add distance between dt and dd -->
5083
+ </xsl:if>
5042
5084
  <xsl:call-template name="enclose_text_in_tags">
5043
5085
  <xsl:with-param name="text" select="normalize-space(substring-before($text, $separator))"/>
5044
5086
  <xsl:with-param name="tags" select="$tags"/>
@@ -5222,6 +5264,10 @@
5222
5264
  <xsl:template name="getSimpleTable">
5223
5265
  <xsl:param name="id"/>
5224
5266
 
5267
+ <!-- <test0>
5268
+ <xsl:copy-of select="."/>
5269
+ </test0> -->
5270
+
5225
5271
  <xsl:variable name="simple-table">
5226
5272
 
5227
5273
  <!-- Step 0. replace <br/> to <p>...</p> -->
@@ -6267,7 +6313,7 @@
6267
6313
  <fo:table-body>
6268
6314
  <fo:table-row>
6269
6315
  <fo:table-cell display-align="center">
6270
- <fo:block xsl:use-attribute-sets="formula-stem-block-style">
6316
+ <fo:block xsl:use-attribute-sets="formula-stem-block-style" role="SKIP">
6271
6317
 
6272
6318
  <xsl:call-template name="refine_formula-stem-block-style"/>
6273
6319
 
@@ -6275,7 +6321,10 @@
6275
6321
  </fo:block>
6276
6322
  </fo:table-cell>
6277
6323
  <fo:table-cell display-align="center">
6278
- <fo:block xsl:use-attribute-sets="formula-stem-number-style">
6324
+ <fo:block xsl:use-attribute-sets="formula-stem-number-style" role="SKIP">
6325
+
6326
+ <xsl:call-template name="refine_formula-stem-number-style"/>
6327
+
6279
6328
  <xsl:apply-templates select="../*[local-name() = 'name']"/>
6280
6329
  </fo:block>
6281
6330
  </fo:table-cell>
@@ -7797,7 +7846,7 @@
7797
7846
  <!-- second td with sourcecode -->
7798
7847
  <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
7799
7848
  <fo:table-cell>
7800
- <fo:block>
7849
+ <fo:block role="SKIP">
7801
7850
  <xsl:apply-templates/>
7802
7851
  </fo:block>
7803
7852
  </fo:table-cell>
@@ -8284,7 +8333,7 @@
8284
8333
 
8285
8334
  <xsl:call-template name="setTableCellAttributes"/>
8286
8335
 
8287
- <fo:block>
8336
+ <fo:block role="SKIP">
8288
8337
  <xsl:apply-templates/>
8289
8338
  </fo:block>
8290
8339
  </fo:table-cell>
@@ -8306,7 +8355,7 @@
8306
8355
 
8307
8356
  <xsl:call-template name="setTableCellAttributes"/>
8308
8357
 
8309
- <fo:block>
8358
+ <fo:block role="SKIP">
8310
8359
  <xsl:apply-templates/>
8311
8360
  </fo:block>
8312
8361
  </fo:table-cell>
@@ -9084,7 +9133,48 @@
9084
9133
  </xsl:choose>
9085
9134
  </xsl:when>
9086
9135
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
9087
- <xsl:value-of select="@label"/>
9136
+
9137
+ <xsl:variable name="label">
9138
+
9139
+ <xsl:variable name="type" select="../@type"/>
9140
+
9141
+ <xsl:variable name="style_prefix_">
9142
+ <xsl:if test="$type = 'roman'">
9143
+ <!-- Example: (i) -->
9144
+ </xsl:if>
9145
+ </xsl:variable>
9146
+ <xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
9147
+
9148
+ <xsl:variable name="style_suffix_">
9149
+ <xsl:choose>
9150
+ <xsl:when test="$type = 'arabic'">
9151
+ .
9152
+ </xsl:when>
9153
+ <xsl:when test="$type = 'alphabet' or $type = 'alphabetic'">
9154
+ )
9155
+ </xsl:when>
9156
+ <xsl:when test="$type = 'alphabet_upper' or $type = 'alphabetic_upper'">
9157
+ .
9158
+ </xsl:when>
9159
+ <xsl:when test="$type = 'roman'">
9160
+ )
9161
+ </xsl:when>
9162
+ <xsl:when test="$type = 'roman_upper'">.</xsl:when> <!-- Example: I. -->
9163
+ </xsl:choose>
9164
+ </xsl:variable>
9165
+ <xsl:variable name="style_suffix" select="normalize-space($style_suffix_)"/>
9166
+
9167
+ <xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
9168
+ <xsl:value-of select="$style_prefix"/>
9169
+ </xsl:if>
9170
+ <xsl:value-of select="@label"/>
9171
+ <xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
9172
+ <xsl:value-of select="$style_suffix"/>
9173
+ </xsl:if>
9174
+ </xsl:variable>
9175
+
9176
+ <xsl:value-of select="normalize-space($label)"/>
9177
+
9088
9178
  </xsl:when>
9089
9179
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
9090
9180
 
@@ -9281,7 +9371,7 @@
9281
9371
  <xsl:call-template name="refine_list-item-style"/>
9282
9372
 
9283
9373
  <fo:list-item-label end-indent="label-end()">
9284
- <fo:block xsl:use-attribute-sets="list-item-label-style">
9374
+ <fo:block xsl:use-attribute-sets="list-item-label-style" role="SKIP">
9285
9375
 
9286
9376
  <xsl:call-template name="refine_list-item-label-style"/>
9287
9377
 
@@ -9295,7 +9385,7 @@
9295
9385
  </fo:block>
9296
9386
  </fo:list-item-label>
9297
9387
  <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
9298
- <fo:block>
9388
+ <fo:block role="SKIP">
9299
9389
 
9300
9390
  <xsl:call-template name="refine_list-item-body-style"/>
9301
9391
 
@@ -9574,10 +9664,10 @@
9574
9664
  <fo:table-body>
9575
9665
  <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
9576
9666
 
9577
- <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
9578
- <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
9579
- <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
9580
- <fo:table-cell border="1pt solid black"><fo:block>Pages</fo:block></fo:table-cell>
9667
+ <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Date</fo:block></fo:table-cell>
9668
+ <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Type</fo:block></fo:table-cell>
9669
+ <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Change</fo:block></fo:table-cell>
9670
+ <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Pages</fo:block></fo:table-cell>
9581
9671
  </fo:table-row>
9582
9672
  <xsl:apply-templates/>
9583
9673
  </fo:table-body>
@@ -9592,7 +9682,7 @@
9592
9682
 
9593
9683
  <xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']/*">
9594
9684
  <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
9595
- <fo:block><xsl:apply-templates/></fo:block>
9685
+ <fo:block role="SKIP"><xsl:apply-templates/></fo:block>
9596
9686
  </fo:table-cell>
9597
9687
  </xsl:template>
9598
9688
  <!-- ============ -->
@@ -9874,7 +9964,7 @@
9874
9964
  <xsl:for-each select="*[local-name() = 'tab']">
9875
9965
  <xsl:variable name="current_id" select="generate-id()"/>
9876
9966
  <fo:table-cell>
9877
- <fo:block line-height-shift-adjustment="disregard-shifts">
9967
+ <fo:block line-height-shift-adjustment="disregard-shifts" role="SKIP">
9878
9968
  <xsl:call-template name="insert_basic_link">
9879
9969
  <xsl:with-param name="element">
9880
9970
  <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
@@ -9892,7 +9982,7 @@
9892
9982
  </xsl:for-each>
9893
9983
  <!-- last column - for page numbers -->
9894
9984
  <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
9895
- <fo:block>
9985
+ <fo:block role="SKIP">
9896
9986
  <xsl:call-template name="insert_basic_link">
9897
9987
  <xsl:with-param name="element">
9898
9988
  <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
@@ -1851,6 +1851,10 @@
1851
1851
  </xsl:attribute-set> <!-- formula-stem-number-style -->
1852
1852
  <!-- End Formula's styles -->
1853
1853
 
1854
+ <xsl:template name="refine_formula-stem-number-style">
1855
+
1856
+ </xsl:template>
1857
+
1854
1858
  <xsl:attribute-set name="image-style">
1855
1859
  <xsl:attribute name="text-align">center</xsl:attribute>
1856
1860
 
@@ -2346,13 +2350,13 @@
2346
2350
 
2347
2351
  <xsl:template name="processPrefaceSectionsDefault_Contents">
2348
2352
  <xsl:variable name="nodes_preface_">
2349
- <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
2353
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition' or @type = 'toc')]">
2350
2354
  <node id="{@id}"/>
2351
2355
  </xsl:for-each>
2352
2356
  </xsl:variable>
2353
2357
  <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
2354
2358
 
2355
- <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
2359
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition' or @type = 'toc')]">
2356
2360
  <xsl:sort select="@displayorder" data-type="number"/>
2357
2361
 
2358
2362
  <!-- process Section's title -->
@@ -2386,12 +2390,12 @@
2386
2390
  <xsl:apply-templates select="." mode="contents"/>
2387
2391
  </xsl:for-each>
2388
2392
 
2389
- <xsl:for-each select="/*/*[local-name()='annex']">
2393
+ <!-- <xsl:for-each select="/*/*[local-name()='annex']">
2390
2394
  <xsl:sort select="@displayorder" data-type="number"/>
2391
2395
  <xsl:apply-templates select="." mode="contents"/>
2392
- </xsl:for-each>
2396
+ </xsl:for-each> -->
2393
2397
 
2394
- <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true') and not(*[local-name()='references'][@normative='true'])][count(.//*[local-name() = 'bibitem'][not(@hidden) = 'true']) &gt; 0] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]][count(.//*[local-name() = 'bibitem'][not(@hidden) = 'true']) &gt; 0]">
2398
+ <xsl:for-each select="/*/*[local-name()='annex'] | /*/*[local-name()='bibliography']/*[not(@normative='true') and not(*[local-name()='references'][@normative='true'])][count(.//*[local-name() = 'bibitem'][not(@hidden) = 'true']) &gt; 0] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]][count(.//*[local-name() = 'bibitem'][not(@hidden) = 'true']) &gt; 0]">
2395
2399
  <xsl:sort select="@displayorder" data-type="number"/>
2396
2400
  <xsl:apply-templates select="." mode="contents"/>
2397
2401
  </xsl:for-each>
@@ -2892,7 +2896,7 @@
2892
2896
  <xsl:param name="continued"/>
2893
2897
  <xsl:if test="normalize-space() != ''">
2894
2898
 
2895
- <fo:block xsl:use-attribute-sets="table-name-style">
2899
+ <fo:block xsl:use-attribute-sets="table-name-style" role="SKIP">
2896
2900
 
2897
2901
  <xsl:call-template name="refine_table-name-style">
2898
2902
  <xsl:with-param name="continued" select="$continued"/>
@@ -3277,8 +3281,8 @@
3277
3281
  <xsl:template name="table-header-title">
3278
3282
  <xsl:param name="cols-count"/>
3279
3283
  <!-- row for title -->
3280
- <fo:table-row>
3281
- <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">
3284
+ <fo:table-row role="SKIP">
3285
+ <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" role="SKIP">
3282
3286
 
3283
3287
  <xsl:call-template name="refine_table-header-title-style"/>
3284
3288
 
@@ -3287,7 +3291,7 @@
3287
3291
  </xsl:apply-templates>
3288
3292
 
3289
3293
  <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
3290
- <fo:block/>
3294
+ <fo:block role="SKIP"/>
3291
3295
  </xsl:if>
3292
3296
 
3293
3297
  </fo:table-cell>
@@ -3598,7 +3602,7 @@
3598
3602
 
3599
3603
  <xsl:call-template name="refine_table-header-cell-style"/>
3600
3604
 
3601
- <fo:block>
3605
+ <fo:block role="SKIP">
3602
3606
  <xsl:apply-templates/>
3603
3607
  </fo:block>
3604
3608
  </fo:table-cell>
@@ -3651,7 +3655,7 @@
3651
3655
  <xsl:attribute name="text-align">left</xsl:attribute>
3652
3656
  </xsl:if>
3653
3657
 
3654
- <fo:block>
3658
+ <fo:block role="SKIP">
3655
3659
 
3656
3660
  <xsl:if test="$isGenerateTableIF = 'true'">
3657
3661
  <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
@@ -4514,7 +4518,7 @@
4514
4518
  -->
4515
4519
  <fo:table-row>
4516
4520
  <fo:table-cell number-columns-spanned="2">
4517
- <fo:block>
4521
+ <fo:block role="SKIP">
4518
4522
  <xsl:call-template name="note"/>
4519
4523
  </fo:block>
4520
4524
  </fo:table-cell>
@@ -4579,7 +4583,7 @@
4579
4583
 
4580
4584
  <xsl:call-template name="refine_dt-cell-style"/>
4581
4585
 
4582
- <fo:block xsl:use-attribute-sets="dt-block-style">
4586
+ <fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
4583
4587
  <xsl:copy-of select="@id"/>
4584
4588
 
4585
4589
  <xsl:if test="normalize-space($key_iso) = 'true'">
@@ -4609,7 +4613,7 @@
4609
4613
 
4610
4614
  <xsl:call-template name="refine_dd-cell-style"/>
4611
4615
 
4612
- <fo:block>
4616
+ <fo:block role="SKIP">
4613
4617
 
4614
4618
  <xsl:if test="$isGenerateTableIF = 'true'">
4615
4619
  <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
@@ -4982,11 +4986,41 @@
4982
4986
 
4983
4987
  <xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
4984
4988
  <xsl:variable name="text" select="normalize-space(.)"/>
4985
- <fo:inline font-size="75%">
4989
+ <fo:inline font-size="75%" role="SKIP">
4986
4990
  <xsl:if test="string-length($text) &gt; 0">
4987
- <xsl:call-template name="recursiveSmallCaps">
4988
- <xsl:with-param name="text" select="$text"/>
4989
- </xsl:call-template>
4991
+ <xsl:variable name="smallCapsText">
4992
+ <xsl:call-template name="recursiveSmallCaps">
4993
+ <xsl:with-param name="text" select="$text"/>
4994
+ </xsl:call-template>
4995
+ </xsl:variable>
4996
+ <!-- merge neighboring fo:inline -->
4997
+ <xsl:for-each select="xalan:nodeset($smallCapsText)/node()">
4998
+ <xsl:choose>
4999
+ <xsl:when test="self::fo:inline and preceding-sibling::node()[1][self::fo:inline]"><!-- <xsl:copy-of select="."/> --></xsl:when>
5000
+ <xsl:when test="self::fo:inline and @font-size">
5001
+ <xsl:variable name="curr_pos" select="count(preceding-sibling::node()) + 1"/>
5002
+ <!-- <curr_pos><xsl:value-of select="$curr_pos"/></curr_pos> -->
5003
+ <xsl:variable name="next_text_" select="count(following-sibling::node()[not(local-name() = 'inline')][1]/preceding-sibling::node())"/>
5004
+ <xsl:variable name="next_text">
5005
+ <xsl:choose>
5006
+ <xsl:when test="$next_text_ = 0">99999999</xsl:when>
5007
+ <xsl:otherwise><xsl:value-of select="$next_text_ + 1"/></xsl:otherwise>
5008
+ </xsl:choose>
5009
+ </xsl:variable>
5010
+ <!-- <next_text><xsl:value-of select="$next_text"/></next_text> -->
5011
+ <fo:inline>
5012
+ <xsl:copy-of select="@*"/>
5013
+ <xsl:copy-of select="./node()"/>
5014
+ <xsl:for-each select="following-sibling::node()[position() &lt; $next_text - $curr_pos]"> <!-- [self::fo:inline] -->
5015
+ <xsl:copy-of select="./node()"/>
5016
+ </xsl:for-each>
5017
+ </fo:inline>
5018
+ </xsl:when>
5019
+ <xsl:otherwise>
5020
+ <xsl:copy-of select="."/>
5021
+ </xsl:otherwise>
5022
+ </xsl:choose>
5023
+ </xsl:for-each>
4990
5024
  </xsl:if>
4991
5025
  </fo:inline>
4992
5026
  </xsl:template>
@@ -4998,7 +5032,7 @@
4998
5032
  <xsl:variable name="upperCase" select="java:toUpperCase(java:java.lang.String.new($char))"/>
4999
5033
  <xsl:choose>
5000
5034
  <xsl:when test="$char=$upperCase">
5001
- <fo:inline font-size="{100 div 0.75}%">
5035
+ <fo:inline font-size="{100 div 0.75}%" role="SKIP">
5002
5036
  <xsl:value-of select="$upperCase"/>
5003
5037
  </fo:inline>
5004
5038
  </xsl:when>
@@ -5160,6 +5194,10 @@
5160
5194
 
5161
5195
  <xsl:when test="not(contains($text, $separator))">
5162
5196
  <word>
5197
+ <xsl:if test="ancestor::*[local-name() = 'p'][@from_dl = 'true']">
5198
+ <xsl:text>
5199
+  </xsl:text> <!-- to add distance between dt and dd -->
5200
+ </xsl:if>
5163
5201
  <xsl:call-template name="enclose_text_in_tags">
5164
5202
  <xsl:with-param name="text" select="normalize-space($text)"/>
5165
5203
  <xsl:with-param name="tags" select="$tags"/>
@@ -5168,6 +5206,10 @@
5168
5206
  </xsl:when>
5169
5207
  <xsl:otherwise>
5170
5208
  <word>
5209
+ <xsl:if test="ancestor::*[local-name() = 'p'][@from_dl = 'true']">
5210
+ <xsl:text>
5211
+  </xsl:text> <!-- to add distance between dt and dd -->
5212
+ </xsl:if>
5171
5213
  <xsl:call-template name="enclose_text_in_tags">
5172
5214
  <xsl:with-param name="text" select="normalize-space(substring-before($text, $separator))"/>
5173
5215
  <xsl:with-param name="tags" select="$tags"/>
@@ -5351,6 +5393,10 @@
5351
5393
  <xsl:template name="getSimpleTable">
5352
5394
  <xsl:param name="id"/>
5353
5395
 
5396
+ <!-- <test0>
5397
+ <xsl:copy-of select="."/>
5398
+ </test0> -->
5399
+
5354
5400
  <xsl:variable name="simple-table">
5355
5401
 
5356
5402
  <!-- Step 0. replace <br/> to <p>...</p> -->
@@ -6396,7 +6442,7 @@
6396
6442
  <fo:table-body>
6397
6443
  <fo:table-row>
6398
6444
  <fo:table-cell display-align="center">
6399
- <fo:block xsl:use-attribute-sets="formula-stem-block-style">
6445
+ <fo:block xsl:use-attribute-sets="formula-stem-block-style" role="SKIP">
6400
6446
 
6401
6447
  <xsl:call-template name="refine_formula-stem-block-style"/>
6402
6448
 
@@ -6404,7 +6450,10 @@
6404
6450
  </fo:block>
6405
6451
  </fo:table-cell>
6406
6452
  <fo:table-cell display-align="center">
6407
- <fo:block xsl:use-attribute-sets="formula-stem-number-style">
6453
+ <fo:block xsl:use-attribute-sets="formula-stem-number-style" role="SKIP">
6454
+
6455
+ <xsl:call-template name="refine_formula-stem-number-style"/>
6456
+
6408
6457
  <xsl:apply-templates select="../*[local-name() = 'name']"/>
6409
6458
  </fo:block>
6410
6459
  </fo:table-cell>
@@ -7926,7 +7975,7 @@
7926
7975
  <!-- second td with sourcecode -->
7927
7976
  <xsl:template match="*[local-name() = 'sourcecode'][@linenums = 'true']/*[local-name()='table']//*[local-name()='tr']/*[local-name()='td'][preceding-sibling::*]" priority="2"> <!-- *[local-name()='table'][@type = 'sourcecode'] -->
7928
7977
  <fo:table-cell>
7929
- <fo:block>
7978
+ <fo:block role="SKIP">
7930
7979
  <xsl:apply-templates/>
7931
7980
  </fo:block>
7932
7981
  </fo:table-cell>
@@ -8413,7 +8462,7 @@
8413
8462
 
8414
8463
  <xsl:call-template name="setTableCellAttributes"/>
8415
8464
 
8416
- <fo:block>
8465
+ <fo:block role="SKIP">
8417
8466
  <xsl:apply-templates/>
8418
8467
  </fo:block>
8419
8468
  </fo:table-cell>
@@ -8435,7 +8484,7 @@
8435
8484
 
8436
8485
  <xsl:call-template name="setTableCellAttributes"/>
8437
8486
 
8438
- <fo:block>
8487
+ <fo:block role="SKIP">
8439
8488
  <xsl:apply-templates/>
8440
8489
  </fo:block>
8441
8490
  </fo:table-cell>
@@ -9213,7 +9262,48 @@
9213
9262
  </xsl:choose>
9214
9263
  </xsl:when>
9215
9264
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
9216
- <xsl:value-of select="@label"/>
9265
+
9266
+ <xsl:variable name="label">
9267
+
9268
+ <xsl:variable name="type" select="../@type"/>
9269
+
9270
+ <xsl:variable name="style_prefix_">
9271
+ <xsl:if test="$type = 'roman'">
9272
+ <!-- Example: (i) -->
9273
+ </xsl:if>
9274
+ </xsl:variable>
9275
+ <xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
9276
+
9277
+ <xsl:variable name="style_suffix_">
9278
+ <xsl:choose>
9279
+ <xsl:when test="$type = 'arabic'">
9280
+ )
9281
+ </xsl:when>
9282
+ <xsl:when test="$type = 'alphabet' or $type = 'alphabetic'">
9283
+ )
9284
+ </xsl:when>
9285
+ <xsl:when test="$type = 'alphabet_upper' or $type = 'alphabetic_upper'">
9286
+ .
9287
+ </xsl:when>
9288
+ <xsl:when test="$type = 'roman'">
9289
+ )
9290
+ </xsl:when>
9291
+ <xsl:when test="$type = 'roman_upper'">.</xsl:when> <!-- Example: I. -->
9292
+ </xsl:choose>
9293
+ </xsl:variable>
9294
+ <xsl:variable name="style_suffix" select="normalize-space($style_suffix_)"/>
9295
+
9296
+ <xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
9297
+ <xsl:value-of select="$style_prefix"/>
9298
+ </xsl:if>
9299
+ <xsl:value-of select="@label"/>
9300
+ <xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
9301
+ <xsl:value-of select="$style_suffix"/>
9302
+ </xsl:if>
9303
+ </xsl:variable>
9304
+
9305
+ <xsl:value-of select="normalize-space($label)"/>
9306
+
9217
9307
  </xsl:when>
9218
9308
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
9219
9309
 
@@ -9410,7 +9500,7 @@
9410
9500
  <xsl:call-template name="refine_list-item-style"/>
9411
9501
 
9412
9502
  <fo:list-item-label end-indent="label-end()">
9413
- <fo:block xsl:use-attribute-sets="list-item-label-style">
9503
+ <fo:block xsl:use-attribute-sets="list-item-label-style" role="SKIP">
9414
9504
 
9415
9505
  <xsl:call-template name="refine_list-item-label-style"/>
9416
9506
 
@@ -9424,7 +9514,7 @@
9424
9514
  </fo:block>
9425
9515
  </fo:list-item-label>
9426
9516
  <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
9427
- <fo:block>
9517
+ <fo:block role="SKIP">
9428
9518
 
9429
9519
  <xsl:call-template name="refine_list-item-body-style"/>
9430
9520
 
@@ -9703,10 +9793,10 @@
9703
9793
  <fo:table-body>
9704
9794
  <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
9705
9795
 
9706
- <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
9707
- <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
9708
- <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
9709
- <fo:table-cell border="1pt solid black"><fo:block>Pages</fo:block></fo:table-cell>
9796
+ <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Date</fo:block></fo:table-cell>
9797
+ <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Type</fo:block></fo:table-cell>
9798
+ <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Change</fo:block></fo:table-cell>
9799
+ <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Pages</fo:block></fo:table-cell>
9710
9800
  </fo:table-row>
9711
9801
  <xsl:apply-templates/>
9712
9802
  </fo:table-body>
@@ -9721,7 +9811,7 @@
9721
9811
 
9722
9812
  <xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']/*">
9723
9813
  <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
9724
- <fo:block><xsl:apply-templates/></fo:block>
9814
+ <fo:block role="SKIP"><xsl:apply-templates/></fo:block>
9725
9815
  </fo:table-cell>
9726
9816
  </xsl:template>
9727
9817
  <!-- ============ -->
@@ -10003,7 +10093,7 @@
10003
10093
  <xsl:for-each select="*[local-name() = 'tab']">
10004
10094
  <xsl:variable name="current_id" select="generate-id()"/>
10005
10095
  <fo:table-cell>
10006
- <fo:block line-height-shift-adjustment="disregard-shifts">
10096
+ <fo:block line-height-shift-adjustment="disregard-shifts" role="SKIP">
10007
10097
  <xsl:call-template name="insert_basic_link">
10008
10098
  <xsl:with-param name="element">
10009
10099
  <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
@@ -10021,7 +10111,7 @@
10021
10111
  </xsl:for-each>
10022
10112
  <!-- last column - for page numbers -->
10023
10113
  <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
10024
- <fo:block>
10114
+ <fo:block role="SKIP">
10025
10115
  <xsl:call-template name="insert_basic_link">
10026
10116
  <xsl:with-param name="element">
10027
10117
  <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
@@ -0,0 +1,56 @@
1
+ == copyright-statement
2
+ === {blank}
3
+
4
+ [[boilerplate-ECEhdr]]
5
+ ECE/TRADE/437
6
+
7
+ Copyright © United Nations {{ docyear }} +
8
+ All rights reserved worldwide +
9
+ United Nations publication issued by the Economic Commission for Europe
10
+
11
+ == license-statement
12
+ === {blank}
13
+ None of the materials provided on this web site may be used,
14
+ reproduced or transmitted, in whole or in part, in any form or by any
15
+ means, electronic or mechanical, including photocopying, recording or
16
+ the use of any information storage and retrieval system, except as
17
+ provided for in the Terms and Conditions of Use of United Nations Web
18
+ Sites, without permission in writing from the publisher.
19
+
20
+ News-related material can be used as long as the appropriate credit is given and the United Nations is advised.
21
+
22
+ To request such permission or for further enquires, please visit:
23
+ https://shop.un.org/rights-permissions[United Nations Publications: Rights and Permissions.]
24
+
25
+ == legal-statement
26
+ === {blank}
27
+ ==== Note
28
+ The designations employed and the presentation of the material in this publication do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations concerning the legal status of any country, territory, city or area, or of its authorities, or concerning the delimitation of its frontiers or boundaries.
29
+
30
+ {% if tc == "United Nations Centre for Trade Facilitation and Electronic Business (UN/CEFACT)" %}
31
+ ==== <title>{{tc}}pass:[<br/>]Simple, Transparent and Effective Processes for Global Commerce
32
+
33
+ UN/CEFACT's mission is to improve the ability of business, trade and administrative organizations, from developed, developing and transitional economies, to exchange products and relevant services effectively. Its principal focus is on facilitating national and international transactions, through the simplification and harmonization of processes, procedures and information flows, and so contribute to the growth of global commerce.
34
+
35
+ Participation in UN/CEFACT is open to experts from United Nations Member States, Intergovernmental Organizations and Non-Governmental Organizations recognised by the United Nations Economic and Social Council (ECOSOC). Through this participation of government and business representatives from around the world, UN/CEFACT has developed a range of trade facilitation and e-business standards, recommendations and tools that are approved within a broad intergovernmental process and implemented globally.
36
+
37
+ [align="center"]
38
+ *www.unece.org/cefact*
39
+ {% endif %}
40
+
41
+ == feedback-statement
42
+ [[boilerplate-feedback-name]]
43
+ {% if subdivision %}{{subdivision}}{% else %}UN Economic Commission for Europe: Information Service{% endif %}
44
+
45
+ [[boilerplate-feedback-address]]
46
+ {% if pub_address %}{{ pub_address }}{% else %}
47
+ Palais des Nations +
48
+ CH-1211 Geneva 10 +
49
+ Switzerland{% endif %} +
50
+ +
51
+ +++<link target="tel:{% if pub_phone %}{{ pub_phone }}{% else %}+41(0)229171234{% endif %}">{% if pub_phone %}{{ pub_phone }}{% else %}+41 (0) 22 917 12 34 (switchboard){% endif %}</link>+++ +
52
+ {% if pub_fax %}+++<link target="tel:{{pub_fax}}">{{pub_fax}}+++ +{% endif %}
53
+ +++<link target="mailto:{% if pub_email %}{{ pub_email }}{% else %}unece_info@un.org{% endif %}">{% if pub_email %}{{ pub_email }}{% else %}unece_info@un.org{% endif %}+++ +
54
+ +++<link target="{% if pub_uri %}{{pub_uri}}{% else %}https://www.unece.org/{% endif %}">{% if pub_uri %}{{pub_uri}}{% else %}www.unece.org/{% endif %}</link>+++
55
+
56
+
@@ -15,6 +15,10 @@ module Metanorma
15
15
  "United Nations"
16
16
  end
17
17
 
18
+ def boilerplate_file(_xmldoc)
19
+ File.join(@libdir, "boilerplate.adoc")
20
+ end
21
+
18
22
  def metadata_committee(node, xml)
19
23
  return unless node.attr("committee")
20
24
 
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module UN
3
- VERSION = "0.10.10".freeze
3
+ VERSION = "0.10.11".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-un
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.10.10
4
+ version: 0.10.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2023-06-05 00:00:00.000000000 Z
11
+ date: 2023-06-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: iso-639
@@ -258,7 +258,7 @@ files:
258
258
  - lib/metanorma/un/basicdoc.rng
259
259
  - lib/metanorma/un/biblio-standoc.rng
260
260
  - lib/metanorma/un/biblio.rng
261
- - lib/metanorma/un/boilerplate.xml
261
+ - lib/metanorma/un/boilerplate.adoc
262
262
  - lib/metanorma/un/converter.rb
263
263
  - lib/metanorma/un/input.rb
264
264
  - lib/metanorma/un/isodoc.rng
@@ -1,59 +0,0 @@
1
- <boilerplate>
2
- <copyright-statement>
3
- <clause>
4
- <p id="boilerplate-ECEhdr">ECE/TRADE/437</p>
5
- <p>Copyright © United Nations {{ docyear }}<br/>
6
- All rights reserved worldwide<br/>
7
- United Nations publication issued by the Economic Commission for Europe</p>
8
- </clause>
9
- </copyright-statement>
10
- <license-statement>
11
- <clause>
12
- <p>None of the materials provided on this web site may be used,
13
- reproduced or transmitted, in whole or in part, in any form or by any
14
- means, electronic or mechanical, including photocopying, recording or
15
- the use of any information storage and retrieval system, except as
16
- provided for in the Terms and Conditions of Use of United Nations Web
17
- Sites, without permission in writing from the publisher.</p>
18
-
19
- <p>News-related material can be used as long as the appropriate credit is given and the United Nations is advised.</p>
20
- <p>To request such permission or for further enquires, please visit:
21
- <link target="https://shop.un.org/rights-permissions">United Nations Publications: Rights and Permissions.</link></p>
22
- </clause>
23
- </license-statement>
24
- <legal-statement>
25
- <clause>
26
- <clause>
27
- <title>Note</title>
28
- <p>The designations employed and the presentation of the material in this publication do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations concerning the legal status of any country, territory, city or area, or of its authorities, or concerning the delimitation of its frontiers or boundaries.</p>
29
- </clause>
30
-
31
- {% if tc == "United Nations Centre for Trade Facilitation and Electronic Business (UN/CEFACT)" %}
32
- <clause>
33
- <title>{{tc}}<br/>Simple, Transparent and Effective Processes for Global Commerce</title>
34
- <p>UN/CEFACT's mission is to improve the ability of business, trade and administrative organizations, from developed, developing and transitional economies, to exchange products and relevant services effectively. Its principal focus is on facilitating national and international transactions, through the simplification and harmonization of processes, procedures and information flows, and so contribute to the growth of global commerce.</p>
35
- <p>Participation in UN/CEFACT is open to experts from United Nations Member States, Intergovernmental Organizations and Non-Governmental Organizations recognised by the United Nations Economic and Social Council (ECOSOC). Through this participation of government and business representatives from around the world, UN/CEFACT has developed a range of trade facilitation and e-business standards, recommendations and tools that are approved within a broad intergovernmental process and implemented globally.</p>
36
- <p align="center"><strong>www.unece.org/cefact</strong></p>
37
- </clause>
38
- {% endif %}
39
- </clause>
40
- </legal-statement>
41
- <feedback-statement>
42
- <clause>
43
- <p id="boilerplate-feedback-name">{% if subdivision %}{{subdivision}}{% else %}UN Economic Commission for Europe: Information Service{% endif %}</p>
44
- <p id="boilerplate-feedback-address">
45
- {% if pub_address %}{{ pub_address }}{% else %}
46
- Palais des Nations<br />
47
- CH-1211 Geneva 10<br />
48
- Switzerland{% endif %}<br />
49
- <br />
50
- <link target="tel:{% if pub_phone %}{{ pub_phone }}{% else %}+41(0)229171234{% endif %}">{% if pub_phone %}{{ pub_phone }}{% else %}+41 (0) 22 917 12 34 (switchboard){% endif %}</link><br />
51
- {% if pub_fax %}<link target="tel:{{pub_fax}}">{{pub_fax}}</link><br/>{% endif %}
52
- <link target="mailto:{% if pub_email %}{{ pub_email }}{% else %}unece_info@un.org{% endif %}">{% if pub_email %}{{ pub_email }}{% else %}unece_info@un.org{% endif %}</link><br />
53
- <link target="{% if pub_uri %}{{pub_uri}}{% else %}https://www.unece.org/{% endif %}">{% if pub_uri %}{{pub_uri}}{% else %}www.unece.org/{% endif %}</link>
54
- </p>
55
- </clause>
56
- </feedback-statement>
57
- </boilerplate>
58
-
59
-