metanorma-ieee 1.0.12 → 1.0.13

Sign up to get free protection for your applications and to get access to all the features.
@@ -4806,6 +4806,10 @@
4806
4806
  </xsl:attribute-set> <!-- formula-stem-number-style -->
4807
4807
  <!-- End Formula's styles -->
4808
4808
 
4809
+ <xsl:template name="refine_formula-stem-number-style">
4810
+
4811
+ </xsl:template>
4812
+
4809
4813
  <xsl:attribute-set name="image-style">
4810
4814
  <xsl:attribute name="text-align">center</xsl:attribute>
4811
4815
 
@@ -5308,13 +5312,13 @@
5308
5312
 
5309
5313
  <xsl:template name="processPrefaceSectionsDefault_Contents">
5310
5314
  <xsl:variable name="nodes_preface_">
5311
- <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
5315
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition' or @type = 'toc')]">
5312
5316
  <node id="{@id}"/>
5313
5317
  </xsl:for-each>
5314
5318
  </xsl:variable>
5315
5319
  <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
5316
5320
 
5317
- <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition')]">
5321
+ <xsl:for-each select="/*/*[local-name()='preface']/*[not(local-name() = 'note' or local-name() = 'admonition' or @type = 'toc')]">
5318
5322
  <xsl:sort select="@displayorder" data-type="number"/>
5319
5323
 
5320
5324
  <!-- process Section's title -->
@@ -5348,12 +5352,12 @@
5348
5352
  <xsl:apply-templates select="." mode="contents"/>
5349
5353
  </xsl:for-each>
5350
5354
 
5351
- <xsl:for-each select="/*/*[local-name()='annex']">
5355
+ <!-- <xsl:for-each select="/*/*[local-name()='annex']">
5352
5356
  <xsl:sort select="@displayorder" data-type="number"/>
5353
5357
  <xsl:apply-templates select="." mode="contents"/>
5354
- </xsl:for-each>
5358
+ </xsl:for-each> -->
5355
5359
 
5356
- <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]">
5360
+ <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]">
5357
5361
  <xsl:sort select="@displayorder" data-type="number"/>
5358
5362
  <xsl:apply-templates select="." mode="contents"/>
5359
5363
  </xsl:for-each>
@@ -6218,8 +6222,8 @@
6218
6222
  <xsl:template name="table-header-title">
6219
6223
  <xsl:param name="cols-count"/>
6220
6224
  <!-- row for title -->
6221
- <fo:table-row>
6222
- <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">
6225
+ <fo:table-row role="SKIP">
6226
+ <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">
6223
6227
 
6224
6228
  <xsl:call-template name="refine_table-header-title-style"/>
6225
6229
 
@@ -6227,12 +6231,12 @@
6227
6231
  <xsl:attribute name="border-bottom">0.5 solid black</xsl:attribute>
6228
6232
  </xsl:if>
6229
6233
 
6230
- <fo:block xsl:use-attribute-sets="table-name-style">
6234
+ <fo:block xsl:use-attribute-sets="table-name-style" role="SKIP">
6231
6235
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
6232
6236
  <xsl:with-param name="continued">true</xsl:with-param>
6233
6237
  </xsl:apply-templates>
6234
6238
 
6235
- <fo:inline font-weight="normal" font-style="italic">
6239
+ <fo:inline font-weight="normal" font-style="italic" role="SKIP">
6236
6240
  <xsl:text> </xsl:text>
6237
6241
  <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
6238
6242
  </fo:inline>
@@ -6433,21 +6437,21 @@
6433
6437
  <xsl:variable name="title_start" select="ancestor::*[local-name()='table'][1]/*[local-name()='name']/node()[1][self::text()]"/>
6434
6438
  <xsl:variable name="table_number" select="substring-before($title_start, '—')"/>
6435
6439
 
6436
- <fo:table-row height="0" keep-with-next.within-page="always">
6437
- <fo:table-cell>
6440
+ <fo:table-row height="0" keep-with-next.within-page="always" role="SKIP">
6441
+ <fo:table-cell role="SKIP">
6438
6442
 
6439
6443
  <fo:marker marker-class-name="table_continued"/>
6440
6444
 
6441
- <fo:block/>
6445
+ <fo:block role="SKIP"/>
6442
6446
  </fo:table-cell>
6443
6447
  </fo:table-row>
6444
- <fo:table-row height="0" keep-with-next.within-page="always">
6445
- <fo:table-cell>
6448
+ <fo:table-row height="0" keep-with-next.within-page="always" role="SKIP">
6449
+ <fo:table-cell role="SKIP">
6446
6450
 
6447
6451
  <fo:marker marker-class-name="table_continued">
6448
6452
  <xsl:value-of select="$title_continued"/>
6449
6453
  </fo:marker>
6450
- <fo:block/>
6454
+ <fo:block role="SKIP"/>
6451
6455
  </fo:table-cell>
6452
6456
  </fo:table-row>
6453
6457
 
@@ -6588,7 +6592,7 @@
6588
6592
 
6589
6593
  <xsl:call-template name="refine_table-header-cell-style"/>
6590
6594
 
6591
- <fo:block>
6595
+ <fo:block role="SKIP">
6592
6596
  <xsl:apply-templates/>
6593
6597
  </fo:block>
6594
6598
  </fo:table-cell>
@@ -6641,7 +6645,7 @@
6641
6645
  <xsl:attribute name="text-align">left</xsl:attribute>
6642
6646
  </xsl:if>
6643
6647
 
6644
- <fo:block>
6648
+ <fo:block role="SKIP">
6645
6649
 
6646
6650
  <xsl:if test="$isGenerateTableIF = 'true'">
6647
6651
  <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
@@ -7504,7 +7508,7 @@
7504
7508
  -->
7505
7509
  <fo:table-row>
7506
7510
  <fo:table-cell number-columns-spanned="2">
7507
- <fo:block>
7511
+ <fo:block role="SKIP">
7508
7512
  <xsl:call-template name="note"/>
7509
7513
  </fo:block>
7510
7514
  </fo:table-cell>
@@ -7569,7 +7573,7 @@
7569
7573
 
7570
7574
  <xsl:call-template name="refine_dt-cell-style"/>
7571
7575
 
7572
- <fo:block xsl:use-attribute-sets="dt-block-style">
7576
+ <fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
7573
7577
  <xsl:copy-of select="@id"/>
7574
7578
 
7575
7579
  <xsl:if test="normalize-space($key_iso) = 'true'">
@@ -7599,7 +7603,7 @@
7599
7603
 
7600
7604
  <xsl:call-template name="refine_dd-cell-style"/>
7601
7605
 
7602
- <fo:block>
7606
+ <fo:block role="SKIP">
7603
7607
 
7604
7608
  <xsl:if test="$isGenerateTableIF = 'true'">
7605
7609
  <xsl:attribute name="id"><xsl:value-of select="@id"/></xsl:attribute>
@@ -7972,11 +7976,41 @@
7972
7976
 
7973
7977
  <xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
7974
7978
  <xsl:variable name="text" select="normalize-space(.)"/>
7975
- <fo:inline font-size="75%">
7979
+ <fo:inline font-size="75%" role="SKIP">
7976
7980
  <xsl:if test="string-length($text) &gt; 0">
7977
- <xsl:call-template name="recursiveSmallCaps">
7978
- <xsl:with-param name="text" select="$text"/>
7979
- </xsl:call-template>
7981
+ <xsl:variable name="smallCapsText">
7982
+ <xsl:call-template name="recursiveSmallCaps">
7983
+ <xsl:with-param name="text" select="$text"/>
7984
+ </xsl:call-template>
7985
+ </xsl:variable>
7986
+ <!-- merge neighboring fo:inline -->
7987
+ <xsl:for-each select="xalan:nodeset($smallCapsText)/node()">
7988
+ <xsl:choose>
7989
+ <xsl:when test="self::fo:inline and preceding-sibling::node()[1][self::fo:inline]"><!-- <xsl:copy-of select="."/> --></xsl:when>
7990
+ <xsl:when test="self::fo:inline and @font-size">
7991
+ <xsl:variable name="curr_pos" select="count(preceding-sibling::node()) + 1"/>
7992
+ <!-- <curr_pos><xsl:value-of select="$curr_pos"/></curr_pos> -->
7993
+ <xsl:variable name="next_text_" select="count(following-sibling::node()[not(local-name() = 'inline')][1]/preceding-sibling::node())"/>
7994
+ <xsl:variable name="next_text">
7995
+ <xsl:choose>
7996
+ <xsl:when test="$next_text_ = 0">99999999</xsl:when>
7997
+ <xsl:otherwise><xsl:value-of select="$next_text_ + 1"/></xsl:otherwise>
7998
+ </xsl:choose>
7999
+ </xsl:variable>
8000
+ <!-- <next_text><xsl:value-of select="$next_text"/></next_text> -->
8001
+ <fo:inline>
8002
+ <xsl:copy-of select="@*"/>
8003
+ <xsl:copy-of select="./node()"/>
8004
+ <xsl:for-each select="following-sibling::node()[position() &lt; $next_text - $curr_pos]"> <!-- [self::fo:inline] -->
8005
+ <xsl:copy-of select="./node()"/>
8006
+ </xsl:for-each>
8007
+ </fo:inline>
8008
+ </xsl:when>
8009
+ <xsl:otherwise>
8010
+ <xsl:copy-of select="."/>
8011
+ </xsl:otherwise>
8012
+ </xsl:choose>
8013
+ </xsl:for-each>
7980
8014
  </xsl:if>
7981
8015
  </fo:inline>
7982
8016
  </xsl:template>
@@ -7988,7 +8022,7 @@
7988
8022
  <xsl:variable name="upperCase" select="java:toUpperCase(java:java.lang.String.new($char))"/>
7989
8023
  <xsl:choose>
7990
8024
  <xsl:when test="$char=$upperCase">
7991
- <fo:inline font-size="{100 div 0.75}%">
8025
+ <fo:inline font-size="{100 div 0.75}%" role="SKIP">
7992
8026
  <xsl:value-of select="$upperCase"/>
7993
8027
  </fo:inline>
7994
8028
  </xsl:when>
@@ -8150,6 +8184,10 @@
8150
8184
 
8151
8185
  <xsl:when test="not(contains($text, $separator))">
8152
8186
  <word>
8187
+ <xsl:if test="ancestor::*[local-name() = 'p'][@from_dl = 'true']">
8188
+ <xsl:text>
8189
+  </xsl:text> <!-- to add distance between dt and dd -->
8190
+ </xsl:if>
8153
8191
  <xsl:call-template name="enclose_text_in_tags">
8154
8192
  <xsl:with-param name="text" select="normalize-space($text)"/>
8155
8193
  <xsl:with-param name="tags" select="$tags"/>
@@ -8158,6 +8196,10 @@
8158
8196
  </xsl:when>
8159
8197
  <xsl:otherwise>
8160
8198
  <word>
8199
+ <xsl:if test="ancestor::*[local-name() = 'p'][@from_dl = 'true']">
8200
+ <xsl:text>
8201
+  </xsl:text> <!-- to add distance between dt and dd -->
8202
+ </xsl:if>
8161
8203
  <xsl:call-template name="enclose_text_in_tags">
8162
8204
  <xsl:with-param name="text" select="normalize-space(substring-before($text, $separator))"/>
8163
8205
  <xsl:with-param name="tags" select="$tags"/>
@@ -8341,6 +8383,10 @@
8341
8383
  <xsl:template name="getSimpleTable">
8342
8384
  <xsl:param name="id"/>
8343
8385
 
8386
+ <!-- <test0>
8387
+ <xsl:copy-of select="."/>
8388
+ </test0> -->
8389
+
8344
8390
  <xsl:variable name="simple-table">
8345
8391
 
8346
8392
  <!-- Step 0. replace <br/> to <p>...</p> -->
@@ -9388,7 +9434,7 @@
9388
9434
  <fo:table-body>
9389
9435
  <fo:table-row>
9390
9436
  <fo:table-cell display-align="center">
9391
- <fo:block xsl:use-attribute-sets="formula-stem-block-style">
9437
+ <fo:block xsl:use-attribute-sets="formula-stem-block-style" role="SKIP">
9392
9438
 
9393
9439
  <xsl:call-template name="refine_formula-stem-block-style"/>
9394
9440
 
@@ -9396,7 +9442,10 @@
9396
9442
  </fo:block>
9397
9443
  </fo:table-cell>
9398
9444
  <fo:table-cell display-align="center">
9399
- <fo:block xsl:use-attribute-sets="formula-stem-number-style">
9445
+ <fo:block xsl:use-attribute-sets="formula-stem-number-style" role="SKIP">
9446
+
9447
+ <xsl:call-template name="refine_formula-stem-number-style"/>
9448
+
9400
9449
  <xsl:apply-templates select="../*[local-name() = 'name']"/>
9401
9450
  </fo:block>
9402
9451
  </fo:table-cell>
@@ -10908,7 +10957,7 @@
10908
10957
  <!-- second td with sourcecode -->
10909
10958
  <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'] -->
10910
10959
  <fo:table-cell>
10911
- <fo:block>
10960
+ <fo:block role="SKIP">
10912
10961
  <xsl:apply-templates/>
10913
10962
  </fo:block>
10914
10963
  </fo:table-cell>
@@ -11395,7 +11444,7 @@
11395
11444
 
11396
11445
  <xsl:call-template name="setTableCellAttributes"/>
11397
11446
 
11398
- <fo:block>
11447
+ <fo:block role="SKIP">
11399
11448
  <xsl:apply-templates/>
11400
11449
  </fo:block>
11401
11450
  </fo:table-cell>
@@ -11417,7 +11466,7 @@
11417
11466
 
11418
11467
  <xsl:call-template name="setTableCellAttributes"/>
11419
11468
 
11420
- <fo:block>
11469
+ <fo:block role="SKIP">
11421
11470
  <xsl:apply-templates/>
11422
11471
  </fo:block>
11423
11472
  </fo:table-cell>
@@ -12196,7 +12245,48 @@
12196
12245
  </xsl:choose>
12197
12246
  </xsl:when>
12198
12247
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
12199
- <xsl:value-of select="@label"/>
12248
+
12249
+ <xsl:variable name="label">
12250
+
12251
+ <xsl:variable name="type" select="../@type"/>
12252
+
12253
+ <xsl:variable name="style_prefix_">
12254
+ <xsl:if test="$type = 'roman'">
12255
+ <!-- Example: (i) -->
12256
+ </xsl:if>
12257
+ </xsl:variable>
12258
+ <xsl:variable name="style_prefix" select="normalize-space($style_prefix_)"/>
12259
+
12260
+ <xsl:variable name="style_suffix_">
12261
+ <xsl:choose>
12262
+ <xsl:when test="$type = 'arabic'">
12263
+ )
12264
+ </xsl:when>
12265
+ <xsl:when test="$type = 'alphabet' or $type = 'alphabetic'">
12266
+ )
12267
+ </xsl:when>
12268
+ <xsl:when test="$type = 'alphabet_upper' or $type = 'alphabetic_upper'">
12269
+ .
12270
+ </xsl:when>
12271
+ <xsl:when test="$type = 'roman'">
12272
+ )
12273
+ </xsl:when>
12274
+ <xsl:when test="$type = 'roman_upper'">.</xsl:when> <!-- Example: I. -->
12275
+ </xsl:choose>
12276
+ </xsl:variable>
12277
+ <xsl:variable name="style_suffix" select="normalize-space($style_suffix_)"/>
12278
+
12279
+ <xsl:if test="$style_prefix != '' and not(starts-with(@label, $style_prefix))">
12280
+ <xsl:value-of select="$style_prefix"/>
12281
+ </xsl:if>
12282
+ <xsl:value-of select="@label"/>
12283
+ <xsl:if test="not(java:endsWith(java:java.lang.String.new(@label),$style_suffix))">
12284
+ <xsl:value-of select="$style_suffix"/>
12285
+ </xsl:if>
12286
+ </xsl:variable>
12287
+
12288
+ <xsl:value-of select="normalize-space($label)"/>
12289
+
12200
12290
  </xsl:when>
12201
12291
  <xsl:otherwise> <!-- for ordered lists 'ol' -->
12202
12292
 
@@ -12389,7 +12479,7 @@
12389
12479
  <xsl:call-template name="refine_list-item-style"/>
12390
12480
 
12391
12481
  <fo:list-item-label end-indent="label-end()">
12392
- <fo:block xsl:use-attribute-sets="list-item-label-style">
12482
+ <fo:block xsl:use-attribute-sets="list-item-label-style" role="SKIP">
12393
12483
 
12394
12484
  <xsl:call-template name="refine_list-item-label-style"/>
12395
12485
 
@@ -12403,7 +12493,7 @@
12403
12493
  </fo:block>
12404
12494
  </fo:list-item-label>
12405
12495
  <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
12406
- <fo:block>
12496
+ <fo:block role="SKIP">
12407
12497
 
12408
12498
  <xsl:call-template name="refine_list-item-body-style"/>
12409
12499
 
@@ -12682,10 +12772,10 @@
12682
12772
  <fo:table-body>
12683
12773
  <fo:table-row text-align="center" font-weight="bold" background-color="black" color="white">
12684
12774
 
12685
- <fo:table-cell border="1pt solid black"><fo:block>Date</fo:block></fo:table-cell>
12686
- <fo:table-cell border="1pt solid black"><fo:block>Type</fo:block></fo:table-cell>
12687
- <fo:table-cell border="1pt solid black"><fo:block>Change</fo:block></fo:table-cell>
12688
- <fo:table-cell border="1pt solid black"><fo:block>Pages</fo:block></fo:table-cell>
12775
+ <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Date</fo:block></fo:table-cell>
12776
+ <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Type</fo:block></fo:table-cell>
12777
+ <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Change</fo:block></fo:table-cell>
12778
+ <fo:table-cell border="1pt solid black"><fo:block role="SKIP">Pages</fo:block></fo:table-cell>
12689
12779
  </fo:table-row>
12690
12780
  <xsl:apply-templates/>
12691
12781
  </fo:table-body>
@@ -12700,7 +12790,7 @@
12700
12790
 
12701
12791
  <xsl:template match="*[local-name() = 'errata']/*[local-name() = 'row']/*">
12702
12792
  <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
12703
- <fo:block><xsl:apply-templates/></fo:block>
12793
+ <fo:block role="SKIP"><xsl:apply-templates/></fo:block>
12704
12794
  </fo:table-cell>
12705
12795
  </xsl:template>
12706
12796
  <!-- ============ -->
@@ -12769,8 +12859,8 @@
12769
12859
  <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
12770
12860
  <fo:list-item>
12771
12861
  <fo:list-item-label end-indent="label-end()">
12772
- <fo:block>
12773
- <fo:inline>
12862
+ <fo:block role="SKIP">
12863
+ <fo:inline role="SKIP">
12774
12864
 
12775
12865
  <xsl:if test="($current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report')">
12776
12866
  <xsl:attribute name="color"><xsl:value-of select="$color_blue"/></xsl:attribute>
@@ -12783,7 +12873,7 @@
12783
12873
  </fo:block>
12784
12874
  </fo:list-item-label>
12785
12875
  <fo:list-item-body start-indent="body-start()">
12786
- <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style">
12876
+ <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style" role="SKIP">
12787
12877
  <xsl:call-template name="processBibitem">
12788
12878
  <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
12789
12879
  </xsl:call-template>
@@ -13010,7 +13100,7 @@
13010
13100
  <xsl:for-each select="*[local-name() = 'tab']">
13011
13101
  <xsl:variable name="current_id" select="generate-id()"/>
13012
13102
  <fo:table-cell>
13013
- <fo:block line-height-shift-adjustment="disregard-shifts">
13103
+ <fo:block line-height-shift-adjustment="disregard-shifts" role="SKIP">
13014
13104
  <xsl:call-template name="insert_basic_link">
13015
13105
  <xsl:with-param name="element">
13016
13106
  <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">
@@ -13028,7 +13118,7 @@
13028
13118
  </xsl:for-each>
13029
13119
  <!-- last column - for page numbers -->
13030
13120
  <fo:table-cell text-align="right" font-size="10pt" font-weight="bold" font-family="Arial">
13031
- <fo:block>
13121
+ <fo:block role="SKIP">
13032
13122
  <xsl:call-template name="insert_basic_link">
13033
13123
  <xsl:with-param name="element">
13034
13124
  <fo:basic-link internal-destination="{$target}" fox:alt-text="{.}">