metanorma-jis 0.2.0 → 0.2.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: b56f3b88aec817a7080654fe444dd0095357bff6cff8e87c2c1070cc76fbfe5d
4
- data.tar.gz: 9118aa499de45316f061c65ed9119fc58db446c8053d088ab938554b0bbf7b3a
3
+ metadata.gz: 940e63ca6b0fbe0f8ffcfeb667c50207e3368f065840941e1377d172bf4b022f
4
+ data.tar.gz: 7cd7632a9b316836a0e08f517a6c27cb6c12a72ba2d551a21fa29c6d542f98ff
5
5
  SHA512:
6
- metadata.gz: 0b27df1700c813a49720e826ee77e6d58e62ca22b8afff0bbe6561d1a51a3403629490edfc254320bd98bae2399ba97197d90c3b590568b8c5d9e243c1ce8732
7
- data.tar.gz: deeaef221cc6143155580d346cc16e62c1dd86190d523f907bfc5d5dd0216968323a04053fe147e34fae1be29dd6c87cac00471c5cebb9f2894a0c9dd24f669b
6
+ metadata.gz: ad51ac315b7537a46c60c441b3ab817f9fa028565c09dce86dd08b7a7f5ecb29b1b1abd97c27482ded83cfd0c5849465eacf68cd871f192c60366c0616110b82
7
+ data.tar.gz: 457843fe15780ca34e369bc5714affcd6599d2abd3c35d4c0190bfa39be7187c49a6a67bb5fe7f9a8dc53de75637b743ffe50f267d3e5538e865d6d043cce188
@@ -3364,7 +3364,9 @@
3364
3364
  </xsl:template> <!-- license-statement/p -->
3365
3365
 
3366
3366
  <xsl:template match="*[local-name()='legal-statement']">
3367
+ <xsl:param name="isLegacy">false</xsl:param>
3367
3368
  <fo:block xsl:use-attribute-sets="legal-statement-style">
3369
+
3368
3370
  <xsl:apply-templates/>
3369
3371
  </fo:block>
3370
3372
  </xsl:template> <!-- legal-statement -->
@@ -5620,13 +5622,14 @@
5620
5622
  <!-- ================= -->
5621
5623
  <!-- Added,deleted text -->
5622
5624
  <!-- ================= -->
5623
- <xsl:template match="*[local-name()='add']" name="tag_add">
5625
+ <xsl:template match="*[local-name()='add'] | *[local-name() = 'change-open-tag'] | *[local-name() = 'change-close-tag']" name="tag_add">
5624
5626
  <xsl:param name="skip">true</xsl:param>
5625
5627
  <xsl:param name="block">false</xsl:param>
5626
5628
  <xsl:param name="type"/>
5627
5629
  <xsl:param name="text-align"/>
5628
5630
  <xsl:choose>
5629
- <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start -->
5631
+ <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
5632
+ <change-open-tag>A<sub>1</sub></change-open-tag>, <change-close-tag>A<sub>1</sub></change-close-tag> -->
5630
5633
  <xsl:choose>
5631
5634
  <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>
5632
5635
  <xsl:otherwise>
@@ -5634,12 +5637,32 @@
5634
5637
  <xsl:call-template name="insertTag">
5635
5638
  <xsl:with-param name="type">
5636
5639
  <xsl:choose>
5640
+ <xsl:when test="local-name() = 'change-open-tag'">start</xsl:when>
5641
+ <xsl:when test="local-name() = 'change-close-tag'">end</xsl:when>
5637
5642
  <xsl:when test="$type = ''"><xsl:value-of select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end --></xsl:when>
5638
5643
  <xsl:otherwise><xsl:value-of select="$type"/></xsl:otherwise>
5639
5644
  </xsl:choose>
5640
5645
  </xsl:with-param>
5641
- <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
5642
- <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
5646
+ <xsl:with-param name="kind">
5647
+ <xsl:choose>
5648
+ <xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
5649
+ <xsl:value-of select="text()"/>
5650
+ </xsl:when>
5651
+ <xsl:otherwise>
5652
+ <xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
5653
+ </xsl:otherwise>
5654
+ </xsl:choose>
5655
+ </xsl:with-param>
5656
+ <xsl:with-param name="value">
5657
+ <xsl:choose>
5658
+ <xsl:when test="local-name() = 'change-open-tag' or local-name() = 'change-close-tag'">
5659
+ <xsl:value-of select="*[local-name() = 'sub']"/>
5660
+ </xsl:when>
5661
+ <xsl:otherwise>
5662
+ <xsl:value-of select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
5663
+ </xsl:otherwise>
5664
+ </xsl:choose>
5665
+ </xsl:with-param>
5643
5666
  </xsl:call-template>
5644
5667
  </xsl:variable>
5645
5668
  <xsl:choose>
@@ -7842,11 +7865,17 @@
7842
7865
  </xsl:when>
7843
7866
  <xsl:otherwise>
7844
7867
 
7868
+ <xsl:variable name="image_class" select="ancestor::*[local-name() = 'image']/@class"/>
7869
+ <xsl:variable name="ancestor_table_cell" select="normalize-space(ancestor::*[local-name() = 'td'] or ancestor::*[local-name() = 'th'])"/>
7870
+
7845
7871
  <xsl:variable name="element">
7846
7872
  <xsl:choose>
7847
7873
  <xsl:when test="ancestor::*[local-name() = 'tr'] and $isGenerateTableIF = 'true'">
7848
7874
  <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
7849
7875
  </xsl:when>
7876
+ <xsl:when test="not(ancestor::*[local-name() = 'figure'])">
7877
+ <fo:inline xsl:use-attribute-sets="image-style" text-align="left"/>
7878
+ </xsl:when>
7850
7879
  <xsl:otherwise>
7851
7880
  <fo:block xsl:use-attribute-sets="image-style">
7852
7881
  <xsl:if test="ancestor::*[local-name() = 'dt']">
@@ -7862,10 +7891,24 @@
7862
7891
  <xsl:copy-of select="@*"/>
7863
7892
  <!-- <fo:block xsl:use-attribute-sets="image-style"> -->
7864
7893
  <fo:instream-foreign-object fox:alt-text="{$alt-text}">
7865
- <xsl:if test="$isGenerateTableIF = 'false'">
7866
- <xsl:attribute name="width">100%</xsl:attribute>
7867
- </xsl:if>
7868
- <xsl:attribute name="content-height">100%</xsl:attribute>
7894
+
7895
+ <xsl:choose>
7896
+ <xsl:when test="$image_class = 'corrigenda-tag'">
7897
+ <xsl:attribute name="fox:alt-text">CorrigendaTag</xsl:attribute>
7898
+ <xsl:attribute name="baseline-shift">-10%</xsl:attribute>
7899
+ <xsl:if test="$ancestor_table_cell = 'true'">
7900
+ <xsl:attribute name="baseline-shift">-25%</xsl:attribute>
7901
+ </xsl:if>
7902
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
7903
+ </xsl:when>
7904
+ <xsl:otherwise>
7905
+ <xsl:if test="$isGenerateTableIF = 'false'">
7906
+ <xsl:attribute name="width">100%</xsl:attribute>
7907
+ </xsl:if>
7908
+ <xsl:attribute name="content-height">100%</xsl:attribute>
7909
+ </xsl:otherwise>
7910
+ </xsl:choose>
7911
+
7869
7912
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
7870
7913
  <xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
7871
7914
  <xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
@@ -10060,13 +10103,19 @@
10060
10103
  <fo:block id="{@id}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
10061
10104
  </xsl:when>
10062
10105
  <!-- if there isn't element with id 'from', then create 'bookmark' here -->
10063
- <xsl:when test="not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
10106
+ <xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
10107
+ <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
10108
+ </xsl:when>
10109
+ <xsl:when test="not(//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
10064
10110
  <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
10065
10111
  </xsl:when>
10066
10112
  </xsl:choose>
10067
10113
 
10068
10114
  </xsl:template>
10069
10115
 
10116
+ <!-- https://github.com/metanorma/mn-samples-bsi/issues/312 -->
10117
+ <xsl:template match="*[local-name() = 'review'][@type = 'other']"/>
10118
+
10070
10119
  <xsl:template match="*[local-name() = 'name']/text()">
10071
10120
  <!-- 0xA0 to space replacement -->
10072
10121
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
@@ -11796,7 +11845,7 @@
11796
11845
 
11797
11846
  <xsl:template name="printEdition">
11798
11847
  <xsl:variable name="edition_i18n" select="normalize-space((//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
11799
- <xsl:text> </xsl:text>
11848
+
11800
11849
  <xsl:choose>
11801
11850
  <xsl:when test="$edition_i18n != ''">
11802
11851
  <!-- 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"/>
@@ -44,6 +44,10 @@ module Metanorma
44
44
  File.join(@libdir, "boilerplate-#{@lang}.adoc")
45
45
  end
46
46
 
47
+ def document_scheme(node)
48
+ node.attr("document-scheme")
49
+ end
50
+
47
51
  def html_converter(node)
48
52
  if node.nil?
49
53
  IsoDoc::JIS::HtmlConvert.new({})
@@ -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,6 +1,6 @@
1
1
  module Metanorma
2
2
  module JIS
3
- VERSION = "0.2.0".freeze
3
+ VERSION = "0.2.1".freeze
4
4
  end
5
5
  end
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-jis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
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: japanese_calendar