metanorma-cc 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: 9124c14de0cd844286cab8171a3d7305ba2ed3685b3677e98919cc3590bd2aac
4
- data.tar.gz: 2640468029927350d7053f782a13651037176f9f6e020cff210393d7d9f927c0
3
+ metadata.gz: e8bc0f7fc89706fda4659178578d0dc36df860bf39cfa922833b56b6cc5a3244
4
+ data.tar.gz: '008c0041602511aa48595895c034f657e9550811630016f09bafb0a6a03f7694'
5
5
  SHA512:
6
- metadata.gz: 815f627fb1c06b7d1bd988a23f61e00e07c5508d11eb1ef132377e45ada04d7bed86cf9f1c7beb94c43242096bd20ae9ef34c7a61d5811245da35479f05d16cd
7
- data.tar.gz: d8fb0071eda29cf42cea9c63982f9306027bb181bd382caa86b8ee4488d05788d136bbd035ec7a345917c503dfdcb925721d9a9be6e7bb27b5915dd853ead5ad
6
+ metadata.gz: 1015ad2790e861ecc8c5a987e7d9d94fb84527ba5d7fa1bf6963fe1d2282a3d0dec75add166a26a5fcbf1f7d9fed85af3ce4488953057926d4c5d06257759e43
7
+ data.tar.gz: 2292e0873343ea9800cc3955c3a9c9efea5533bceff1c4ecbca9536d3c82d4017c4db9777610d5d9e9f30a6e70ab2b0fb4e2130451399d46742e4b8d755d89f8
@@ -620,14 +620,14 @@
620
620
  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 -->
621
621
 
622
622
  <!--
623
- <misc-container>
623
+ <metanorma-extension>
624
624
  <presentation-metadata>
625
625
  <papersize>letter</papersize>
626
626
  </presentation-metadata>
627
- </misc-container>
627
+ </metanorma-extension>
628
628
  -->
629
629
 
630
- <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'])))"/>
630
+ <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'])))"/>
631
631
  <xsl:variable name="papersize_width_">
632
632
  <xsl:choose>
633
633
  <xsl:when test="$papersize = 'letter'">215.9</xsl:when>
@@ -744,7 +744,7 @@
744
744
  <xsl:variable name="titles" select="xalan:nodeset($titles_)"/>
745
745
 
746
746
  <xsl:variable name="title-list-tables">
747
- <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
747
+ <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
748
748
  <xsl:value-of select="$toc_table_title"/>
749
749
  <xsl:if test="normalize-space($toc_table_title) = ''">
750
750
  <xsl:call-template name="getTitle">
@@ -754,7 +754,7 @@
754
754
  </xsl:variable>
755
755
 
756
756
  <xsl:variable name="title-list-figures">
757
- <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
757
+ <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
758
758
  <xsl:value-of select="$toc_figure_title"/>
759
759
  <xsl:if test="normalize-space($toc_figure_title) = ''">
760
760
  <xsl:call-template name="getTitle">
@@ -764,7 +764,7 @@
764
764
  </xsl:variable>
765
765
 
766
766
  <xsl:variable name="title-list-recommendations">
767
- <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
767
+ <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
768
768
  <xsl:value-of select="$toc_requirement_title"/>
769
769
  <xsl:if test="normalize-space($toc_requirement_title) = ''">
770
770
  <xsl:call-template name="getTitle">
@@ -836,7 +836,7 @@
836
836
  <xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
837
837
 
838
838
  <xsl:variable name="additional_fonts_">
839
- <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']">
839
+ <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']">
840
840
  <xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
841
841
  </xsl:for-each>
842
842
  </xsl:variable>
@@ -1875,10 +1875,10 @@
1875
1875
 
1876
1876
  <xsl:template name="processTablesFigures_Contents">
1877
1877
  <xsl:param name="always"/>
1878
- <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
1878
+ <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
1879
1879
  <xsl:call-template name="processTables_Contents"/>
1880
1880
  </xsl:if>
1881
- <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
1881
+ <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
1882
1882
  <xsl:call-template name="processFigures_Contents"/>
1883
1883
  </xsl:if>
1884
1884
  </xsl:template>
@@ -2215,6 +2215,8 @@
2215
2215
  <xsl:attribute name="margin-right"><xsl:value-of select="$margin-side"/>mm</xsl:attribute>
2216
2216
  </xsl:if>
2217
2217
 
2218
+ <xsl:call-template name="setBordersTableArray"/>
2219
+
2218
2220
  </xsl:element>
2219
2221
  </xsl:variable>
2220
2222
 
@@ -2312,7 +2314,7 @@
2312
2314
  <xsl:variable name="isDeleted" select="@deleted"/>
2313
2315
 
2314
2316
  <xsl:choose>
2315
- <xsl:when test="@width">
2317
+ <xsl:when test="@width and @width != 'full-page-width' and @width != 'text-width'">
2316
2318
 
2317
2319
  <!-- centered table when table name is centered (see table-name-style) -->
2318
2320
 
@@ -2359,6 +2361,10 @@
2359
2361
 
2360
2362
  </xsl:template>
2361
2363
 
2364
+ <xsl:template name="setBordersTableArray">
2365
+
2366
+ </xsl:template>
2367
+
2362
2368
  <xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
2363
2369
  <xsl:param name="continued"/>
2364
2370
  <xsl:if test="normalize-space() != ''">
@@ -2633,6 +2639,7 @@
2633
2639
  This makes columns with large differences between minimum and maximum widths wider than columns with smaller differences. -->
2634
2640
  <xsl:when test="(@width_max &gt; $page_width and @width_min &lt; $page_width) or (@width_min &gt;= $page_width)">
2635
2641
  <!-- difference between the available space and the minimum table width -->
2642
+ <_width_min><xsl:value-of select="@width_min"/></_width_min>
2636
2643
  <xsl:variable name="W" select="$page_width - @width_min"/>
2637
2644
  <W><xsl:value-of select="$W"/></W>
2638
2645
  <!-- difference between maximum and minimum width of the table -->
@@ -2833,6 +2840,8 @@
2833
2840
  <fo:table-row>
2834
2841
  <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
2835
2842
 
2843
+ <xsl:call-template name="setBordersTableArray"/>
2844
+
2836
2845
  <!-- fn will be processed inside 'note' processing -->
2837
2846
 
2838
2847
  <!-- for BSI (not PAS) display Notes before footnotes -->
@@ -2954,6 +2963,8 @@
2954
2963
  <xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
2955
2964
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
2956
2965
 
2966
+ <xsl:call-template name="setBordersTableArray"/>
2967
+
2957
2968
  <xsl:call-template name="setTableRowAttributes"/>
2958
2969
 
2959
2970
  <xsl:apply-templates/>
@@ -2977,6 +2988,8 @@
2977
2988
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2978
2989
  </xsl:if>
2979
2990
 
2991
+ <xsl:call-template name="setBordersTableArray"/>
2992
+
2980
2993
  <xsl:call-template name="setTableRowAttributes"/>
2981
2994
  <xsl:apply-templates/>
2982
2995
  </fo:table-row>
@@ -2996,6 +3009,8 @@
2996
3009
  <xsl:with-param name="default">center</xsl:with-param>
2997
3010
  </xsl:call-template>
2998
3011
 
3012
+ <xsl:call-template name="setBordersTableArray"/>
3013
+
2999
3014
  <xsl:if test="$lang = 'ar'">
3000
3015
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
3001
3016
  </xsl:if>
@@ -3048,6 +3063,8 @@
3048
3063
 
3049
3064
  <!-- bsi -->
3050
3065
 
3066
+ <xsl:call-template name="setBordersTableArray"/>
3067
+
3051
3068
  <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
3052
3069
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
3053
3070
  </xsl:if>
@@ -3240,17 +3257,20 @@
3240
3257
  <xsl:for-each select="xalan:nodeset($references)//fn">
3241
3258
  <xsl:variable name="reference" select="@reference"/>
3242
3259
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
3243
- <fo:block xsl:use-attribute-sets="table-fn-style">
3244
3260
 
3245
- <fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
3261
+ <fo:block xsl:use-attribute-sets="table-fn-style">
3246
3262
 
3247
- <xsl:value-of select="@reference"/>
3263
+ <fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
3264
+
3265
+ <xsl:value-of select="@reference"/>
3266
+
3267
+ </fo:inline>
3268
+ <fo:inline xsl:use-attribute-sets="table-fn-body-style">
3269
+ <xsl:copy-of select="./node()"/>
3270
+ </fo:inline>
3271
+
3272
+ </fo:block>
3248
3273
 
3249
- </fo:inline>
3250
- <fo:inline xsl:use-attribute-sets="table-fn-body-style">
3251
- <xsl:copy-of select="./node()"/>
3252
- </fo:inline>
3253
- </fo:block>
3254
3274
  </xsl:if>
3255
3275
  </xsl:for-each>
3256
3276
  </xsl:template>
@@ -4189,12 +4209,12 @@
4189
4209
  <xsl:param name="value"/>
4190
4210
  <xsl:variable name="add_width" select="string-length($value) * 20"/>
4191
4211
  <xsl:variable name="maxwidth" select="60 + $add_width"/>
4192
- <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-20%"><!-- alignment-baseline="middle" -->
4193
- <xsl:attribute name="height">5mm</xsl:attribute>
4212
+ <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-10%"><!-- alignment-baseline="middle" -->
4213
+ <xsl:attribute name="height">3.5mm</xsl:attribute> <!-- 5mm -->
4194
4214
  <xsl:attribute name="content-width">100%</xsl:attribute>
4195
4215
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4196
4216
  <xsl:attribute name="scaling">uniform</xsl:attribute>
4197
- <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
4217
+ <!-- <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
4198
4218
  <g>
4199
4219
  <xsl:if test="$type = 'closing' or $type = 'end'">
4200
4220
  <xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
@@ -4208,6 +4228,27 @@
4208
4228
  </xsl:if>
4209
4229
  <xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
4210
4230
  </text>
4231
+ </svg> -->
4232
+ <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
4233
+ <g>
4234
+ <xsl:if test="$type = 'closing' or $type = 'end'">
4235
+ <xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
4236
+ </xsl:if>
4237
+ <polyline points="0,2.5 {$maxwidth},2.5 {$maxwidth + 20},40 {$maxwidth},77.5 0,77.5" stroke="black" stroke-width="5" fill="white"/>
4238
+ <line x1="9.5" y1="0" x2="9.5" y2="80" stroke="black" stroke-width="19"/>
4239
+ </g>
4240
+ <xsl:variable name="text_x">
4241
+ <xsl:choose>
4242
+ <xsl:when test="$type = 'closing' or $type = 'end'">28</xsl:when>
4243
+ <xsl:otherwise>22</xsl:otherwise>
4244
+ </xsl:choose>
4245
+ </xsl:variable>
4246
+ <text font-family="Arial" x="{$text_x}" y="50" font-size="40pt">
4247
+ <xsl:value-of select="$kind"/>
4248
+ </text>
4249
+ <text font-family="Arial" x="{$text_x + 33}" y="65" font-size="38pt">
4250
+ <xsl:value-of select="$value"/>
4251
+ </text>
4211
4252
  </svg>
4212
4253
  </fo:instream-foreign-object>
4213
4254
  </xsl:template>
@@ -4462,18 +4503,23 @@
4462
4503
 
4463
4504
  <xsl:template name="add-zero-spaces-java">
4464
4505
  <xsl:param name="text" select="."/>
4465
- <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space, arrow right -->
4466
- <xsl:variable name="text1" select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |→)','$1​')"/>
4506
+
4507
+ <!-- add zero-width space (#x200B) after dot with next non-digit -->
4508
+ <xsl:variable name="text1" select="java:replaceAll(java:java.lang.String.new($text),'(\.)([^\d\s])','$1​$2')"/>
4509
+ <!-- add zero-width space (#x200B) after characters: dash, equal, underscore, em dash, thin space, arrow right -->
4510
+ <xsl:variable name="text2" select="java:replaceAll(java:java.lang.String.new($text1),'(-|=|_|—| |→)','$1​')"/>
4511
+ <!-- add zero-width space (#x200B) after characters: colon, if there aren't digits after -->
4512
+ <xsl:variable name="text3" select="java:replaceAll(java:java.lang.String.new($text2),'(:)(\D)','$1​$2')"/>
4467
4513
  <!-- add zero-width space (#x200B) after characters: 'great than' -->
4468
- <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' -->
4514
+ <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' -->
4469
4515
  <!-- add zero-width space (#x200B) before characters: 'less than' -->
4470
- <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' -->
4516
+ <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' -->
4471
4517
  <!-- add zero-width space (#x200B) before character: { -->
4472
- <xsl:variable name="text4" select="java:replaceAll(java:java.lang.String.new($text3), '(?&lt;!\W)(\{)', '​$1')"/> <!-- negative lookbehind: '{' not preceeded by 'punctuation char' -->
4518
+ <xsl:variable name="text6" select="java:replaceAll(java:java.lang.String.new($text5), '(?&lt;!\W)(\{)', '​$1')"/> <!-- negative lookbehind: '{' not preceeded by 'punctuation char' -->
4473
4519
  <!-- add zero-width space (#x200B) after character: , -->
4474
- <xsl:variable name="text5" select="java:replaceAll(java:java.lang.String.new($text4), '(\,)(?!\d)', '$1​')"/> <!-- negative lookahead: ',' not followed by digit -->
4520
+ <xsl:variable name="text7" select="java:replaceAll(java:java.lang.String.new($text6), '(\,)(?!\d)', '$1​')"/> <!-- negative lookahead: ',' not followed by digit -->
4475
4521
 
4476
- <xsl:value-of select="$text5"/>
4522
+ <xsl:value-of select="$text7"/>
4477
4523
  </xsl:template>
4478
4524
 
4479
4525
  <xsl:template name="add-zero-spaces-link-java">
@@ -4482,7 +4528,9 @@
4482
4528
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$1')"/> <!-- http://. https:// or www. -->
4483
4529
  <xsl:variable name="url_continue" select="java:replaceAll(java:java.lang.String.new($text), $regex_url_start, '$2')"/>
4484
4530
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
4485
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1​')"/>
4531
+ <xsl:variable name="url" select="java:replaceAll(java:java.lang.String.new($url_continue),'(-|\.|:|=|_|—| |,|/)','$1​')"/>
4532
+ <!-- remove zero-width space at the end -->
4533
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($url), '​$', '')"/>
4486
4534
  </xsl:template>
4487
4535
 
4488
4536
  <!-- add zero space after dash character (for table's entries) -->
@@ -4619,7 +4667,7 @@
4619
4667
  </xsl:copy>
4620
4668
  </xsl:template>
4621
4669
 
4622
- <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">
4670
+ <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">
4623
4671
  <xsl:copy>
4624
4672
  <xsl:copy-of select="@*"/>
4625
4673
  <p>
@@ -4695,6 +4743,14 @@
4695
4743
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),' {2,}',' ')"/>
4696
4744
  </xsl:template>
4697
4745
 
4746
+ <xsl:template match="*[local-name()='th' or local-name()='td']//*[local-name() = 'ol' or local-name() = 'ul']" mode="table-without-br">
4747
+ <xsl:apply-templates mode="table-without-br"/>
4748
+ </xsl:template>
4749
+
4750
+ <xsl:template match="*[local-name()='th' or local-name()='td']//*[local-name() = 'li']" mode="table-without-br">
4751
+ <xsl:apply-templates mode="table-without-br"/>
4752
+ </xsl:template>
4753
+
4698
4754
  <!-- mode="table-without-br" -->
4699
4755
  <!-- ================================== -->
4700
4756
  <!-- END: Step 0. replace <br/> to <p>...</p> -->
@@ -5508,7 +5564,7 @@
5508
5564
 
5509
5565
  <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
5510
5566
 
5511
- <fo:block-container margin-left="0mm">
5567
+ <fo:block-container margin-left="0mm" margin-right="0mm">
5512
5568
 
5513
5569
  <fo:block>
5514
5570
 
@@ -5682,11 +5738,14 @@
5682
5738
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
5683
5739
  </xsl:call-template>
5684
5740
 
5741
+ <!-- Example: Dimensions in millimeters -->
5742
+ <xsl:apply-templates select="*[local-name() = 'note'][@type = 'units']"/>
5743
+
5685
5744
  <fo:block xsl:use-attribute-sets="figure-style">
5686
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5745
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
5687
5746
  </fo:block>
5688
5747
  <xsl:call-template name="fn_display_figure"/>
5689
- <xsl:for-each select="*[local-name() = 'note']">
5748
+ <xsl:for-each select="*[local-name() = 'note'][not(@type = 'units')]">
5690
5749
  <xsl:call-template name="note"/>
5691
5750
  </xsl:for-each>
5692
5751
 
@@ -5943,24 +6002,47 @@
5943
6002
 
5944
6003
  </xsl:when>
5945
6004
  <xsl:otherwise>
5946
- <fo:block xsl:use-attribute-sets="image-style">
5947
- <fo:instream-foreign-object fox:alt-text="{$alt-text}">
5948
- <xsl:attribute name="width">100%</xsl:attribute>
5949
- <xsl:attribute name="content-height">100%</xsl:attribute>
5950
- <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
5951
- <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
5952
- <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
5953
- <!-- effective height 297 - 27.4 - 13 = 256.6 -->
5954
- <!-- effective width 210 - 12.5 - 25 = 172.5 -->
5955
- <!-- effective height / width = 1.48, 1.4 - with title -->
5956
- <xsl:if test="$svg_height &gt; ($svg_width * 1.4)"> <!-- for images with big height -->
5957
- <xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
5958
- <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
5959
- </xsl:if>
5960
- <xsl:attribute name="scaling">uniform</xsl:attribute>
5961
- <xsl:copy-of select="$svg_content"/>
5962
- </fo:instream-foreign-object>
5963
- </fo:block>
6005
+
6006
+ <xsl:variable name="element">
6007
+ <xsl:choose>
6008
+ <xsl:when test="ancestor::*[local-name() = 'tr'] and $isGenerateTableIF = 'true'">
6009
+ <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
6010
+ </xsl:when>
6011
+ <xsl:otherwise>
6012
+ <fo:block xsl:use-attribute-sets="image-style">
6013
+ <xsl:if test="ancestor::*[local-name() = 'dt']">
6014
+ <xsl:attribute name="text-align">left</xsl:attribute>
6015
+ </xsl:if>
6016
+ </fo:block>
6017
+ </xsl:otherwise>
6018
+ </xsl:choose>
6019
+ </xsl:variable>
6020
+
6021
+ <xsl:for-each select="xalan:nodeset($element)/*">
6022
+ <xsl:copy>
6023
+ <xsl:copy-of select="@*"/>
6024
+ <!-- <fo:block xsl:use-attribute-sets="image-style"> -->
6025
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}">
6026
+ <xsl:if test="$isGenerateTableIF = 'false'">
6027
+ <xsl:attribute name="width">100%</xsl:attribute>
6028
+ </xsl:if>
6029
+ <xsl:attribute name="content-height">100%</xsl:attribute>
6030
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
6031
+ <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
6032
+ <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
6033
+ <!-- effective height 297 - 27.4 - 13 = 256.6 -->
6034
+ <!-- effective width 210 - 12.5 - 25 = 172.5 -->
6035
+ <!-- effective height / width = 1.48, 1.4 - with title -->
6036
+ <xsl:if test="$svg_height &gt; ($svg_width * 1.4)"> <!-- for images with big height -->
6037
+ <xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
6038
+ <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
6039
+ </xsl:if>
6040
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
6041
+ <xsl:copy-of select="$svg_content"/>
6042
+ </fo:instream-foreign-object>
6043
+ <!-- </fo:block> -->
6044
+ </xsl:copy>
6045
+ </xsl:for-each>
5964
6046
  </xsl:otherwise>
5965
6047
  </xsl:choose>
5966
6048
  </xsl:template>
@@ -6052,6 +6134,13 @@
6052
6134
  </xsl:for-each>
6053
6135
  </xsl:template>
6054
6136
 
6137
+ <!-- For the structures like: <dt><image src="" mimetype="image/svg+xml" height="" width=""><svg xmlns="http://www.w3.org/2000/svg" ... -->
6138
+ <xsl:template match="*[local-name() != 'figure']/*[local-name() = 'image'][*[local-name() = 'svg']]" priority="3">
6139
+ <xsl:for-each select="*[local-name() = 'svg']">
6140
+ <xsl:call-template name="image_svg"/>
6141
+ </xsl:for-each>
6142
+ </xsl:template>
6143
+
6055
6144
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
6056
6145
  <xsl:variable name="svg_content" select="document(@src)"/>
6057
6146
  <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
@@ -6190,6 +6279,8 @@
6190
6279
  <xsl:value-of select="."/>
6191
6280
  </xsl:template>
6192
6281
 
6282
+ <xsl:template match="*[local-name() = 'add'][starts-with(., $ace_tag)]/text()" mode="bookmarks" priority="3"/>
6283
+
6193
6284
  <xsl:template match="node()" mode="contents">
6194
6285
  <xsl:apply-templates mode="contents"/>
6195
6286
  </xsl:template>
@@ -6497,7 +6588,15 @@
6497
6588
  <xsl:value-of select="@section"/>
6498
6589
  <xsl:text> </xsl:text>
6499
6590
  </xsl:if>
6500
- <xsl:value-of select="normalize-space(title)"/>
6591
+ <xsl:variable name="title">
6592
+ <xsl:for-each select="title/node()">
6593
+ <xsl:choose>
6594
+ <xsl:when test="local-name() = 'add' and starts-with(., $ace_tag)"><!-- skip --></xsl:when>
6595
+ <xsl:otherwise><xsl:value-of select="."/></xsl:otherwise>
6596
+ </xsl:choose>
6597
+ </xsl:for-each>
6598
+ </xsl:variable>
6599
+ <xsl:value-of select="normalize-space($title)"/>
6501
6600
  </fo:bookmark-title>
6502
6601
  <xsl:apply-templates mode="bookmark"/>
6503
6602
  </fo:bookmark>
@@ -6523,6 +6622,12 @@
6523
6622
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
6524
6623
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']"/>
6525
6624
 
6625
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note'][@type = 'units'] | *[local-name() = 'image']/*[local-name() = 'note'][@type = 'units']" priority="2">
6626
+ <fo:block text-align="right" keep-with-next="always">
6627
+ <xsl:apply-templates/>
6628
+ </fo:block>
6629
+ </xsl:template>
6630
+
6526
6631
  <!-- ====== -->
6527
6632
  <!-- ====== -->
6528
6633
  <xsl:template match="*[local-name() = 'title']" mode="contents_item">
@@ -6672,6 +6777,10 @@
6672
6777
  </xsl:for-each>
6673
6778
  </xsl:template>
6674
6779
 
6780
+ <xsl:template match="*[local-name() = 'add'][starts-with(., $ace_tag)]/text()" mode="contents_item" priority="2">
6781
+ <xsl:value-of select="."/>
6782
+ </xsl:template>
6783
+
6675
6784
  <!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
6676
6785
  <xsl:template match="*[local-name() = 'span']" mode="contents_item">
6677
6786
  <xsl:apply-templates mode="contents_item"/>
@@ -6681,7 +6790,7 @@
6681
6790
  <!-- sourcecode -->
6682
6791
  <!-- =============== -->
6683
6792
 
6684
- <xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'source-highlighter-css']"/>
6793
+ <xsl:variable name="source-highlighter-css_" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'source-highlighter-css']"/>
6685
6794
  <xsl:variable name="sourcecode_css_" select="java:org.metanorma.fop.Util.parseCSS($source-highlighter-css_)"/>
6686
6795
  <xsl:variable name="sourcecode_css" select="xalan:nodeset($sourcecode_css_)"/>
6687
6796
 
@@ -8747,8 +8856,8 @@
8747
8856
 
8748
8857
  <xsl:variable name="toc_level">
8749
8858
  <!-- https://www.metanorma.org/author/ref/document-attributes/ -->
8750
- <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:-->
8751
- <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 -->
8859
+ <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:-->
8860
+ <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 -->
8752
8861
  <xsl:choose>
8753
8862
  <xsl:when test="$htmltoclevels != ''"><xsl:value-of select="number($htmltoclevels)"/></xsl:when> <!-- if there is value in xml -->
8754
8863
  <xsl:when test="$toclevels != ''"><xsl:value-of select="number($toclevels)"/></xsl:when> <!-- if there is value in xml -->
@@ -8900,7 +9009,6 @@
8900
9009
  <xsl:if test="@type = 'editorial'">
8901
9010
  <xsl:attribute name="color">green</xsl:attribute>
8902
9011
  <xsl:attribute name="font-weight">normal</xsl:attribute>
8903
-
8904
9012
  <!-- <xsl:variable name="note-style">
8905
9013
  <style xsl:use-attribute-sets="note-style"></style>
8906
9014
  </xsl:variable>
@@ -9745,6 +9853,7 @@
9745
9853
  <xsl:choose>
9746
9854
  <xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
9747
9855
  <xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
9856
+ <xsl:when test="$align = 'justified'">justify</xsl:when>
9748
9857
  <xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
9749
9858
  <xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
9750
9859
  <xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
@@ -922,6 +922,10 @@ p.Biblio:before, p.NormRef:before {
922
922
  max-width: 100%;
923
923
  height: auto; }
924
924
 
925
+ table div.figure {
926
+ padding: 0;
927
+ margin: 0; }
928
+
925
929
  .SourceTitle {
926
930
  font-weight: 700;
927
931
  font-size: 1em;
@@ -215,6 +215,12 @@ p.Biblio:before, p.NormRef:before {
215
215
  @include monospaceBlockStyle();
216
216
  }
217
217
 
218
+ table div.figure {
219
+ padding: 0;
220
+ margin: 0;
221
+ }
222
+
223
+
218
224
  .SourceTitle {
219
225
  @include blockTitle();
220
226
  }
@@ -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 CC
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-cc
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