metanorma-ribose 2.2.2 → 2.2.4

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: b52a4ce5e81936ba043035a243a88a1fe2d8f1c17f8b1195499fbd0ea30ea8cd
4
- data.tar.gz: e0f5af98060005b86849b0b8651b3fbae732dd8a446f9f03aae558a86f633eac
3
+ metadata.gz: b7fe161c84c37ab5b701b48ad724eb21fd1b1eb9e7fbf5b51baeef16135f0ad3
4
+ data.tar.gz: 64eaca15058fac006e020351807e8646ca000e515fd03ce676a9af4decaa4b39
5
5
  SHA512:
6
- metadata.gz: a5857de14aea32a150ff1dea4cb9a59754b42d8f51f8bbbd71d8ce609a3945e0489ce4cbe44212f28fa75fd0b71c19d228f900514f6e5de64242c62bdb1435ad
7
- data.tar.gz: d1e0d6d808ed9bc5b758d83395ba39e764c54364cf2e7214c976fd67a4ba27b9e7a7a36d309a2c06416ef080f694c65e6b89e0a0277706d3cbe32756fcfec5a7
6
+ metadata.gz: 523c6ab1d22bf87d03cad3bdebf78cf2cda78e675e2cd071e059e670e8cd330a17a6943a2cb8cf38d6e42f00ece0a02b61a03eafb1e202285dfaa15cbeca9c64
7
+ data.tar.gz: 27ebab46f0aec117f8f5ffee0883ae8378d1cc025b10d6b0517d92ab6adcc75352de9d53c324a3639df31c3d745f0f7dd46a5be146a76e55601e5e7390f780a8
@@ -437,6 +437,10 @@ div.figure {
437
437
  max-width: 100%;
438
438
  height: auto; }
439
439
 
440
+ table div.figure {
441
+ padding: 0;
442
+ margin: 0; }
443
+
440
444
  /*
441
445
  Document types + stages
442
446
  */
@@ -88,6 +88,12 @@ div.figure {
88
88
  @include figureBlock();
89
89
  }
90
90
 
91
+ table div.figure {
92
+ padding: 0;
93
+ margin: 0;
94
+ }
95
+
96
+
91
97
  /*
92
98
  Document types + stages
93
99
  */
@@ -1259,14 +1259,14 @@
1259
1259
  BUT DON'T put any another conditions together with $namespace = '...' (such conditions will be ignored). For another conditions, please use nested xsl:if or xsl:choose -->
1260
1260
 
1261
1261
  <!--
1262
- <misc-container>
1262
+ <metanorma-extension>
1263
1263
  <presentation-metadata>
1264
1264
  <papersize>letter</papersize>
1265
1265
  </presentation-metadata>
1266
- </misc-container>
1266
+ </metanorma-extension>
1267
1267
  -->
1268
1268
 
1269
- <xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata']/*[local-name() = 'papersize'])))"/>
1269
+ <xsl:variable name="papersize" select="java:toLowerCase(java:java.lang.String.new(normalize-space(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata']/*[local-name() = 'papersize'])))"/>
1270
1270
  <xsl:variable name="papersize_width_">
1271
1271
  <xsl:choose>
1272
1272
  <xsl:when test="$papersize = 'letter'">215.9</xsl:when>
@@ -1381,7 +1381,7 @@
1381
1381
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
1382
1382
 
1383
1383
  <xsl:variable name="title-list-tables">
1384
- <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
1384
+ <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
1385
1385
  <xsl:value-of select="$toc_table_title"/>
1386
1386
  <xsl:if test="normalize-space($toc_table_title) = ''">
1387
1387
  <xsl:call-template name="getTitle">
@@ -1391,7 +1391,7 @@
1391
1391
  </xsl:variable>
1392
1392
 
1393
1393
  <xsl:variable name="title-list-figures">
1394
- <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
1394
+ <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
1395
1395
  <xsl:value-of select="$toc_figure_title"/>
1396
1396
  <xsl:if test="normalize-space($toc_figure_title) = ''">
1397
1397
  <xsl:call-template name="getTitle">
@@ -1401,7 +1401,7 @@
1401
1401
  </xsl:variable>
1402
1402
 
1403
1403
  <xsl:variable name="title-list-recommendations">
1404
- <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
1404
+ <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
1405
1405
  <xsl:value-of select="$toc_requirement_title"/>
1406
1406
  <xsl:if test="normalize-space($toc_requirement_title) = ''">
1407
1407
  <xsl:call-template name="getTitle">
@@ -1475,7 +1475,7 @@
1475
1475
  <xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
1476
1476
 
1477
1477
  <xsl:variable name="additional_fonts_">
1478
- <xsl:for-each select="//*[contains(local-name(), '-standard')][1]/*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value'] | //*[contains(local-name(), '-standard')][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
1478
+ <xsl:for-each select="//*[contains(local-name(), '-standard')][1]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value'] | //*[contains(local-name(), '-standard')][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
1479
1479
  <xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
1480
1480
  </xsl:for-each>
1481
1481
  </xsl:variable>
@@ -2617,10 +2617,10 @@
2617
2617
 
2618
2618
  <xsl:template name="processTablesFigures_Contents">
2619
2619
  <xsl:param name="always"/>
2620
- <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
2620
+ <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
2621
2621
  <xsl:call-template name="processTables_Contents"/>
2622
2622
  </xsl:if>
2623
- <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
2623
+ <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
2624
2624
  <xsl:call-template name="processFigures_Contents"/>
2625
2625
  </xsl:if>
2626
2626
  </xsl:template>
@@ -2952,6 +2952,8 @@
2952
2952
 
2953
2953
  <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
2954
2954
 
2955
+ <xsl:call-template name="setBordersTableArray"/>
2956
+
2955
2957
  </xsl:element>
2956
2958
  </xsl:variable>
2957
2959
 
@@ -3049,7 +3051,7 @@
3049
3051
  <xsl:variable name="isDeleted" select="@deleted"/>
3050
3052
 
3051
3053
  <xsl:choose>
3052
- <xsl:when test="@width">
3054
+ <xsl:when test="@width and @width != 'full-page-width' and @width != 'text-width'">
3053
3055
 
3054
3056
  <!-- centered table when table name is centered (see table-name-style) -->
3055
3057
 
@@ -3096,6 +3098,10 @@
3096
3098
 
3097
3099
  </xsl:template>
3098
3100
 
3101
+ <xsl:template name="setBordersTableArray">
3102
+
3103
+ </xsl:template>
3104
+
3099
3105
  <xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
3100
3106
  <xsl:param name="continued"/>
3101
3107
  <xsl:if test="normalize-space() != ''">
@@ -3370,6 +3376,7 @@
3370
3376
  This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
3371
3377
  <xsl:when test="(@width_max &gt; $page_width and @width_min &lt; $page_width) or (@width_min &gt;= $page_width)">
3372
3378
  <!-- difference between the available space and the minimum table width -->
3379
+ <_width_min><xsl:value-of select="@width_min"/></_width_min>
3373
3380
  <xsl:variable name="W" select="$page_width - @width_min"/>
3374
3381
  <W><xsl:value-of select="$W"/></W>
3375
3382
  <!-- difference between maximum and minimum width of the table -->
@@ -3570,6 +3577,8 @@
3570
3577
  <fo:table-row>
3571
3578
  <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
3572
3579
 
3580
+ <xsl:call-template name="setBordersTableArray"/>
3581
+
3573
3582
  <!-- fn will be processed inside 'note' processing -->
3574
3583
 
3575
3584
  <!-- for BSI (not PAS) display Notes before footnotes -->
@@ -3691,6 +3700,8 @@
3691
3700
  <xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
3692
3701
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
3693
3702
 
3703
+ <xsl:call-template name="setBordersTableArray"/>
3704
+
3694
3705
  <xsl:call-template name="setTableRowAttributes"/>
3695
3706
 
3696
3707
  <xsl:apply-templates/>
@@ -3714,6 +3725,8 @@
3714
3725
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3715
3726
  </xsl:if>
3716
3727
 
3728
+ <xsl:call-template name="setBordersTableArray"/>
3729
+
3717
3730
  <xsl:variable name="number"><xsl:number/></xsl:variable>
3718
3731
  <xsl:if test="$number mod 2 = 0">
3719
3732
  <xsl:attribute name="background-color">rgb(254, 247, 228)</xsl:attribute>
@@ -3738,6 +3751,8 @@
3738
3751
  <xsl:with-param name="default">center</xsl:with-param>
3739
3752
  </xsl:call-template>
3740
3753
 
3754
+ <xsl:call-template name="setBordersTableArray"/>
3755
+
3741
3756
  <xsl:if test="$lang = 'ar'">
3742
3757
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
3743
3758
  </xsl:if>
@@ -3790,6 +3805,8 @@
3790
3805
 
3791
3806
  <!-- bsi -->
3792
3807
 
3808
+ <xsl:call-template name="setBordersTableArray"/>
3809
+
3793
3810
  <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
3794
3811
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
3795
3812
  </xsl:if>
@@ -3982,17 +3999,20 @@
3982
3999
  <xsl:for-each select="xalan:nodeset($references)//fn">
3983
4000
  <xsl:variable name="reference" select="@reference"/>
3984
4001
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
3985
- <fo:block xsl:use-attribute-sets="table-fn-style">
3986
4002
 
3987
- <fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
4003
+ <fo:block xsl:use-attribute-sets="table-fn-style">
3988
4004
 
3989
- <xsl:value-of select="@reference"/>
4005
+ <fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
4006
+
4007
+ <xsl:value-of select="@reference"/>
4008
+
4009
+ </fo:inline>
4010
+ <fo:inline xsl:use-attribute-sets="table-fn-body-style">
4011
+ <xsl:copy-of select="./node()"/>
4012
+ </fo:inline>
4013
+
4014
+ </fo:block>
3990
4015
 
3991
- </fo:inline>
3992
- <fo:inline xsl:use-attribute-sets="table-fn-body-style">
3993
- <xsl:copy-of select="./node()"/>
3994
- </fo:inline>
3995
- </fo:block>
3996
4016
  </xsl:if>
3997
4017
  </xsl:for-each>
3998
4018
  </xsl:template>
@@ -4941,12 +4961,12 @@
4941
4961
  <xsl:param name="value"/>
4942
4962
  <xsl:variable name="add_width" select="string-length($value) * 20"/>
4943
4963
  <xsl:variable name="maxwidth" select="60 + $add_width"/>
4944
- <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-20%"><!-- alignment-baseline="middle" -->
4945
- <xsl:attribute name="height">5mm</xsl:attribute>
4964
+ <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-10%"><!-- alignment-baseline="middle" -->
4965
+ <xsl:attribute name="height">3.5mm</xsl:attribute> <!-- 5mm -->
4946
4966
  <xsl:attribute name="content-width">100%</xsl:attribute>
4947
4967
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4948
4968
  <xsl:attribute name="scaling">uniform</xsl:attribute>
4949
- <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
4969
+ <!-- <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
4950
4970
  <g>
4951
4971
  <xsl:if test="$type = 'closing' or $type = 'end'">
4952
4972
  <xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
@@ -4960,6 +4980,27 @@
4960
4980
  </xsl:if>
4961
4981
  <xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
4962
4982
  </text>
4983
+ </svg> -->
4984
+ <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
4985
+ <g>
4986
+ <xsl:if test="$type = 'closing' or $type = 'end'">
4987
+ <xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
4988
+ </xsl:if>
4989
+ <polyline points="0,2.5 {$maxwidth},2.5 {$maxwidth + 20},40 {$maxwidth},77.5 0,77.5" stroke="black" stroke-width="5" fill="white"/>
4990
+ <line x1="9.5" y1="0" x2="9.5" y2="80" stroke="black" stroke-width="19"/>
4991
+ </g>
4992
+ <xsl:variable name="text_x">
4993
+ <xsl:choose>
4994
+ <xsl:when test="$type = 'closing' or $type = 'end'">28</xsl:when>
4995
+ <xsl:otherwise>22</xsl:otherwise>
4996
+ </xsl:choose>
4997
+ </xsl:variable>
4998
+ <text font-family="Arial" x="{$text_x}" y="50" font-size="40pt">
4999
+ <xsl:value-of select="$kind"/>
5000
+ </text>
5001
+ <text font-family="Arial" x="{$text_x + 33}" y="65" font-size="38pt">
5002
+ <xsl:value-of select="$value"/>
5003
+ </text>
4963
5004
  </svg>
4964
5005
  </fo:instream-foreign-object>
4965
5006
  </xsl:template>
@@ -5214,18 +5255,23 @@
5214
5255
 
5215
5256
  <xsl:template name="add-zero-spaces-java">
5216
5257
  <xsl:param name="text" select="."/>
5217
- <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, arrow right -->
5218
- <xsl:variable name="text1" select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |→)','$1​')"/>
5258
+
5259
+ <!-- add zero-width space (#x200B) after dot with next non-digit -->
5260
+ <xsl:variable name="text1" select="java:replaceAll(java:java.lang.String.new($text),'(\.)([^\d\s])','$1​$2')"/>
5261
+ <!-- add zero-width space (#x200B) after characters: dash, equal, underscore, em dash, thin space, arrow right -->
5262
+ <xsl:variable name="text2" select="java:replaceAll(java:java.lang.String.new($text1),'(-|=|_|—| |→)','$1​')"/>
5263
+ <!-- add zero-width space (#x200B) after characters: colon, if there aren't digits after -->
5264
+ <xsl:variable name="text3" select="java:replaceAll(java:java.lang.String.new($text2),'(:)(\D)','$1​$2')"/>
5219
5265
  <!-- add zero-width space (#x200B) after characters: 'great than' -->
5220
- <xsl:variable name="text2" select="java:replaceAll(java:java.lang.String.new($text1), '(\u003e)(?!\u003e)', '$1​')"/><!-- negative lookahead: 'great than' not followed by 'great than' -->
5266
+ <xsl:variable name="text4" select="java:replaceAll(java:java.lang.String.new($text3), '(\u003e)(?!\u003e)', '$1​')"/><!-- negative lookahead: 'great than' not followed by 'great than' -->
5221
5267
  <!-- add zero-width space (#x200B) before characters: 'less than' -->
5222
- <xsl:variable name="text3" select="java:replaceAll(java:java.lang.String.new($text2), '(?&lt;!\u003c)(\u003c)', '​$1')"/> <!-- (?<!\u003c)(\u003c) --> <!-- negative lookbehind: 'less than' not preceeded by 'less than' -->
5268
+ <xsl:variable name="text5" select="java:replaceAll(java:java.lang.String.new($text4), '(?&lt;!\u003c)(\u003c)', '​$1')"/> <!-- (?<!\u003c)(\u003c) --> <!-- negative lookbehind: 'less than' not preceeded by 'less than' -->
5223
5269
  <!-- add zero-width space (#x200B) before character: { -->
5224
- <xsl:variable name="text4" select="java:replaceAll(java:java.lang.String.new($text3), '(?&lt;!\W)(\{)', '​$1')"/> <!-- negative lookbehind: '{' not preceeded by 'punctuation char' -->
5270
+ <xsl:variable name="text6" select="java:replaceAll(java:java.lang.String.new($text5), '(?&lt;!\W)(\{)', '​$1')"/> <!-- negative lookbehind: '{' not preceeded by 'punctuation char' -->
5225
5271
  <!-- add zero-width space (#x200B) after character: , -->
5226
- <xsl:variable name="text5" select="java:replaceAll(java:java.lang.String.new($text4), '(\,)(?!\d)', '$1​')"/> <!-- negative lookahead: ',' not followed by digit -->
5272
+ <xsl:variable name="text7" select="java:replaceAll(java:java.lang.String.new($text6), '(\,)(?!\d)', '$1​')"/> <!-- negative lookahead: ',' not followed by digit -->
5227
5273
 
5228
- <xsl:value-of select="$text5"/>
5274
+ <xsl:value-of select="$text7"/>
5229
5275
  </xsl:template>
5230
5276
 
5231
5277
  <xsl:template name="add-zero-spaces-link-java">
@@ -5234,7 +5280,9 @@
5234
5280
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$1')"/> <!-- http://. https:// or www. -->
5235
5281
  <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
5236
5282
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
5237
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1​')"/>
5283
+ <xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1​')"/>
5284
+ <!-- remove zero-width space at the end -->
5285
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '​$', '')"/>
5238
5286
  </xsl:template>
5239
5287
 
5240
5288
  <!-- add zero space after dash character (for table's entries) -->
@@ -5371,7 +5419,7 @@
5371
5419
  </xsl:copy>
5372
5420
  </xsl:template>
5373
5421
 
5374
- <xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p']) and not(*[local-name()='sourcecode'])]" mode="table-without-br">
5422
+ <xsl:template match="*[local-name()='th' or local-name() = 'td'][not(*[local-name()='br']) and not(*[local-name()='p']) and not(*[local-name()='sourcecode']) and not(*[local-name()='ul']) and not(*[local-name()='ol'])]" mode="table-without-br">
5375
5423
  <xsl:copy>
5376
5424
  <xsl:copy-of select="@*"/>
5377
5425
  <p>
@@ -5447,6 +5495,14 @@
5447
5495
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),' {2,}',' ')"/>
5448
5496
  </xsl:template>
5449
5497
 
5498
+ <xsl:template match="*[local-name()='th' or local-name()='td']//*[local-name() = 'ol' or local-name() = 'ul']" mode="table-without-br">
5499
+ <xsl:apply-templates mode="table-without-br"/>
5500
+ </xsl:template>
5501
+
5502
+ <xsl:template match="*[local-name()='th' or local-name()='td']//*[local-name() = 'li']" mode="table-without-br">
5503
+ <xsl:apply-templates mode="table-without-br"/>
5504
+ </xsl:template>
5505
+
5450
5506
  <!-- mode="table-without-br" -->
5451
5507
  <!-- ================================== -->
5452
5508
  <!-- END: Step 0. replace <br/> to <p>...</p> -->
@@ -6271,7 +6327,7 @@
6271
6327
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
6272
6328
  </xsl:if>
6273
6329
 
6274
- <fo:block-container margin-left="0mm">
6330
+ <fo:block-container margin-left="0mm" margin-right="0mm">
6275
6331
 
6276
6332
  <fo:block>
6277
6333
 
@@ -6452,11 +6508,14 @@
6452
6508
  <!-- show figure's name BEFORE image -->
6453
6509
  <xsl:apply-templates select="*[local-name() = 'name']"/>
6454
6510
 
6511
+ <!-- Example: Dimensions in millimeters -->
6512
+ <xsl:apply-templates select="*[local-name() = 'note'][@type = 'units']"/>
6513
+
6455
6514
  <fo:block xsl:use-attribute-sets="figure-style">
6456
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
6515
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
6457
6516
  </fo:block>
6458
6517
  <xsl:call-template name="fn_display_figure"/>
6459
- <xsl:for-each select="*[local-name() = 'note']">
6518
+ <xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
6460
6519
  <xsl:call-template name="note"/>
6461
6520
  </xsl:for-each>
6462
6521
 
@@ -6711,24 +6770,47 @@
6711
6770
 
6712
6771
  </xsl:when>
6713
6772
  <xsl:otherwise>
6714
- <fo:block xsl:use-attribute-sets="image-style">
6715
- <fo:instream-foreign-object fox:alt-text="{$alt-text}">
6716
- <xsl:attribute name="width">100%</xsl:attribute>
6717
- <xsl:attribute name="content-height">100%</xsl:attribute>
6718
- <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
6719
- <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
6720
- <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
6721
- <!-- effective height 297 - 27.4 - 13 = 256.6 -->
6722
- <!-- effective width 210 - 12.5 - 25 = 172.5 -->
6723
- <!-- effective height / width = 1.48, 1.4 - with title -->
6724
- <xsl:if test="$svg_height &gt; ($svg_width * 1.4)"> <!-- for images with big height -->
6725
- <xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
6726
- <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
6727
- </xsl:if>
6728
- <xsl:attribute name="scaling">uniform</xsl:attribute>
6729
- <xsl:copy-of select="$svg_content"/>
6730
- </fo:instream-foreign-object>
6731
- </fo:block>
6773
+
6774
+ <xsl:variable name="element">
6775
+ <xsl:choose>
6776
+ <xsl:when test="ancestor::*[local-name() = 'tr'] and $isGenerateTableIF = 'true'">
6777
+ <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
6778
+ </xsl:when>
6779
+ <xsl:otherwise>
6780
+ <fo:block xsl:use-attribute-sets="image-style">
6781
+ <xsl:if test="ancestor::*[local-name() = 'dt']">
6782
+ <xsl:attribute name="text-align">left</xsl:attribute>
6783
+ </xsl:if>
6784
+ </fo:block>
6785
+ </xsl:otherwise>
6786
+ </xsl:choose>
6787
+ </xsl:variable>
6788
+
6789
+ <xsl:for-each select="xalan:nodeset($element)/*">
6790
+ <xsl:copy>
6791
+ <xsl:copy-of select="@*"/>
6792
+ <!-- <fo:block xsl:use-attribute-sets="image-style"> -->
6793
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}">
6794
+ <xsl:if test="$isGenerateTableIF = 'false'">
6795
+ <xsl:attribute name="width">100%</xsl:attribute>
6796
+ </xsl:if>
6797
+ <xsl:attribute name="content-height">100%</xsl:attribute>
6798
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
6799
+ <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
6800
+ <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
6801
+ <!-- effective height 297 - 27.4 - 13 = 256.6 -->
6802
+ <!-- effective width 210 - 12.5 - 25 = 172.5 -->
6803
+ <!-- effective height / width = 1.48, 1.4 - with title -->
6804
+ <xsl:if test="$svg_height &gt; ($svg_width * 1.4)"> <!-- for images with big height -->
6805
+ <xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
6806
+ <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
6807
+ </xsl:if>
6808
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
6809
+ <xsl:copy-of select="$svg_content"/>
6810
+ </fo:instream-foreign-object>
6811
+ <!-- </fo:block> -->
6812
+ </xsl:copy>
6813
+ </xsl:for-each>
6732
6814
  </xsl:otherwise>
6733
6815
  </xsl:choose>
6734
6816
  </xsl:template>
@@ -6820,6 +6902,13 @@
6820
6902
  </xsl:for-each>
6821
6903
  </xsl:template>
6822
6904
 
6905
+ <!-- For the structures like: <dt><image src="" mimetype="image/svg+xml" height="" width=""><svg xmlns="http://www.w3.org/2000/svg" ... -->
6906
+ <xsl:template match="*[local-name() != 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
6907
+ <xsl:for-each select="*[local-name() = 'svg']">
6908
+ <xsl:call-template name="image_svg"/>
6909
+ </xsl:for-each>
6910
+ </xsl:template>
6911
+
6823
6912
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
6824
6913
  <xsl:variable name="svg_content" select="document(@src)"/>
6825
6914
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -6958,6 +7047,8 @@
6958
7047
  <xsl:value-of select="."/>
6959
7048
  </xsl:template>
6960
7049
 
7050
+ <xsl:template match="*[local-name() = 'add'][starts-with(., $ace_tag)]/text()" mode="bookmarks" priority="3"/>
7051
+
6961
7052
  <xsl:template match="node()" mode="contents">
6962
7053
  <xsl:apply-templates mode="contents"/>
6963
7054
  </xsl:template>
@@ -7265,7 +7356,15 @@
7265
7356
  <xsl:value-of select="@section"/>
7266
7357
  <xsl:text> </xsl:text>
7267
7358
  </xsl:if>
7268
- <xsl:value-of select="normalize-space(title)"/>
7359
+ <xsl:variable name="title">
7360
+ <xsl:for-each select="title/node()">
7361
+ <xsl:choose>
7362
+ <xsl:when test="local-name() = 'add' and starts-with(., $ace_tag)"><!-- skip --></xsl:when>
7363
+ <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
7364
+ </xsl:choose>
7365
+ </xsl:for-each>
7366
+ </xsl:variable>
7367
+ <xsl:value-of select="normalize-space($title)"/>
7269
7368
  </fo:bookmark-title>
7270
7369
  <xsl:apply-templates mode="bookmark"/>
7271
7370
  </fo:bookmark>
@@ -7291,6 +7390,12 @@
7291
7390
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
7292
7391
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']"/>
7293
7392
 
7393
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note'][@type = 'units'] | *[local-name() = 'image']/*[local-name() = 'note'][@type = 'units']" priority="2">
7394
+ <fo:block text-align="right" keep-with-next="always">
7395
+ <xsl:apply-templates/>
7396
+ </fo:block>
7397
+ </xsl:template>
7398
+
7294
7399
  <!-- ====== -->
7295
7400
  <!-- ====== -->
7296
7401
  <xsl:template match="*[local-name() = 'title']" mode="contents_item">
@@ -7440,6 +7545,10 @@
7440
7545
  </xsl:for-each>
7441
7546
  </xsl:template>
7442
7547
 
7548
+ <xsl:template match="*[local-name() = 'add'][starts-with(., $ace_tag)]/text()" mode="contents_item" priority="2">
7549
+ <xsl:value-of select="."/>
7550
+ </xsl:template>
7551
+
7443
7552
  <!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
7444
7553
  <xsl:template match="*[local-name() = 'span']" mode="contents_item">
7445
7554
  <xsl:apply-templates mode="contents_item"/>
@@ -7449,7 +7558,7 @@
7449
7558
  <!-- sourcecode -->
7450
7559
  <!-- =============== -->
7451
7560
 
7452
- <xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'source-highlighter-css']"/>
7561
+ <xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'source-highlighter-css']"/>
7453
7562
  <xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
7454
7563
  <xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
7455
7564
 
@@ -9524,8 +9633,8 @@
9524
9633
 
9525
9634
  <xsl:variable name="toc_level">
9526
9635
  <!-- https://www.metanorma.org/author/ref/document-attributes/ -->
9527
- <xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'HTML TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- :htmltoclevels Number of table of contents levels to render in HTML/PDF output; used to override :toclevels:-->
9528
- <xsl:variable name="toclevels" select="normalize-space(//*[local-name() = 'misc-container']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- Number of table of contents levels to render -->
9636
+ <xsl:variable name="htmltoclevels" select="normalize-space(//*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'HTML TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- :htmltoclevels Number of table of contents levels to render in HTML/PDF output; used to override :toclevels:-->
9637
+ <xsl:variable name="toclevels" select="normalize-space(//*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name']/text() = 'TOC Heading Levels']/*[local-name() = 'value'])"/> <!-- Number of table of contents levels to render -->
9529
9638
  <xsl:choose>
9530
9639
  <xsl:when test="$htmltoclevels != ''"><xsl:value-of select="number($htmltoclevels)"/></xsl:when> <!-- if there is value in xml -->
9531
9640
  <xsl:when test="$toclevels != ''"><xsl:value-of select="number($toclevels)"/></xsl:when> <!-- if there is value in xml -->
@@ -10517,6 +10626,7 @@
10517
10626
  <xsl:choose>
10518
10627
  <xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
10519
10628
  <xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
10629
+ <xsl:when test="$align = 'justified'">justify</xsl:when>
10520
10630
  <xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
10521
10631
  <xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
10522
10632
  <xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
@@ -522,7 +522,6 @@
522
522
  <value>tip</value>
523
523
  <value>important</value>
524
524
  <value>caution</value>
525
- <value>statement</value>
526
525
  </choice>
527
526
  </define>
528
527
  <define name="figure">
@@ -216,6 +216,9 @@
216
216
  <optional>
217
217
  <ref name="fullname"/>
218
218
  </optional>
219
+ <zeroOrMore>
220
+ <ref name="credential"/>
221
+ </zeroOrMore>
219
222
  <zeroOrMore>
220
223
  <ref name="affiliation"/>
221
224
  </zeroOrMore>
@@ -232,6 +235,11 @@
232
235
  <ref name="FullNameType"/>
233
236
  </element>
234
237
  </define>
238
+ <define name="credential">
239
+ <element name="credential">
240
+ <text/>
241
+ </element>
242
+ </define>
235
243
  <define name="FullNameType">
236
244
  <choice>
237
245
  <group>
@@ -305,7 +313,9 @@
305
313
  <zeroOrMore>
306
314
  <ref name="affiliationdescription"/>
307
315
  </zeroOrMore>
308
- <ref name="organization"/>
316
+ <optional>
317
+ <ref name="organization"/>
318
+ </optional>
309
319
  </element>
310
320
  </define>
311
321
  <define name="affiliationname">
@@ -1316,7 +1326,7 @@
1316
1326
  <value>commentaryOf</value>
1317
1327
  <value>hasCommentary</value>
1318
1328
  <value>related</value>
1319
- <value>complements</value>
1329
+ <value>hasComplement</value>
1320
1330
  <value>complementOf</value>
1321
1331
  <value>obsoletes</value>
1322
1332
  <value>obsoletedBy</value>
@@ -66,6 +66,7 @@
66
66
  <value>caution</value>
67
67
  <value>statement</value>
68
68
  <value>editorial</value>
69
+ <value>box</value>
69
70
  </choice>
70
71
  </define>
71
72
  <define name="index">
@@ -1577,10 +1578,13 @@
1577
1578
  <zeroOrMore>
1578
1579
  <ref name="indexsect"/>
1579
1580
  </zeroOrMore>
1581
+ <optional>
1582
+ <ref name="colophon"/>
1583
+ </optional>
1580
1584
  </element>
1581
1585
  </define>
1582
1586
  <define name="misccontainer">
1583
- <element name="misc-container">
1587
+ <element name="metanorma-extension">
1584
1588
  <oneOrMore>
1585
1589
  <ref name="AnyElement"/>
1586
1590
  </oneOrMore>
@@ -1599,6 +1603,13 @@
1599
1603
  </oneOrMore>
1600
1604
  </element>
1601
1605
  </define>
1606
+ <define name="colophon">
1607
+ <element name="colophon">
1608
+ <oneOrMore>
1609
+ <ref name="content"/>
1610
+ </oneOrMore>
1611
+ </element>
1612
+ </define>
1602
1613
  <define name="foreword">
1603
1614
  <element name="foreword">
1604
1615
  <ref name="Content-Section"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ribose
3
- VERSION = "2.2.2".freeze
3
+ VERSION = "2.2.4".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ribose
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.2.2
4
+ version: 2.2.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2022-12-30 00:00:00.000000000 Z
11
+ date: 2023-02-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic