metanorma-csa 2.5.4 → 2.5.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 8360063811ebb744998ac0a3649a8a8ba9b4a7cac02cdbf456820fe5f02601d1
4
- data.tar.gz: 8ff5935509555602938f4884f0d9342e647c826faab7ec897fb423f1ba578c31
3
+ metadata.gz: 36b52f4b3444d0cbcd89254b5a8610a9af1f8fb63cc9ba20b07a211a93eec13c
4
+ data.tar.gz: 21a1c124c59be971f99aba0872b3297b41d21cb5bae424be07670eac8863ee11
5
5
  SHA512:
6
- metadata.gz: e1b138147e1f6326ee440d2ab98bdd96bbe0d9d9f1af270634a1669a41ba07967c7652fb9760b11528d6ae7345166ed3b8835da1149a211a7e87d0c80127234b
7
- data.tar.gz: 772bf908991c5010c66c693d4705c13b31b5b67b5cd237e02e68a378cbd2d4b1cd331123f754f27f80ce56c0cf5183723caec702ebab9913f57ba823c5081ce6
6
+ metadata.gz: e1767135930059c7ad65765dc32a45916e70d7114febee345cc48a3915c3878af842f15cceb308f8abfe0a48a7295f440457693dd99d7417592f4b5edf74bebb
7
+ data.tar.gz: 7d037aa690673ddec0eb1ded7b0c831e2c643f6892c953f4569eda91acb46640a4cb14accb6bcbd3eb4a7a05eb584b4c594291aef75d1799ae8c28663a0f8a1f
@@ -3993,10 +3993,14 @@
3993
3993
  <xsl:variable name="fn_styles">
3994
3994
  <xsl:choose>
3995
3995
  <xsl:when test="ancestor::*[local-name() = 'bibitem']">
3996
- <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style"/>
3996
+ <fn_styles xsl:use-attribute-sets="bibitem-note-fn-style">
3997
+
3998
+ </fn_styles>
3997
3999
  </xsl:when>
3998
4000
  <xsl:otherwise>
3999
- <fn_styles xsl:use-attribute-sets="fn-num-style"/>
4001
+ <fn_styles xsl:use-attribute-sets="fn-num-style">
4002
+
4003
+ </fn_styles>
4000
4004
  </xsl:otherwise>
4001
4005
  </xsl:choose>
4002
4006
  </xsl:variable>
@@ -4135,6 +4139,11 @@
4135
4139
 
4136
4140
  <xsl:value-of select="@reference"/>
4137
4141
 
4142
+ <!-- commented https://github.com/metanorma/isodoc/issues/614 -->
4143
+ <!-- <xsl:if test="$namespace = 'itu'">
4144
+ <xsl:text>)</xsl:text>
4145
+ </xsl:if> -->
4146
+
4138
4147
  </fo:inline>
4139
4148
  <fo:inline xsl:use-attribute-sets="table-fn-body-style">
4140
4149
  <xsl:copy-of select="./node()"/>
@@ -4144,7 +4153,7 @@
4144
4153
 
4145
4154
  </xsl:if>
4146
4155
  </xsl:for-each>
4147
- </xsl:template>
4156
+ </xsl:template> <!-- table_fn_display -->
4148
4157
 
4149
4158
  <xsl:template name="create_fn">
4150
4159
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
@@ -4172,8 +4181,10 @@
4172
4181
  <!-- EMD table's footnotes rendering -->
4173
4182
  <!-- ============================ -->
4174
4183
 
4184
+ <!-- ============================ -->
4175
4185
  <!-- figure's footnotes rendering -->
4176
- <xsl:template name="fn_display_figure">
4186
+ <!-- ============================ -->
4187
+ <xsl:template name="fn_display_figure"> <!-- figure_fn_display -->
4177
4188
 
4178
4189
  <!-- current figure id -->
4179
4190
  <xsl:variable name="figure_id_">
@@ -4286,9 +4297,28 @@
4286
4297
 
4287
4298
  </fo:block>
4288
4299
  </xsl:if>
4289
-
4290
4300
  </xsl:template> <!-- fn_display_figure -->
4291
4301
 
4302
+ <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
4303
+ <!-- figure's footnote label -->
4304
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'dl'][@key = 'true']/*[local-name() = 'dt']/ *[local-name() = 'p'][count(node()[normalize-space() != '']) = 1]/*[local-name() = 'sup']" priority="3">
4305
+ <xsl:variable name="key_iso">
4306
+
4307
+ </xsl:variable>
4308
+ <xsl:if test="normalize-space($key_iso) = 'true'">
4309
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
4310
+
4311
+ </xsl:if>
4312
+ <fo:inline xsl:use-attribute-sets="figure-fn-number-style"> <!-- id="{@id}" -->
4313
+ <!-- <xsl:value-of select="@reference"/> -->
4314
+ <xsl:apply-templates/>
4315
+ </fo:inline>
4316
+ </xsl:template>
4317
+
4318
+ <!-- ============================ -->
4319
+ <!-- END: figure's footnotes rendering -->
4320
+ <!-- ============================ -->
4321
+
4292
4322
  <!-- fn reference in the text rendering (for instance, 'some text 1) some text' ) -->
4293
4323
  <xsl:template match="*[local-name()='fn']">
4294
4324
  <fo:inline xsl:use-attribute-sets="fn-reference-style">
@@ -4304,6 +4334,10 @@
4304
4334
 
4305
4335
  <xsl:value-of select="@reference"/>
4306
4336
 
4337
+ <!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
4338
+ <!-- <xsl:if test="$namespace = 'jis'">
4339
+ <fo:inline font-weight="normal">)</fo:inline>
4340
+ </xsl:if> -->
4307
4341
  </fo:basic-link>
4308
4342
  </fo:inline>
4309
4343
  </xsl:template>
@@ -4430,17 +4464,22 @@
4430
4464
  </fo:block>
4431
4465
  </xsl:when> <!-- END: a few components -->
4432
4466
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
4433
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
4467
+ <!-- Presentation XML contains 'Key' caption, https://github.com/metanorma/isodoc/issues/607 -->
4468
+ <xsl:if test="not(preceding-sibling::*[1][local-name() = 'p' and @keep-with-next])"> <!-- for old Presentation XML -->
4434
4469
 
4435
- <xsl:call-template name="refine_figure_key_style"/>
4470
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
4436
4471
 
4437
- <xsl:variable name="title-key">
4438
- <xsl:call-template name="getLocalizedString">
4439
- <xsl:with-param name="key">key</xsl:with-param>
4440
- </xsl:call-template>
4441
- </xsl:variable>
4442
- <xsl:value-of select="$title-key"/>
4443
- </fo:block>
4472
+ <xsl:call-template name="refine_figure_key_style"/>
4473
+
4474
+ <xsl:variable name="title-key">
4475
+ <xsl:call-template name="getLocalizedString">
4476
+ <xsl:with-param name="key">key</xsl:with-param>
4477
+ </xsl:call-template>
4478
+ </xsl:variable>
4479
+ <xsl:value-of select="$title-key"/>
4480
+ </fo:block>
4481
+
4482
+ </xsl:if>
4444
4483
  </xsl:when> <!-- END: definition list in a figure -->
4445
4484
  </xsl:choose>
4446
4485
 
@@ -4626,6 +4665,14 @@
4626
4665
 
4627
4666
  </xsl:template> <!-- END: dl -->
4628
4667
 
4668
+ <!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
4669
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
4670
+ <fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
4671
+ <xsl:call-template name="refine_figure_key_style"/>
4672
+ <xsl:apply-templates/>
4673
+ </fo:block>
4674
+ </xsl:template>
4675
+
4629
4676
  <xsl:template name="refine_dl_formula_where_style">
4630
4677
 
4631
4678
  </xsl:template> <!-- refine_dl_formula_where_style -->
@@ -6658,6 +6705,39 @@
6658
6705
  </xsl:copy>
6659
6706
  </xsl:template>
6660
6707
 
6708
+ <xsl:template match="@*|node()" mode="mathml_linebreak">
6709
+ <xsl:copy>
6710
+ <xsl:apply-templates select="@*|node()" mode="mathml_linebreak"/>
6711
+ </xsl:copy>
6712
+ </xsl:template>
6713
+
6714
+ <!-- split math into two math -->
6715
+ <xsl:template match="mathml:mo[@linebreak] | mathml:mspace[@linebreak]" mode="mathml_linebreak">
6716
+ <xsl:variable name="math_elements_tree_">
6717
+ <xsl:for-each select="ancestor::*[ancestor-or-self::mathml:math]">
6718
+ <element pos="{position()}">
6719
+ <xsl:copy-of select="@*[local-name() != 'id']"/>
6720
+ <xsl:value-of select="name()"/>
6721
+ </element>
6722
+ </xsl:for-each>
6723
+ </xsl:variable>
6724
+
6725
+ <xsl:variable name="math_elements_tree" select="xalan:nodeset($math_elements_tree_)"/>
6726
+
6727
+ <xsl:call-template name="insertClosingElements">
6728
+ <xsl:with-param name="tree" select="$math_elements_tree"/>
6729
+ </xsl:call-template>
6730
+
6731
+ <xsl:element name="br" namespace="{$namespace_full}"/>
6732
+
6733
+ <xsl:call-template name="insertOpeningElements">
6734
+ <xsl:with-param name="tree" select="$math_elements_tree"/>
6735
+ <xsl:with-param name="xmlns">http://www.w3.org/1998/Math/MathML</xsl:with-param>
6736
+ <xsl:with-param name="add_continue">false</xsl:with-param>
6737
+ </xsl:call-template>
6738
+
6739
+ </xsl:template>
6740
+
6661
6741
  <!-- Examples:
6662
6742
  <stem type="AsciiMath">x = 1</stem>
6663
6743
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
@@ -6859,6 +6939,7 @@
6859
6939
  <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[local-name() = 'table' or local-name() = 'dl'])">
6860
6940
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
6861
6941
  </xsl:if>
6942
+
6862
6943
  <xsl:if test="parent::*[local-name() = 'add']">
6863
6944
  <xsl:call-template name="append_add-style"/>
6864
6945
  </xsl:if>
@@ -6908,9 +6989,11 @@
6908
6989
  </xsl:template>
6909
6990
 
6910
6991
  <xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"> <!-- show in 'stem' template -->
6992
+ <!-- https://github.com/metanorma/isodoc/issues/607
6911
6993
  <xsl:if test="normalize-space() != ''">
6912
- <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
6913
- </xsl:if>
6994
+ <xsl:text>(</xsl:text><xsl:apply-templates /><xsl:text>)</xsl:text>
6995
+ </xsl:if> -->
6996
+ <xsl:apply-templates/>
6914
6997
  </xsl:template>
6915
6998
 
6916
6999
  <!-- stem inside formula with name (with formula's number) -->
@@ -6967,48 +7050,48 @@
6967
7050
 
6968
7051
  <xsl:template match="*[local-name() = 'note']" name="note">
6969
7052
 
6970
- <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
7053
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
6971
7054
 
6972
- <xsl:call-template name="setBlockSpanAll"/>
7055
+ <xsl:call-template name="setBlockSpanAll"/>
6973
7056
 
6974
- <xsl:call-template name="refine_note-style"/>
7057
+ <xsl:call-template name="refine_note-style"/>
6975
7058
 
6976
- <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
7059
+ <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
6977
7060
 
6978
- <xsl:if test="ancestor::csa:ul or ancestor::csa:ol and not(ancestor::csa:note[1]/following-sibling::*)">
6979
- <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
6980
- </xsl:if>
7061
+ <xsl:if test="ancestor::csa:ul or ancestor::csa:ol and not(ancestor::csa:note[1]/following-sibling::*)">
7062
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
7063
+ </xsl:if>
6981
7064
 
6982
- <fo:block>
7065
+ <fo:block>
6983
7066
 
6984
- <xsl:call-template name="refine_note_block_style"/>
7067
+ <xsl:call-template name="refine_note_block_style"/>
6985
7068
 
6986
- <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
7069
+ <fo:inline xsl:use-attribute-sets="note-name-style" role="SKIP">
6987
7070
 
6988
- <xsl:call-template name="refine_note-name-style"/>
7071
+ <xsl:call-template name="refine_note-name-style"/>
6989
7072
 
6990
- <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
6991
- <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
6992
- <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
6993
- <xsl:call-template name="append_add-style"/>
6994
- </xsl:if>
7073
+ <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
7074
+ <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
7075
+ <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
7076
+ <xsl:call-template name="append_add-style"/>
7077
+ </xsl:if>
6995
7078
 
6996
- <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
6997
- <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
6998
- <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
6999
- <xsl:with-param name="skip">false</xsl:with-param>
7000
- </xsl:apply-templates>
7001
- </xsl:if>
7079
+ <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
7080
+ <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
7081
+ <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
7082
+ <xsl:with-param name="skip">false</xsl:with-param>
7083
+ </xsl:apply-templates>
7084
+ </xsl:if>
7002
7085
 
7003
- <xsl:apply-templates select="*[local-name() = 'name']"/>
7086
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
7004
7087
 
7005
- </fo:inline>
7088
+ </fo:inline>
7006
7089
 
7007
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
7008
- </fo:block>
7090
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
7091
+ </fo:block>
7009
7092
 
7010
- </fo:block-container>
7011
- </fo:block-container>
7093
+ </fo:block-container>
7094
+ </fo:block-container>
7012
7095
 
7013
7096
  </xsl:template>
7014
7097
 
@@ -7070,6 +7153,17 @@
7070
7153
  </xsl:when>
7071
7154
  <xsl:otherwise>
7072
7155
 
7156
+ <!-- https://github.com/metanorma/isodoc/issues/607 -->
7157
+ <!-- <xsl:if test="$namespace = 'ieee'">
7158
+ <xsl:text>—</xsl:text> em dash &#x2014;
7159
+ </xsl:if> -->
7160
+ <!-- <xsl:if test="$namespace = 'iho' or $namespace = 'gb' or $namespace = 'm3d' or $namespace = 'unece-rec' or $namespace = 'unece' or $namespace = 'rsd'">
7161
+ <xsl:text>:</xsl:text>
7162
+ </xsl:if> -->
7163
+
7164
+ <!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp'">
7165
+ <xsl:text> – </xsl:text> en dash &#x2013;
7166
+ </xsl:if> -->
7073
7167
  </xsl:otherwise>
7074
7168
  </xsl:choose>
7075
7169
  </xsl:variable>
@@ -7088,6 +7182,16 @@
7088
7182
  </xsl:when>
7089
7183
  <xsl:otherwise>
7090
7184
 
7185
+ <!-- https://github.com/metanorma/isodoc/issues/607 -->
7186
+ <!-- <xsl:if test="$namespace = 'ieee'">
7187
+ <xsl:text>—</xsl:text> em dash &#x2014;
7188
+ </xsl:if> -->
7189
+ <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'iso' or $namespace = 'iec' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' or $namespace = 'rsd' or $namespace = 'jcgm'">
7190
+ <xsl:text>:</xsl:text>
7191
+ </xsl:if> -->
7192
+ <!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'unece-rec' or $namespace = 'unece'">
7193
+ <xsl:text> – </xsl:text> en dash &#x2013;
7194
+ </xsl:if> -->
7091
7195
  </xsl:otherwise>
7092
7196
  </xsl:choose>
7093
7197
  </xsl:variable>
@@ -9255,7 +9359,7 @@
9255
9359
  <xsl:if test="normalize-space() != ''">
9256
9360
  <fo:inline xsl:use-attribute-sets="termexample-name-style">
9257
9361
  <xsl:call-template name="refine_termexample-name-style"/>
9258
- <xsl:apply-templates/>
9362
+ <xsl:apply-templates/> <!-- commented $namespace = 'ieee', https://github.com/metanorma/isodoc/issues/614-->
9259
9363
  </fo:inline>
9260
9364
  </xsl:if>
9261
9365
  </xsl:template>
@@ -9410,13 +9514,14 @@
9410
9514
  </xsl:when>
9411
9515
  <xsl:when test="contains(normalize-space($fo_element), 'block')">
9412
9516
  <fo:block xsl:use-attribute-sets="example-name-style">
9517
+
9413
9518
  <xsl:apply-templates/>
9414
9519
  </fo:block>
9415
9520
  </xsl:when>
9416
9521
  <xsl:otherwise>
9417
9522
  <fo:inline xsl:use-attribute-sets="example-name-style">
9418
9523
  <xsl:call-template name="refine_example-name-style"/>
9419
- <xsl:apply-templates/>
9524
+ <xsl:apply-templates/> <!-- $namespace = 'ieee', see https://github.com/metanorma/isodoc/issues/614 -->
9420
9525
  </fo:inline>
9421
9526
  </xsl:otherwise>
9422
9527
  </xsl:choose>
@@ -9425,6 +9530,7 @@
9425
9530
 
9426
9531
  <xsl:template match="*[local-name() = 'table']/*[local-name() = 'example']/*[local-name() = 'name']">
9427
9532
  <fo:inline xsl:use-attribute-sets="example-name-style">
9533
+
9428
9534
  <xsl:apply-templates/>
9429
9535
  </fo:inline>
9430
9536
  </xsl:template>
@@ -9597,15 +9703,17 @@
9597
9703
 
9598
9704
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
9599
9705
  <fo:block role="BlockQuote">
9600
- <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
9706
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source') and not(local-name() = 'attribution')]"/> <!-- process all nested nodes, except author and source -->
9601
9707
  </fo:block>
9602
9708
  </fo:block-container>
9603
9709
  </fo:block-container>
9604
- <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
9710
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source'] or *[local-name() = 'attribution']">
9605
9711
  <fo:block xsl:use-attribute-sets="quote-source-style">
9606
9712
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
9607
9713
  <xsl:apply-templates select="*[local-name() = 'author']"/>
9608
9714
  <xsl:apply-templates select="*[local-name() = 'source']"/>
9715
+ <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
9716
+ <xsl:apply-templates select="*[local-name() = 'attribution']/*[local-name() = 'p']/node()"/>
9609
9717
  </fo:block>
9610
9718
  </xsl:if>
9611
9719
 
@@ -9627,9 +9735,13 @@
9627
9735
  </xsl:template>
9628
9736
 
9629
9737
  <xsl:template match="*[local-name() = 'author']">
9630
- <xsl:text>— </xsl:text>
9738
+ <xsl:if test="local-name(..) = 'quote'"> <!-- for old Presentation XML, https://github.com/metanorma/isodoc/issues/607 -->
9739
+ <xsl:text>— </xsl:text>
9740
+ </xsl:if>
9631
9741
  <xsl:apply-templates/>
9632
9742
  </xsl:template>
9743
+
9744
+ <xsl:template match="*[local-name() = 'quote']//*[local-name() = 'referenceFrom']"/>
9633
9745
  <!-- ====== -->
9634
9746
  <!-- ====== -->
9635
9747
 
@@ -9795,20 +9907,26 @@
9795
9907
 
9796
9908
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
9797
9909
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
9910
+
9798
9911
  <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
9799
9912
  </fo:block>
9800
9913
  </xsl:if>
9801
9914
 
9802
9915
  <fo:block xsl:use-attribute-sets="preferred-term-style" role="SKIP">
9803
9916
  <xsl:call-template name="setStyle_preferred"/>
9917
+
9804
9918
  <xsl:apply-templates/>
9805
9919
  </fo:block>
9806
9920
  </fo:block>
9807
9921
  </xsl:template>
9808
9922
 
9809
9923
  <xsl:template match="*[local-name() = 'domain']">
9924
+ <!-- https://github.com/metanorma/isodoc/issues/607
9810
9925
  <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
9811
- <xsl:text> </xsl:text>
9926
+ <xsl:text> </xsl:text> -->
9927
+ <xsl:if test="not(@hidden = 'true')">
9928
+ <xsl:apply-templates/>
9929
+ </xsl:if>
9812
9930
  </xsl:template>
9813
9931
 
9814
9932
  <xsl:template match="*[local-name() = 'admitted']">
@@ -9856,6 +9974,29 @@
9856
9974
  <!-- END definition -->
9857
9975
  <!-- ========== -->
9858
9976
 
9977
+ <xsl:variable name="reviews_">
9978
+ <xsl:for-each select="//*[local-name() = 'review'][@from]">
9979
+ <xsl:copy>
9980
+ <xsl:copy-of select="@from"/>
9981
+ <xsl:copy-of select="@id"/>
9982
+ </xsl:copy>
9983
+ </xsl:for-each>
9984
+ </xsl:variable>
9985
+ <xsl:variable name="reviews" select="xalan:nodeset($reviews_)"/>
9986
+
9987
+ <xsl:template name="addReviewHelper">
9988
+ <!-- if there is review with from="...", then add small helper block for Annot tag adding, see 'review' template -->
9989
+ <xsl:variable name="curr_id" select="@id"/>
9990
+ <xsl:variable name="review_id" select="normalize-space($reviews//*[local-name() = 'review'][@from = $curr_id]/@id)"/>
9991
+ <xsl:if test="$review_id != ''"> <!-- i.e. if review found -->
9992
+ <fo:block keep-with-next="always" line-height="0.1" id="{$review_id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$review_id}" fox:alt-text="Annot___{$review_id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
9993
+ </xsl:if>
9994
+ <!-- <fo:block>
9995
+ <curr_id><xsl:value-of select="$curr_id"/></curr_id>
9996
+ <xsl:copy-of select="$reviews"/>
9997
+ </fo:block> -->
9998
+ </xsl:template>
9999
+
9859
10000
  <!-- main sections -->
9860
10001
  <xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
9861
10002
 
@@ -9864,6 +10005,8 @@
9864
10005
 
9865
10006
  <xsl:call-template name="sections_element_style"/>
9866
10007
 
10008
+ <xsl:call-template name="addReviewHelper"/>
10009
+
9867
10010
  <xsl:apply-templates/>
9868
10011
  </fo:block>
9869
10012
 
@@ -9904,6 +10047,7 @@
9904
10047
 
9905
10048
  <fo:block>
9906
10049
  <xsl:call-template name="setId"/>
10050
+ <xsl:call-template name="addReviewHelper"/>
9907
10051
  <xsl:apply-templates/>
9908
10052
  </fo:block>
9909
10053
  </xsl:template>
@@ -9940,6 +10084,8 @@
9940
10084
 
9941
10085
  <xsl:call-template name="refine_clause_style"/>
9942
10086
 
10087
+ <xsl:call-template name="addReviewHelper"/>
10088
+
9943
10089
  <xsl:apply-templates/>
9944
10090
  </fo:block>
9945
10091
  </xsl:template>
@@ -9992,6 +10138,23 @@
9992
10138
 
9993
10139
  <xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
9994
10140
 
10141
+ <xsl:if test="1 = 1">
10142
+ <xsl:choose>
10143
+ <!-- if there isn't the attribute '@from', then -->
10144
+ <xsl:when test="$id_from = ''">
10145
+ <fo:block id="{@id}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@id}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
10146
+ </xsl:when>
10147
+ <!-- if there isn't element with id 'from', then create 'bookmark' here -->
10148
+ <xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
10149
+ <fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
10150
+ </xsl:when>
10151
+ <xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
10152
+ <fo:block id="{@from}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@from}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
10153
+ </xsl:when>
10154
+ </xsl:choose>
10155
+ </xsl:if>
10156
+
10157
+ <xsl:if test="1 = 2">
9995
10158
  <xsl:choose>
9996
10159
  <!-- if there isn't the attribute '@from', then -->
9997
10160
  <xsl:when test="$id_from = ''">
@@ -10005,6 +10168,7 @@
10005
10168
  <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
10006
10169
  </xsl:when>
10007
10170
  </xsl:choose>
10171
+ </xsl:if>
10008
10172
 
10009
10173
  </xsl:template>
10010
10174
 
@@ -11344,7 +11508,7 @@
11344
11508
  <!-- remove preprocess-xslt -->
11345
11509
  <xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_step1"/>
11346
11510
 
11347
- <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image'] | *[local-name() = 'sourcecode'] | *[local-name() = 'bibdata'] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
11511
+ <xsl:template match="*[local-name() = 'stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])] | *[local-name() = 'image'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'sourcecode'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'bibdata'][not(.//*[local-name() = 'passthrough'])] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
11348
11512
  <xsl:copy-of select="."/>
11349
11513
  </xsl:template>
11350
11514
 
@@ -11410,6 +11574,22 @@
11410
11574
  </xsl:choose>
11411
11575
  </xsl:template>
11412
11576
 
11577
+ <xsl:variable name="regex_passthrough">.*\bpdf\b.*</xsl:variable>
11578
+ <xsl:template match="*[local-name() = 'passthrough']" mode="update_xml_step1">
11579
+ <!-- <xsl:if test="contains(@formats, ' pdf ')"> -->
11580
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new(@formats), $regex_passthrough)) = 'true'">
11581
+ <xsl:apply-templates mode="update_xml_step1"/>
11582
+ </xsl:if>
11583
+ </xsl:template>
11584
+
11585
+ <!-- split math by element with @linebreak into maths -->
11586
+ <xsl:template match="mathml:math[.//mathml:mo[@linebreak] or .//mathml:mspace[@linebreak]]" mode="update_xml_step1">
11587
+ <xsl:variable name="maths">
11588
+ <xsl:apply-templates select="." mode="mathml_linebreak"/>
11589
+ </xsl:variable>
11590
+ <xsl:copy-of select="$maths"/>
11591
+ </xsl:template>
11592
+
11413
11593
  <!-- =========================================================================== -->
11414
11594
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
11415
11595
  <!-- =========================================================================== -->
@@ -11513,6 +11693,8 @@
11513
11693
 
11514
11694
  <xsl:template name="insertOpeningElements">
11515
11695
  <xsl:param name="tree"/>
11696
+ <xsl:param name="xmlns"/>
11697
+ <xsl:param name="add_continue">true</xsl:param>
11516
11698
  <xsl:for-each select="$tree//element">
11517
11699
  <xsl:text disable-output-escaping="yes">&lt;</xsl:text>
11518
11700
  <xsl:value-of select="."/>
@@ -11523,7 +11705,8 @@
11523
11705
  <xsl:value-of select="."/>
11524
11706
  <xsl:text>"</xsl:text>
11525
11707
  </xsl:for-each>
11526
- <xsl:if test="position() = 1"> continue="true"</xsl:if>
11708
+ <xsl:if test="position() = 1 and $add_continue = 'true'"> continue="true"</xsl:if>
11709
+ <xsl:if test="position() = 1 and $xmlns != ''"> xmlns="<xsl:value-of select="$xmlns"/>"</xsl:if>
11527
11710
  <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
11528
11711
  <xsl:if test="$debug = 'true'">
11529
11712
  <xsl:message>&lt;<xsl:value-of select="."/>&gt;</xsl:message>
@@ -12733,9 +12916,10 @@
12733
12916
  <xsl:template name="insertBackgroundPageImage">
12734
12917
  <xsl:param name="number">1</xsl:param>
12735
12918
  <xsl:param name="name">coverpage-image</xsl:param>
12919
+ <xsl:param name="suffix"/>
12736
12920
  <xsl:variable name="num" select="number($number)"/>
12737
12921
  <!-- background image -->
12738
- <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage_{$name}_{$number}_{generate-id()}">
12922
+ <fo:block-container absolute-position="fixed" left="0mm" top="0mm" font-size="0" id="__internal_layout__coverpage{$suffix}_{$name}_{$number}_{generate-id()}">
12739
12923
  <fo:block>
12740
12924
  <xsl:for-each select="/*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = $name][1]/*[local-name() = 'value']/*[local-name() = 'image'][$num]">
12741
12925
  <xsl:choose>
@@ -12801,16 +12985,29 @@
12801
12985
 
12802
12986
  <!-- END: insert cover page image -->
12803
12987
 
12988
+ <xsl:variable name="regex_ja_spec">[\uFF08\uFF09]</xsl:variable>
12804
12989
  <xsl:template name="insertVerticalChar">
12805
12990
  <xsl:param name="str"/>
12991
+ <xsl:param name="writing-mode">lr-tb</xsl:param>
12992
+ <xsl:param name="reference-orientation">90</xsl:param>
12806
12993
  <xsl:if test="string-length($str) &gt; 0">
12807
- <fo:inline-container writing-mode="lr-tb" text-align="center" alignment-baseline="central" reference-orientation="90" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
12994
+ <fo:inline-container text-align="center" alignment-baseline="central" width="1em" margin="0" padding="0" text-indent="0mm" last-line-end-indent="0mm" start-indent="0mm" end-indent="0mm">
12995
+ <xsl:if test="normalize-space($writing-mode) != ''">
12996
+ <xsl:attribute name="writing-mode"><xsl:value-of select="$writing-mode"/></xsl:attribute>
12997
+ <xsl:attribute name="reference-orientation">90</xsl:attribute>
12998
+ </xsl:if>
12999
+ <xsl:variable name="char" select="substring($str,1,1)"/>
13000
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new($char), concat('(', $regex_ja_spec, '{1,})'))) = 'true'">
13001
+ <xsl:attribute name="reference-orientation">0</xsl:attribute>
13002
+ </xsl:if>
12808
13003
  <fo:block-container width="1em">
12809
- <fo:block line-height="1em"><xsl:value-of select="substring($str,1,1)"/></fo:block>
13004
+ <fo:block line-height="1em"><xsl:value-of select="$char"/></fo:block>
12810
13005
  </fo:block-container>
12811
13006
  </fo:inline-container>
12812
13007
  <xsl:call-template name="insertVerticalChar">
12813
13008
  <xsl:with-param name="str" select="substring($str, 2)"/>
13009
+ <xsl:with-param name="writing-mode" select="$writing-mode"/>
13010
+ <xsl:with-param name="reference-orientation" select="$reference-orientation"/>
12814
13011
  </xsl:call-template>
12815
13012
  </xsl:if>
12816
13013
  </xsl:template>
@@ -1783,9 +1783,21 @@ that the `number` given for the series applies to the second iteration of number
1783
1783
  May be used to differentiate rendering of notes in bibliographies</a:documentation>
1784
1784
  </attribute>
1785
1785
  </optional>
1786
- <ref name="LocalizedMarkedUpString">
1786
+ <ref name="LocalizedStringAttributes">
1787
1787
  <a:documentation>The content of the note</a:documentation>
1788
1788
  </ref>
1789
+ <choice>
1790
+ <oneOrMore>
1791
+ <ref name="BasicBlockNoId">
1792
+ <a:documentation>Multiple blocks of content</a:documentation>
1793
+ </ref>
1794
+ </oneOrMore>
1795
+ <oneOrMore>
1796
+ <ref name="TextElement">
1797
+ <a:documentation>Single block of content</a:documentation>
1798
+ </ref>
1799
+ </oneOrMore>
1800
+ </choice>
1789
1801
  </element>
1790
1802
  </define>
1791
1803
  <define name="bibabstract">
@@ -9,7 +9,7 @@
9
9
  <include href="relaton-csa.rng"/>
10
10
  <include href="isodoc.rng">
11
11
  <start>
12
- <ref name="csand-standard"/>
12
+ <ref name="csa-standard"/>
13
13
  </start>
14
14
  <define name="FigureBody">
15
15
  <zeroOrMore>
@@ -39,7 +39,7 @@
39
39
  </choice>
40
40
  </define>
41
41
  </include>
42
- <define name="csand-standard">
42
+ <define name="csa-standard">
43
43
  <element name="csa-standard">
44
44
  <ref name="Root-Attributes"/>
45
45
  <ref name="bibdata"/>
@@ -17,7 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
- <!-- VERSION v1.3.4 -->
20
+ <!-- VERSION v1.4.0 -->
21
21
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
22
22
  <include href="reqt.rng"/>
23
23
  <include href="basicdoc.rng">
@@ -326,7 +326,7 @@ normative or informative references, some split references into sections organiz
326
326
  <a:documentation>Content of note</a:documentation>
327
327
  <oneOrMore>
328
328
  <choice>
329
- <ref name="paragraph"/>
329
+ <ref name="paragraph-with-footnote"/>
330
330
  <ref name="ul"/>
331
331
  <ref name="ol"/>
332
332
  <ref name="dl"/>
@@ -412,7 +412,7 @@ normative or informative references, some split references into sections organiz
412
412
  <element name="note">
413
413
  <ref name="OptionalId"/>
414
414
  <oneOrMore>
415
- <ref name="paragraph"/>
415
+ <ref name="paragraph-with-footnote"/>
416
416
  </oneOrMore>
417
417
  </element>
418
418
  </define>
@@ -1977,7 +1977,7 @@ used in document amendments</a:documentation>
1977
1977
  <oneOrMore>
1978
1978
  <choice>
1979
1979
  <a:documentation>Content of the verbal representation of the term</a:documentation>
1980
- <ref name="paragraph"/>
1980
+ <ref name="paragraph-with-footnote"/>
1981
1981
  <ref name="dl"/>
1982
1982
  <ref name="ol"/>
1983
1983
  <ref name="ul"/>
@@ -2015,7 +2015,7 @@ used in document amendments</a:documentation>
2015
2015
  <oneOrMore>
2016
2016
  <choice>
2017
2017
  <a:documentation>Content of the term note</a:documentation>
2018
- <ref name="paragraph"/>
2018
+ <ref name="paragraph-with-footnote"/>
2019
2019
  <ref name="ul"/>
2020
2020
  <ref name="ol"/>
2021
2021
  <ref name="dl"/>
@@ -2037,7 +2037,7 @@ used in document amendments</a:documentation>
2037
2037
  <ref name="dl"/>
2038
2038
  <ref name="quote"/>
2039
2039
  <ref name="sourcecode"/>
2040
- <ref name="paragraph"/>
2040
+ <ref name="paragraph-with-footnote"/>
2041
2041
  <ref name="figure"/>
2042
2042
  </choice>
2043
2043
  </oneOrMore>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Csa
3
- VERSION = "2.5.4".freeze
3
+ VERSION = "2.5.6".freeze
4
4
  end
5
5
  end
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.require_paths = ["lib"]
30
30
  spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
31
31
 
32
- spec.add_dependency "metanorma-generic", "~> 2.7.0"
32
+ spec.add_dependency "metanorma-generic", "~> 2.7.2"
33
33
 
34
34
  spec.add_development_dependency "debug"
35
35
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-csa
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.4
4
+ version: 2.5.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-10-14 00:00:00.000000000 Z
11
+ date: 2024-11-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.7.0
19
+ version: 2.7.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.7.0
26
+ version: 2.7.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement