metanorma-iho 0.9.0 → 0.9.1

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: c4b64c1bec1866b211de1d7843e3c50d366771c5a6e960e50e1a1b26f573b416
4
- data.tar.gz: d3e48770e6280f8567d5a6269d84fbf83d4c1a01d51210bb8728494648051ae5
3
+ metadata.gz: 0222564e4000d5ef484f0f0a82838f1c3ece8a0d2546e795e992c62dc69ae5fa
4
+ data.tar.gz: 3db4ef3f58e77c33f55c228c6714c67ba8e278262f6de0706b2ee8ad784ff984
5
5
  SHA512:
6
- metadata.gz: 7db918b6bebfaff6f3cc206157032322a0da07a6d8e2999d755889a97487592cacf28e6cfb816dc925fd4d03d8a3f58a58af2298e850b5bf503ccd08345f59eb
7
- data.tar.gz: f7e68d99c8f96222f0b07aeab5b3f9fc0082d3894fefbace516fc921b78dfe52db9ecfa53e22275a77d5c4a8fb42e6a82c2e81ca48453537761e1c286f757457
6
+ metadata.gz: 4fc6726f6a56ad1fbf42489bddd54d972563e638dd83cbed938176d7ad98635a41a1e2be48f70a18f56c594a5adaf489badbafda07bd0b3d26297da7f0535369
7
+ data.tar.gz: 5217fe26eda5262afd14ae27c9fcc4a651c172593d7c427ca7d2e60dcf35f67964dbe6309fa66708319a8dd174ffeaa28fcb5abb4a11b0def1da95b97fd72c4c
@@ -2606,7 +2606,9 @@
2606
2606
  </xsl:template> <!-- license-statement/p -->
2607
2607
 
2608
2608
  <xsl:template match="*[local-name()='legal-statement']">
2609
+ <xsl:param name="isLegacy">false</xsl:param>
2609
2610
  <fo:block xsl:use-attribute-sets="legal-statement-style">
2611
+
2610
2612
  <xsl:apply-templates/>
2611
2613
  </fo:block>
2612
2614
  </xsl:template> <!-- legal-statement -->
@@ -4875,13 +4877,14 @@
4875
4877
  <!-- ================= -->
4876
4878
  <!-- Added,deleted text -->
4877
4879
  <!-- ================= -->
4878
- <xsl:template match="*[local-name()='add']" name="tag_add">
4880
+ <xsl:template match="*[local-name()='add'] | *[local-name() = 'change-open-tag'] | *[local-name() = 'change-close-tag']" name="tag_add">
4879
4881
  <xsl:param name="skip">true</xsl:param>
4880
4882
  <xsl:param name="block">false</xsl:param>
4881
4883
  <xsl:param name="type"/>
4882
4884
  <xsl:param name="text-align"/>
4883
4885
  <xsl:choose>
4884
- <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start -->
4886
+ <xsl:when test="starts-with(., $ace_tag) or local-name() = 'change-open-tag' or local-name() = 'change-close-tag'"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start, or
4887
+ <change-open-tag>A<sub>1</sub></change-open-tag>, <change-close-tag>A<sub>1</sub></change-close-tag> -->
4885
4888
  <xsl:choose>
4886
4889
  <xsl:when test="$skip = 'true' and ((local-name(../..) = 'note' and not(preceding-sibling::node())) or (local-name(..) = 'title' and preceding-sibling::node()[1][local-name() = 'tab']) or local-name(..) = 'formattedref' and not(preceding-sibling::node())) and ../node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]"><!-- start tag displayed in template name="note" and title --></xsl:when>
4887
4890
  <xsl:otherwise>
@@ -4889,12 +4892,32 @@
4889
4892
  <xsl:call-template name="insertTag">
4890
4893
  <xsl:with-param name="type">
4891
4894
  <xsl:choose>
4895
+ <xsl:when test="local-name() = 'change-open-tag'">start</xsl:when>
4896
+ <xsl:when test="local-name() = 'change-close-tag'">end</xsl:when>
4892
4897
  <xsl:when test="$type = ''"><xsl:value-of select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end --></xsl:when>
4893
4898
  <xsl:otherwise><xsl:value-of select="$type"/></xsl:otherwise>
4894
4899
  </xsl:choose>
4895
4900
  </xsl:with-param>
4896
- <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
4897
- <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
4901
+ <xsl:with-param name="kind">
4902
+ <xsl:choose>
4903
+ <xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
4904
+ <xsl:value-of select="text()"/>
4905
+ </xsl:when>
4906
+ <xsl:otherwise>
4907
+ <xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
4908
+ </xsl:otherwise>
4909
+ </xsl:choose>
4910
+ </xsl:with-param>
4911
+ <xsl:with-param name="value">
4912
+ <xsl:choose>
4913
+ <xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
4914
+ <xsl:value-of select="*[local-name() = 'sub']"/>
4915
+ </xsl:when>
4916
+ <xsl:otherwise>
4917
+ <xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
4918
+ </xsl:otherwise>
4919
+ </xsl:choose>
4920
+ </xsl:with-param>
4898
4921
  </xsl:call-template>
4899
4922
  </xsl:variable>
4900
4923
  <xsl:choose>
@@ -7171,11 +7194,17 @@
7171
7194
  </xsl:when>
7172
7195
  <xsl:otherwise>
7173
7196
 
7197
+ <xsl:variable name="image_class" select="ancestor::*[local-name() = 'image']/@class"/>
7198
+ <xsl:variable name="ancestor_table_cell" select="normalize-space(ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])"/>
7199
+
7174
7200
  <xsl:variable name="element">
7175
7201
  <xsl:choose>
7176
7202
  <xsl:when test="ancestor::*[local-name() = 'tr'] and $isGenerateTableIF = 'true'">
7177
7203
  <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
7178
7204
  </xsl:when>
7205
+ <xsl:when test="not(ancestor::*[local-name() = 'figure'])">
7206
+ <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
7207
+ </xsl:when>
7179
7208
  <xsl:otherwise>
7180
7209
  <fo:block xsl:use-attribute-sets="image-style">
7181
7210
  <xsl:if test="ancestor::*[local-name() = 'dt']">
@@ -7191,10 +7220,24 @@
7191
7220
  <xsl:copy-of select="@*"/>
7192
7221
  <!-- <fo:block xsl:use-attribute-sets="image-style"> -->
7193
7222
  <fo:instream-foreign-object fox:alt-text="{$alt-text}">
7194
- <xsl:if test="$isGenerateTableIF = 'false'">
7195
- <xsl:attribute name="width">100%</xsl:attribute>
7196
- </xsl:if>
7197
- <xsl:attribute name="content-height">100%</xsl:attribute>
7223
+
7224
+ <xsl:choose>
7225
+ <xsl:when test="$image_class = 'corrigenda-tag'">
7226
+ <xsl:attribute name="fox:alt-text">CorrigendaTag</xsl:attribute>
7227
+ <xsl:attribute name="baseline-shift">-10%</xsl:attribute>
7228
+ <xsl:if test="$ancestor_table_cell = 'true'">
7229
+ <xsl:attribute name="baseline-shift">-25%</xsl:attribute>
7230
+ </xsl:if>
7231
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
7232
+ </xsl:when>
7233
+ <xsl:otherwise>
7234
+ <xsl:if test="$isGenerateTableIF = 'false'">
7235
+ <xsl:attribute name="width">100%</xsl:attribute>
7236
+ </xsl:if>
7237
+ <xsl:attribute name="content-height">100%</xsl:attribute>
7238
+ </xsl:otherwise>
7239
+ </xsl:choose>
7240
+
7198
7241
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
7199
7242
  <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
7200
7243
  <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
@@ -9394,13 +9437,19 @@
9394
9437
  <fo:block id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
9395
9438
  </xsl:when>
9396
9439
  <!-- if there isn't element with id 'from', then create 'bookmark' here -->
9397
- <xsl:when test="not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
9440
+ <xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
9441
+ <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
9442
+ </xsl:when>
9443
+ <xsl:when test="not(//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
9398
9444
  <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
9399
9445
  </xsl:when>
9400
9446
  </xsl:choose>
9401
9447
 
9402
9448
  </xsl:template>
9403
9449
 
9450
+ <!-- https://github.com/metanorma/mn-samples-bsi/issues/312 -->
9451
+ <xsl:template match="*[local-name() = 'review'][@type = 'other']"/>
9452
+
9404
9453
  <xsl:template match="*[local-name() = 'name']/text()">
9405
9454
  <!-- 0xA0 to space replacement -->
9406
9455
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
@@ -11009,7 +11058,7 @@
11009
11058
 
11010
11059
  <xsl:template name="printEdition">
11011
11060
  <xsl:variable name="edition_i18n" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
11012
- <xsl:text> </xsl:text>
11061
+
11013
11062
  <xsl:choose>
11014
11063
  <xsl:when test="$edition_i18n != ''">
11015
11064
  <!-- Example: <edition language="fr">deuxième édition</edition> -->
@@ -2606,7 +2606,9 @@
2606
2606
  </xsl:template> <!-- license-statement/p -->
2607
2607
 
2608
2608
  <xsl:template match="*[local-name()='legal-statement']">
2609
+ <xsl:param name="isLegacy">false</xsl:param>
2609
2610
  <fo:block xsl:use-attribute-sets="legal-statement-style">
2611
+
2610
2612
  <xsl:apply-templates/>
2611
2613
  </fo:block>
2612
2614
  </xsl:template> <!-- legal-statement -->
@@ -4875,13 +4877,14 @@
4875
4877
  <!-- ================= -->
4876
4878
  <!-- Added,deleted text -->
4877
4879
  <!-- ================= -->
4878
- <xsl:template match="*[local-name()='add']" name="tag_add">
4880
+ <xsl:template match="*[local-name()='add'] | *[local-name() = 'change-open-tag'] | *[local-name() = 'change-close-tag']" name="tag_add">
4879
4881
  <xsl:param name="skip">true</xsl:param>
4880
4882
  <xsl:param name="block">false</xsl:param>
4881
4883
  <xsl:param name="type"/>
4882
4884
  <xsl:param name="text-align"/>
4883
4885
  <xsl:choose>
4884
- <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start -->
4886
+ <xsl:when test="starts-with(., $ace_tag) or local-name() = 'change-open-tag' or local-name() = 'change-close-tag'"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start, or
4887
+ <change-open-tag>A<sub>1</sub></change-open-tag>, <change-close-tag>A<sub>1</sub></change-close-tag> -->
4885
4888
  <xsl:choose>
4886
4889
  <xsl:when test="$skip = 'true' and ((local-name(../..) = 'note' and not(preceding-sibling::node())) or (local-name(..) = 'title' and preceding-sibling::node()[1][local-name() = 'tab']) or local-name(..) = 'formattedref' and not(preceding-sibling::node())) and ../node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]"><!-- start tag displayed in template name="note" and title --></xsl:when>
4887
4890
  <xsl:otherwise>
@@ -4889,12 +4892,32 @@
4889
4892
  <xsl:call-template name="insertTag">
4890
4893
  <xsl:with-param name="type">
4891
4894
  <xsl:choose>
4895
+ <xsl:when test="local-name() = 'change-open-tag'">start</xsl:when>
4896
+ <xsl:when test="local-name() = 'change-close-tag'">end</xsl:when>
4892
4897
  <xsl:when test="$type = ''"><xsl:value-of select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end --></xsl:when>
4893
4898
  <xsl:otherwise><xsl:value-of select="$type"/></xsl:otherwise>
4894
4899
  </xsl:choose>
4895
4900
  </xsl:with-param>
4896
- <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
4897
- <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
4901
+ <xsl:with-param name="kind">
4902
+ <xsl:choose>
4903
+ <xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
4904
+ <xsl:value-of select="text()"/>
4905
+ </xsl:when>
4906
+ <xsl:otherwise>
4907
+ <xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
4908
+ </xsl:otherwise>
4909
+ </xsl:choose>
4910
+ </xsl:with-param>
4911
+ <xsl:with-param name="value">
4912
+ <xsl:choose>
4913
+ <xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
4914
+ <xsl:value-of select="*[local-name() = 'sub']"/>
4915
+ </xsl:when>
4916
+ <xsl:otherwise>
4917
+ <xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
4918
+ </xsl:otherwise>
4919
+ </xsl:choose>
4920
+ </xsl:with-param>
4898
4921
  </xsl:call-template>
4899
4922
  </xsl:variable>
4900
4923
  <xsl:choose>
@@ -7171,11 +7194,17 @@
7171
7194
  </xsl:when>
7172
7195
  <xsl:otherwise>
7173
7196
 
7197
+ <xsl:variable name="image_class" select="ancestor::*[local-name() = 'image']/@class"/>
7198
+ <xsl:variable name="ancestor_table_cell" select="normalize-space(ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])"/>
7199
+
7174
7200
  <xsl:variable name="element">
7175
7201
  <xsl:choose>
7176
7202
  <xsl:when test="ancestor::*[local-name() = 'tr'] and $isGenerateTableIF = 'true'">
7177
7203
  <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
7178
7204
  </xsl:when>
7205
+ <xsl:when test="not(ancestor::*[local-name() = 'figure'])">
7206
+ <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
7207
+ </xsl:when>
7179
7208
  <xsl:otherwise>
7180
7209
  <fo:block xsl:use-attribute-sets="image-style">
7181
7210
  <xsl:if test="ancestor::*[local-name() = 'dt']">
@@ -7191,10 +7220,24 @@
7191
7220
  <xsl:copy-of select="@*"/>
7192
7221
  <!-- <fo:block xsl:use-attribute-sets="image-style"> -->
7193
7222
  <fo:instream-foreign-object fox:alt-text="{$alt-text}">
7194
- <xsl:if test="$isGenerateTableIF = 'false'">
7195
- <xsl:attribute name="width">100%</xsl:attribute>
7196
- </xsl:if>
7197
- <xsl:attribute name="content-height">100%</xsl:attribute>
7223
+
7224
+ <xsl:choose>
7225
+ <xsl:when test="$image_class = 'corrigenda-tag'">
7226
+ <xsl:attribute name="fox:alt-text">CorrigendaTag</xsl:attribute>
7227
+ <xsl:attribute name="baseline-shift">-10%</xsl:attribute>
7228
+ <xsl:if test="$ancestor_table_cell = 'true'">
7229
+ <xsl:attribute name="baseline-shift">-25%</xsl:attribute>
7230
+ </xsl:if>
7231
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
7232
+ </xsl:when>
7233
+ <xsl:otherwise>
7234
+ <xsl:if test="$isGenerateTableIF = 'false'">
7235
+ <xsl:attribute name="width">100%</xsl:attribute>
7236
+ </xsl:if>
7237
+ <xsl:attribute name="content-height">100%</xsl:attribute>
7238
+ </xsl:otherwise>
7239
+ </xsl:choose>
7240
+
7198
7241
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
7199
7242
  <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
7200
7243
  <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
@@ -9394,13 +9437,19 @@
9394
9437
  <fo:block id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
9395
9438
  </xsl:when>
9396
9439
  <!-- if there isn't element with id 'from', then create 'bookmark' here -->
9397
- <xsl:when test="not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
9440
+ <xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
9441
+ <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
9442
+ </xsl:when>
9443
+ <xsl:when test="not(//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
9398
9444
  <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
9399
9445
  </xsl:when>
9400
9446
  </xsl:choose>
9401
9447
 
9402
9448
  </xsl:template>
9403
9449
 
9450
+ <!-- https://github.com/metanorma/mn-samples-bsi/issues/312 -->
9451
+ <xsl:template match="*[local-name() = 'review'][@type = 'other']"/>
9452
+
9404
9453
  <xsl:template match="*[local-name() = 'name']/text()">
9405
9454
  <!-- 0xA0 to space replacement -->
9406
9455
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
@@ -11009,7 +11058,7 @@
11009
11058
 
11010
11059
  <xsl:template name="printEdition">
11011
11060
  <xsl:variable name="edition_i18n" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
11012
- <xsl:text> </xsl:text>
11061
+
11013
11062
  <xsl:choose>
11014
11063
  <xsl:when test="$edition_i18n != ''">
11015
11064
  <!-- Example: <edition language="fr">deuxième édition</edition> -->
@@ -244,6 +244,9 @@
244
244
  <data type="ID"/>
245
245
  </attribute>
246
246
  <attribute name="reviewer"/>
247
+ <optional>
248
+ <attribute name="type"/>
249
+ </optional>
247
250
  <optional>
248
251
  <attribute name="date">
249
252
  <data type="dateTime"/>
@@ -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.2.12 -->
20
+ <!-- VERSION v1.3.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">
@@ -146,6 +146,9 @@
146
146
  <data type="boolean"/>
147
147
  </attribute>
148
148
  </optional>
149
+ <optional>
150
+ <attribute name="style"/>
151
+ </optional>
149
152
  <oneOrMore>
150
153
  <ref name="PureTextElement"/>
151
154
  </oneOrMore>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module IHO
3
- VERSION = "0.9.0".freeze
3
+ VERSION = "0.9.1".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iho
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.0
4
+ version: 0.9.1
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-01-09 00:00:00.000000000 Z
11
+ date: 2024-02-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic