metanorma-ogc 2.3.11 → 2.3.12

Sign up to get free protection for your applications and to get access to all the features.
@@ -2591,6 +2591,10 @@
2591
2591
  </xsl:attribute-set> <!-- formula-stem-number-style -->
2592
2592
  <!-- End Formula's styles -->
2593
2593
 
2594
+ <xsl:template name="refine_formula-stem-number-style">
2595
+
2596
+ </xsl:template>
2597
+
2594
2598
  <xsl:attribute-set name="image-style">
2595
2599
  <xsl:attribute name="text-align">center</xsl:attribute>
2596
2600
 
@@ -3104,13 +3108,13 @@
3104
3108
 
3105
3109
  <xsl:template name="processPrefaceSectionsDefault_Contents">
3106
3110
  <xsl:variable name="nodes_preface_">
3107
- <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
3111
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition' or @type = 'toc')]">
3108
3112
  <node id="{@id}"/>
3109
3113
  </xsl:for-each>
3110
3114
  </xsl:variable>
3111
3115
  <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
3112
3116
 
3113
- <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
3117
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition' or @type = 'toc')]">
3114
3118
  <xsl:sort select="@displayorder" data-type="number"/>
3115
3119
 
3116
3120
  <!-- process Section's title -->
@@ -3144,12 +3148,12 @@
3144
3148
  <xsl:apply-templates select="." mode="contents"/>
3145
3149
  </xsl:for-each>
3146
3150
 
3147
- <xsl:for-each select="/*/*[local-name()='annex']">
3151
+ <!-- <xsl:for-each select="/*/*[local-name()='annex']">
3148
3152
  <xsl:sort select="@displayorder" data-type="number"/>
3149
3153
  <xsl:apply-templates select="." mode="contents"/>
3150
- </xsl:for-each>
3154
+ </xsl:for-each> -->
3151
3155
 
3152
- <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]">
3156
+ <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]">
3153
3157
  <xsl:sort select="@displayorder" data-type="number"/>
3154
3158
  <xsl:apply-templates select="." mode="contents"/>
3155
3159
  </xsl:for-each>
@@ -3663,7 +3667,7 @@
3663
3667
  <xsl:param name="continued"/>
3664
3668
  <xsl:if test="normalize-space() != ''">
3665
3669
 
3666
- <fo:block xsl:use-attribute-sets="table-name-style">
3670
+ <fo:block xsl:use-attribute-sets="table-name-style" role="SKIP">
3667
3671
 
3668
3672
  <xsl:call-template name="refine_table-name-style">
3669
3673
  <xsl:with-param name="continued" select="$continued"/>
@@ -4048,8 +4052,8 @@
4048
4052
  <xsl:template name="table-header-title">
4049
4053
  <xsl:param name="cols-count"/>
4050
4054
  <!-- row for title -->
4051
- <fo:table-row>
4052
- <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">
4055
+ <fo:table-row role="SKIP">
4056
+ <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">
4053
4057
 
4054
4058
  <xsl:call-template name="refine_table-header-title-style"/>
4055
4059
 
@@ -4058,7 +4062,7 @@
4058
4062
  </xsl:apply-templates>
4059
4063
 
4060
4064
  <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
4061
- <fo:block/>
4065
+ <fo:block role="SKIP"/>
4062
4066
  </xsl:if>
4063
4067
 
4064
4068
  </fo:table-cell>
@@ -4369,7 +4373,7 @@
4369
4373
 
4370
4374
  <xsl:call-template name="refine_table-header-cell-style"/>
4371
4375
 
4372
- <fo:block>
4376
+ <fo:block role="SKIP">
4373
4377
  <xsl:apply-templates/>
4374
4378
  </fo:block>
4375
4379
  </fo:table-cell>
@@ -4422,7 +4426,7 @@
4422
4426
  <xsl:attribute name="text-align">left</xsl:attribute>
4423
4427
  </xsl:if>
4424
4428
 
4425
- <fo:block>
4429
+ <fo:block role="SKIP">
4426
4430
 
4427
4431
  <xsl:if test="$isGenerateTableIF = 'true'">
4428
4432
  <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
@@ -5296,7 +5300,7 @@
5296
5300
  -->
5297
5301
  <fo:table-row>
5298
5302
  <fo:table-cell number-columns-spanned="2">
5299
- <fo:block>
5303
+ <fo:block role="SKIP">
5300
5304
  <xsl:call-template name="note"/>
5301
5305
  </fo:block>
5302
5306
  </fo:table-cell>
@@ -5368,7 +5372,7 @@
5368
5372
 
5369
5373
  <xsl:call-template name="refine_dt-cell-style"/>
5370
5374
 
5371
- <fo:block xsl:use-attribute-sets="dt-block-style">
5375
+ <fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
5372
5376
  <xsl:copy-of select="@id"/>
5373
5377
 
5374
5378
  <xsl:if test="normalize-space($key_iso) = 'true'">
@@ -5398,7 +5402,7 @@
5398
5402
 
5399
5403
  <xsl:call-template name="refine_dd-cell-style"/>
5400
5404
 
5401
- <fo:block>
5405
+ <fo:block role="SKIP">
5402
5406
 
5403
5407
  <xsl:if test="$isGenerateTableIF = 'true'">
5404
5408
  <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
@@ -5540,10 +5544,15 @@
5540
5544
  <!-- ========================= -->
5541
5545
  <xsl:template match="*[local-name()='em']">
5542
5546
  <fo:inline font-style="italic">
5547
+ <xsl:call-template name="refine_italic_style"/>
5543
5548
  <xsl:apply-templates/>
5544
5549
  </fo:inline>
5545
5550
  </xsl:template>
5546
5551
 
5552
+ <xsl:template name="refine_italic_style">
5553
+
5554
+ </xsl:template>
5555
+
5547
5556
  <xsl:template match="*[local-name()='strong'] | *[local-name()='b']">
5548
5557
  <xsl:param name="split_keep-within-line"/>
5549
5558
  <fo:inline font-weight="bold">
@@ -5771,11 +5780,41 @@
5771
5780
 
5772
5781
  <xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
5773
5782
  <xsl:variable name="text" select="normalize-space(.)"/>
5774
- <fo:inline font-size="75%">
5783
+ <fo:inline font-size="75%" role="SKIP">
5775
5784
  <xsl:if test="string-length($text) &gt; 0">
5776
- <xsl:call-template name="recursiveSmallCaps">
5777
- <xsl:with-param name="text" select="$text"/>
5778
- </xsl:call-template>
5785
+ <xsl:variable name="smallCapsText">
5786
+ <xsl:call-template name="recursiveSmallCaps">
5787
+ <xsl:with-param name="text" select="$text"/>
5788
+ </xsl:call-template>
5789
+ </xsl:variable>
5790
+ <!-- merge neighboring fo:inline -->
5791
+ <xsl:for-each select="xalan:nodeset($smallCapsText)/node()">
5792
+ <xsl:choose>
5793
+ <xsl:when test="self::fo:inline and preceding-sibling::node()[1][self::fo:inline]"><!-- <xsl:copy-of select="."/> --></xsl:when>
5794
+ <xsl:when test="self::fo:inline and @font-size">
5795
+ <xsl:variable name="curr_pos" select="count(preceding-sibling::node()) + 1"/>
5796
+ <!-- <curr_pos><xsl:value-of select="$curr_pos"/></curr_pos> -->
5797
+ <xsl:variable name="next_text_" select="count(following-sibling::node()[not(local-name() = 'inline')][1]/preceding-sibling::node())"/>
5798
+ <xsl:variable name="next_text">
5799
+ <xsl:choose>
5800
+ <xsl:when test="$next_text_ = 0">99999999</xsl:when>
5801
+ <xsl:otherwise><xsl:value-of select="$next_text_ + 1"/></xsl:otherwise>
5802
+ </xsl:choose>
5803
+ </xsl:variable>
5804
+ <!-- <next_text><xsl:value-of select="$next_text"/></next_text> -->
5805
+ <fo:inline>
5806
+ <xsl:copy-of select="@*"/>
5807
+ <xsl:copy-of select="./node()"/>
5808
+ <xsl:for-each select="following-sibling::node()[position() &lt; $next_text - $curr_pos]"> <!-- [self::fo:inline] -->
5809
+ <xsl:copy-of select="./node()"/>
5810
+ </xsl:for-each>
5811
+ </fo:inline>
5812
+ </xsl:when>
5813
+ <xsl:otherwise>
5814
+ <xsl:copy-of select="."/>
5815
+ </xsl:otherwise>
5816
+ </xsl:choose>
5817
+ </xsl:for-each>
5779
5818
  </xsl:if>
5780
5819
  </fo:inline>
5781
5820
  </xsl:template>
@@ -5787,7 +5826,7 @@
5787
5826
  <xsl:variable name="upperCase" select="java:toUpperCase(java:java.lang.String.new($char))"/>
5788
5827
  <xsl:choose>
5789
5828
  <xsl:when test="$char=$upperCase">
5790
- <fo:inline font-size="{100 div 0.75}%">
5829
+ <fo:inline font-size="{100 div 0.75}%" role="SKIP">
5791
5830
  <xsl:value-of select="$upperCase"/>
5792
5831
  </fo:inline>
5793
5832
  </xsl:when>
@@ -5949,6 +5988,10 @@
5949
5988
 
5950
5989
  <xsl:when test="not(contains($text, $separator))">
5951
5990
  <word>
5991
+ <xsl:if test="ancestor::*[local-name() = 'p'][@from_dl = 'true']">
5992
+ <xsl:text>
5993
+  </xsl:text> <!-- to add distance between dt and dd -->
5994
+ </xsl:if>
5952
5995
  <xsl:call-template name="enclose_text_in_tags">
5953
5996
  <xsl:with-param name="text" select="normalize-space($text)"/>
5954
5997
  <xsl:with-param name="tags" select="$tags"/>
@@ -5957,6 +6000,10 @@
5957
6000
  </xsl:when>
5958
6001
  <xsl:otherwise>
5959
6002
  <word>
6003
+ <xsl:if test="ancestor::*[local-name() = 'p'][@from_dl = 'true']">
6004
+ <xsl:text>
6005
+  </xsl:text> <!-- to add distance between dt and dd -->
6006
+ </xsl:if>
5960
6007
  <xsl:call-template name="enclose_text_in_tags">
5961
6008
  <xsl:with-param name="text" select="normalize-space(substring-before($text, $separator))"/>
5962
6009
  <xsl:with-param name="tags" select="$tags"/>
@@ -6140,6 +6187,10 @@
6140
6187
  <xsl:template name="getSimpleTable">
6141
6188
  <xsl:param name="id"/>
6142
6189
 
6190
+ <!-- <test0>
6191
+ <xsl:copy-of select="."/>
6192
+ </test0> -->
6193
+
6143
6194
  <xsl:variable name="simple-table">
6144
6195
 
6145
6196
  <!-- Step 0. replace <br/> to <p>...</p> -->
@@ -7189,7 +7240,7 @@
7189
7240
  <fo:table-body>
7190
7241
  <fo:table-row>
7191
7242
  <fo:table-cell display-align="center">
7192
- <fo:block xsl:use-attribute-sets="formula-stem-block-style">
7243
+ <fo:block xsl:use-attribute-sets="formula-stem-block-style" role="SKIP">
7193
7244
 
7194
7245
  <xsl:call-template name="refine_formula-stem-block-style"/>
7195
7246
 
@@ -7197,7 +7248,10 @@
7197
7248
  </fo:block>
7198
7249
  </fo:table-cell>
7199
7250
  <fo:table-cell display-align="center">
7200
- <fo:block xsl:use-attribute-sets="formula-stem-number-style">
7251
+ <fo:block xsl:use-attribute-sets="formula-stem-number-style" role="SKIP">
7252
+
7253
+ <xsl:call-template name="refine_formula-stem-number-style"/>
7254
+
7201
7255
  <xsl:apply-templates select="../*[local-name() = 'name']"/>
7202
7256
  </fo:block>
7203
7257
  </fo:table-cell>
@@ -8740,7 +8794,7 @@
8740
8794
  <!-- second td with sourcecode -->
8741
8795
  <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'] -->
8742
8796
  <fo:table-cell>
8743
- <fo:block>
8797
+ <fo:block role="SKIP">
8744
8798
  <xsl:apply-templates/>
8745
8799
  </fo:block>
8746
8800
  </fo:table-cell>
@@ -9246,7 +9300,7 @@
9246
9300
 
9247
9301
  <xsl:call-template name="setTableCellAttributes"/>
9248
9302
 
9249
- <fo:block>
9303
+ <fo:block role="SKIP">
9250
9304
  <xsl:apply-templates/>
9251
9305
  </fo:block>
9252
9306
  </fo:table-cell>
@@ -9268,7 +9322,7 @@
9268
9322
 
9269
9323
  <xsl:call-template name="setTableCellAttributes"/>
9270
9324
 
9271
- <fo:block>
9325
+ <fo:block role="SKIP">
9272
9326
  <xsl:apply-templates/>
9273
9327
  </fo:block>
9274
9328
  </fo:table-cell>
@@ -10043,7 +10097,48 @@
10043
10097
  </xsl:choose>
10044
10098
  </xsl:when>
10045
10099
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
10046
- <xsl:value-of select="@label"/>
10100
+
10101
+ <xsl:variable name="label">
10102
+
10103
+ <xsl:variable name="type" select="../@type"/>
10104
+
10105
+ <xsl:variable name="style_prefix_">
10106
+ <xsl:if test="$type = 'roman'">
10107
+ <!-- Example: (i) -->
10108
+ </xsl:if>
10109
+ </xsl:variable>
10110
+ <xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
10111
+
10112
+ <xsl:variable name="style_suffix_">
10113
+ <xsl:choose>
10114
+ <xsl:when test="$type = 'arabic'">
10115
+ .
10116
+ </xsl:when>
10117
+ <xsl:when test="$type = 'alphabet' or $type = 'alphabetic'">
10118
+ )
10119
+ </xsl:when>
10120
+ <xsl:when test="$type = 'alphabet_upper' or $type = 'alphabetic_upper'">
10121
+ )
10122
+ </xsl:when>
10123
+ <xsl:when test="$type = 'roman'">
10124
+ )
10125
+ </xsl:when>
10126
+ <xsl:when test="$type = 'roman_upper'">.</xsl:when> <!-- Example: I. -->
10127
+ </xsl:choose>
10128
+ </xsl:variable>
10129
+ <xsl:variable name="style_suffix" select="normalize-space($style_suffix_)"/>
10130
+
10131
+ <xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
10132
+ <xsl:value-of select="$style_prefix"/>
10133
+ </xsl:if>
10134
+ <xsl:value-of select="@label"/>
10135
+ <xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
10136
+ <xsl:value-of select="$style_suffix"/>
10137
+ </xsl:if>
10138
+ </xsl:variable>
10139
+
10140
+ <xsl:value-of select="normalize-space($label)"/>
10141
+
10047
10142
  </xsl:when>
10048
10143
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
10049
10144
 
@@ -10236,7 +10331,7 @@
10236
10331
  <xsl:call-template name="refine_list-item-style"/>
10237
10332
 
10238
10333
  <fo:list-item-label end-indent="label-end()">
10239
- <fo:block xsl:use-attribute-sets="list-item-label-style">
10334
+ <fo:block xsl:use-attribute-sets="list-item-label-style" role="SKIP">
10240
10335
 
10241
10336
  <xsl:call-template name="refine_list-item-label-style"/>
10242
10337
 
@@ -10250,7 +10345,7 @@
10250
10345
  </fo:block>
10251
10346
  </fo:list-item-label>
10252
10347
  <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
10253
- <fo:block>
10348
+ <fo:block role="SKIP">
10254
10349
 
10255
10350
  <xsl:call-template name="refine_list-item-body-style"/>
10256
10351
 
@@ -10529,10 +10624,10 @@
10529
10624
  <fo:table-body>
10530
10625
  <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
10531
10626
 
10532
- <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
10533
- <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
10534
- <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
10535
- <fo:table-cell border="1pt solid black"><fo:block>Pages</fo:block></fo:table-cell>
10627
+ <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Date</fo:block></fo:table-cell>
10628
+ <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Type</fo:block></fo:table-cell>
10629
+ <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Change</fo:block></fo:table-cell>
10630
+ <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Pages</fo:block></fo:table-cell>
10536
10631
  </fo:table-row>
10537
10632
  <xsl:apply-templates/>
10538
10633
  </fo:table-body>
@@ -10547,7 +10642,7 @@
10547
10642
 
10548
10643
  <xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']/*">
10549
10644
  <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
10550
- <fo:block><xsl:apply-templates/></fo:block>
10645
+ <fo:block role="SKIP"><xsl:apply-templates/></fo:block>
10551
10646
  </fo:table-cell>
10552
10647
  </xsl:template>
10553
10648
  <!-- ============ -->
@@ -10618,8 +10713,8 @@
10618
10713
  <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
10619
10714
  <fo:list-item>
10620
10715
  <fo:list-item-label end-indent="label-end()">
10621
- <fo:block>
10622
- <fo:inline>
10716
+ <fo:block role="SKIP">
10717
+ <fo:inline role="SKIP">
10623
10718
 
10624
10719
  <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
10625
10720
  <xsl:with-param name="biblio_tag_part">first</xsl:with-param>
@@ -10628,7 +10723,7 @@
10628
10723
  </fo:block>
10629
10724
  </fo:list-item-label>
10630
10725
  <fo:list-item-body start-indent="body-start()">
10631
- <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style">
10726
+ <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
10632
10727
  <xsl:call-template name="processBibitem">
10633
10728
  <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
10634
10729
  </xsl:call-template>
@@ -10850,7 +10945,7 @@
10850
10945
  <xsl:for-each select="*[local-name() = 'tab']">
10851
10946
  <xsl:variable name="current_id" select="generate-id()"/>
10852
10947
  <fo:table-cell>
10853
- <fo:block line-height-shift-adjustment="disregard-shifts">
10948
+ <fo:block line-height-shift-adjustment="disregard-shifts" role="SKIP">
10854
10949
  <xsl:call-template name="insert_basic_link">
10855
10950
  <xsl:with-param name="element">
10856
10951
  <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
@@ -10868,7 +10963,7 @@
10868
10963
  </xsl:for-each>
10869
10964
  <!-- last column - for page numbers -->
10870
10965
  <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
10871
- <fo:block>
10966
+ <fo:block role="SKIP">
10872
10967
  <xsl:call-template name="insert_basic_link">
10873
10968
  <xsl:with-param name="element">
10874
10969
  <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">