metanorma-jis 1.0.0 → 1.0.2

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: 7e2dd4ab84c0a6ed18a6fd314efc02f0fd4d21541ecefe84ca12ccfb7aafbad8
4
- data.tar.gz: 376add510f1d13bbc145750ecf15eb3ac37e82ce3dfeac8cdd5c7f3a6de2fc28
3
+ metadata.gz: 1aae95e8715c8724eb119e3b53fc413839b99478aeaa81f7e314a64dcf03b324
4
+ data.tar.gz: b3ffa69df1685778cfc47d5fc5efe21dde085447494d68fbc566be121b9361d5
5
5
  SHA512:
6
- metadata.gz: 1d998d2221b79cf39d75fa49ad989ab48cf13a851d8cdca786ce1e72a7ac93a96d164599412c0fa726a72ac1bd13840c37c3092bf29a0a2bfb8d48ad35af1fe0
7
- data.tar.gz: ba1d3e6a819c3fc7b4dd834c9168b83becffd936595d3b2ccf68b89d2f2c072f1ba0a03ff9b16d358fcaf5ab0c4c899a26878ef6be03ef59a8e8ff24af51bdcd
6
+ metadata.gz: 3903babc038dcef541f92470a9dd436a1f7c8785bf139bdfb0f7a6e808d5ee5c9bfd7e7d5e42f975ee0d65f0ccbcf9bc7775774167ada7750b1e99af4ab2b421
7
+ data.tar.gz: adbed05bbe460843f9572569142a523875804f9b3415fc687e5f3235c2bb8a115a8e22bd12b48a112c4e66c5775267e66aaef9708f6a6e4afd612a0575882418
@@ -6764,7 +6764,7 @@
6764
6764
  <xsl:variable name="non_white_space">[^\s\u3000-\u9FFF]</xsl:variable>
6765
6765
  <xsl:variable name="regex_dots_units">((\b((<xsl:value-of select="$non_white_space"/>{1,3}\.<xsl:value-of select="$non_white_space"/>+)|(<xsl:value-of select="$non_white_space"/>+\.<xsl:value-of select="$non_white_space"/>{1,3}))\b)|(\.<xsl:value-of select="$non_white_space"/>{1,3})\b)</xsl:variable>
6766
6766
 
6767
- <xsl:template match="text()[not(ancestor::mn:bibdata or ancestor::mn:fmt-link[not(contains(normalize-space(),' '))] or ancestor::mn:sourcecode or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or ancestor::mn:name or ancestor::mn:fmt-name or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
6767
+ <xsl:template match="text()[not(ancestor::mn:bibdata or ancestor::mn:fmt-link[not(contains(normalize-space(),' '))] or ancestor::mn:sourcecode or (ancestor::mn:tt and ancestor::mn:table and string-length() &gt; 20) or ancestor::*[local-name() = 'math'] or ancestor::*[local-name() = 'svg'] or ancestor::mn:name or ancestor::mn:fmt-name or starts-with(., 'http://') or starts-with(., 'https://') or starts-with(., 'www.') or normalize-space() = '' )]" name="keep_together_standard_number" mode="update_xml_enclose_keep-together_within-line">
6768
6768
 
6769
6769
  <xsl:variable name="parent" select="local-name(..)"/>
6770
6770
 
@@ -15773,10 +15773,10 @@
15773
15773
  <!-- END Admonition -->
15774
15774
  <!-- ================ -->
15775
15775
 
15776
- <xsl:attribute-set name="references-non-normative-title-style">
15776
+ <xsl:attribute-set name="bibliography-title-style">
15777
15777
  </xsl:attribute-set>
15778
15778
 
15779
- <xsl:template name="refine_references-non-normative-title-style">
15779
+ <xsl:template name="refine_bibliography-title-style">
15780
15780
  </xsl:template>
15781
15781
 
15782
15782
  <!-- bibitem in Normative References (references/@normative="true") -->
@@ -17866,9 +17866,18 @@
17866
17866
  <!-- ===================================== -->
17867
17867
 
17868
17868
  <xsl:attribute-set name="annex-title-style">
17869
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
17870
+ <xsl:attribute name="font-size">14pt</xsl:attribute>
17871
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
17872
+ <xsl:attribute name="text-align">center</xsl:attribute>
17869
17873
  </xsl:attribute-set> <!-- annex-title-style -->
17870
17874
 
17871
17875
  <xsl:template name="refine_annex-title-style">
17876
+ <xsl:if test="preceding-sibling::mn:annex[1][@commentary = 'true']">
17877
+ <xsl:attribute name="font-size">16pt</xsl:attribute>
17878
+ <xsl:attribute name="space-before">1mm</xsl:attribute>
17879
+ <xsl:attribute name="margin-bottom">7mm</xsl:attribute>
17880
+ </xsl:if>
17872
17881
  </xsl:template>
17873
17882
 
17874
17883
  <xsl:attribute-set name="p-zzSTDTitle1-style">
@@ -17961,14 +17970,17 @@
17961
17970
  <xsl:attribute name="space-before">9mm</xsl:attribute>
17962
17971
  <xsl:attribute name="margin-bottom">9mm</xsl:attribute>
17963
17972
  </xsl:if>
17964
- <xsl:if test="@ancestor = 'annex'">
17965
- <xsl:attribute name="font-size">14pt</xsl:attribute>
17966
- <xsl:attribute name="text-align">center</xsl:attribute>
17967
- <xsl:if test="preceding-sibling::mn:annex[1][@commentary = 'true']">
17968
- <xsl:attribute name="font-size">16pt</xsl:attribute>
17969
- <xsl:attribute name="space-before">1mm</xsl:attribute>
17970
- <xsl:attribute name="margin-bottom">7mm</xsl:attribute>
17971
- </xsl:if>
17973
+ <xsl:if test="@ancestor = 'annex'"><!-- Annex title -->
17974
+ <xsl:variable name="annex_title_styles">
17975
+ <styles xsl:use-attribute-sets="annex-title-style"><xsl:call-template name="refine_annex-title-style"/></styles>
17976
+ </xsl:variable>
17977
+ <xsl:copy-of select="xalan:nodeset($annex_title_styles)/styles/@*"/>
17978
+ </xsl:if>
17979
+ <xsl:if test="@ancestor = 'bibliography'"><!-- Bibliography section title -->
17980
+ <xsl:variable name="bibliography_title_styles">
17981
+ <styles xsl:use-attribute-sets="bibliography-title-style"><xsl:call-template name="refine_bibliography-title-style"/></styles>
17982
+ </xsl:variable>
17983
+ <xsl:copy-of select="xalan:nodeset($bibliography_title_styles)/styles/@*"/>
17972
17984
  </xsl:if>
17973
17985
  </xsl:if>
17974
17986
 
@@ -18015,9 +18027,12 @@
18015
18027
  </xsl:template> <!-- refine_title-style -->
18016
18028
 
18017
18029
  <xsl:template name="processPrefaceSectionsDefault">
18030
+ <xsl:param name="num"/>
18018
18031
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
18019
18032
  <xsl:sort select="@displayorder" data-type="number"/>
18020
- <xsl:apply-templates select="."/>
18033
+ <xsl:apply-templates select=".">
18034
+ <xsl:with-param name="num" select="$num"/>
18035
+ </xsl:apply-templates>
18021
18036
  </xsl:for-each>
18022
18037
  </xsl:template>
18023
18038
 
@@ -165,7 +165,7 @@ module IsoDoc
165
165
  id = elem["bibitemid"] or return
166
166
  b = @bibitem_lookup[id] or return
167
167
  !b.at(ns(<<~XPATH))
168
- ./docidentifier[not(#{SKIP_DOCID} or @scope = 'biblio-tag' or @type = 'metanorma' or @type = 'metanorma-ordinal' or @type='title')]
168
+ ./docidentifier[not(#{SERIAL_NUM_DOCID} or @scope = 'biblio-tag' or @type = 'metanorma' or @type = 'metanorma-ordinal' or @type='title')]
169
169
  XPATH
170
170
  end
171
171
 
@@ -203,24 +203,26 @@ module IsoDoc
203
203
 
204
204
  def bracketed_refs_processing(docxml); end
205
205
 
206
- def norm_ref_entry_code(_ordinal, idents, _ids, _standard, datefn, bib)
206
+ def short_style_origin(docxml); end
207
+
208
+ def norm_ref_entry_code(_ordinal, ids, _standard, datefn, bib)
207
209
  delim = bib.at(ns("./language"))&.text == "ja" ? "&#x3000;" : "<esc>,</esc> "
208
- ret = (idents[:ordinal] || idents[:metanorma] || idents[:sdo]).to_s
210
+ ret = (ids[:ordinal] || ids[:content] || ids[:metanorma] || ids[:sdo]).to_s
209
211
  ret = esc(ret)
210
- (idents[:ordinal] || idents[:metanorma]) && idents[:sdo] and
211
- ret += "#{delim}<strong>#{esc idents[:sdo]}</strong>"
212
- !idents[:ordinal] && !idents[:metanorma] && idents[:sdo] and
212
+ (ids[:ordinal] || ids[:content] || ids[:metanorma]) && ids[:sdo] and
213
+ ret += "#{delim}<strong>#{esc ids[:sdo]}</strong>"
214
+ !ids[:ordinal] && !ids[:content] && !ids[:metanorma] && ids[:sdo] and
213
215
  ret = "<strong>#{ret}</ret>"
214
216
  ret += datefn
215
217
  ret.empty? and return ret
216
- idents[:sdo] and ret += delim
218
+ ids[:sdo] and ret += delim
217
219
  ret.sub(delim, "").strip.empty? and return ""
218
220
  ret
219
221
  end
220
222
 
221
- def biblio_ref_entry_code(ordinal, ids, _id, _standard, datefn, bib)
223
+ def biblio_ref_entry_code(ordinal, ids, _standard, datefn, bib)
222
224
  delim = bib.at(ns("./language"))&.text == "ja" ? "&#x3000;" : "<esc>,</esc> "
223
- ret = esc(ids[:ordinal]) || esc(ids[:metanorma]) || "[#{esc ordinal.to_s}]"
225
+ ret = esc(ids[:ordinal]) || esc(ids[:content]) || esc(ids[:metanorma]) || "[#{esc ordinal.to_s}]"
224
226
  if ids[:sdo] && !ids[:sdo].empty?
225
227
  ret = prefix_bracketed_ref(ret)
226
228
  ret += "#{esc ids[:sdo]}#{datefn}#{delim}"
@@ -178,17 +178,6 @@ module IsoDoc
178
178
  super
179
179
  end
180
180
  end
181
-
182
- def hierarchical_figure_names(clause, num)
183
- #require "debug"; binding.b
184
- super
185
- end
186
-
187
- def localise_anchors(type = nil)
188
- #require "debug"; binding.b
189
- super
190
- end
191
-
192
181
  end
193
182
  end
194
183
  end
@@ -690,7 +690,7 @@ Examples include GRID, LEI, CrossRef, and Ringgold</a:documentation>
690
690
  <define name="CitationType">
691
691
  <attribute name="bibitemid">
692
692
  <a:documentation>Bibliographic item that the citation applies to, referenced as the anchor of a bibliographic description</a:documentation>
693
- <data type="IDREF"/>
693
+ <ref name="IdRefType"/>
694
694
  </attribute>
695
695
  <choice>
696
696
  <zeroOrMore>
@@ -1296,17 +1296,17 @@ for which this claim of validity is made, if applicable</a:documentation>
1296
1296
  </define>
1297
1297
  <define name="validityBegins">
1298
1298
  <element name="validityBegins">
1299
- <ref name="ISO8601Date"/>
1299
+ <ref name="ISO8601DateTime"/>
1300
1300
  </element>
1301
1301
  </define>
1302
1302
  <define name="validityEnds">
1303
1303
  <element name="validityEnds">
1304
- <ref name="ISO8601Date"/>
1304
+ <ref name="ISO8601DateTime"/>
1305
1305
  </element>
1306
1306
  </define>
1307
1307
  <define name="validityRevision">
1308
1308
  <element name="revision">
1309
- <ref name="ISO8601Date"/>
1309
+ <ref name="ISO8601DateTime"/>
1310
1310
  </element>
1311
1311
  </define>
1312
1312
  <define name="TypedTitleString">
@@ -100,13 +100,11 @@ module Metanorma
100
100
  def multiling_noko_value(value, tag, xml)
101
101
  if value.is_a?(Hash)
102
102
  value.each do |k, v|
103
- xml.send tag, language: k do |x|
104
- x << v
105
- end
103
+ add_noko_elem(xml, tag, v, language: k)
106
104
  end
107
105
  elsif value.is_a?(Array)
108
- value.each { |a| xml.send tag, a }
109
- else xml.send tag, value
106
+ value.each { |a| add_noko_elem(xml, tag, a) }
107
+ else add_noko_elem(xml, tag, value)
110
108
  end
111
109
  end
112
110
 
@@ -121,7 +119,7 @@ module Metanorma
121
119
  abbr = org[:abbr]
122
120
  abbr ||= org_abbrev[name_str]
123
121
  default_org && b = node&.attr("subdivision-abbr") and abbr = b
124
- abbr and xml.abbreviation abbr
122
+ add_noko_elem(xml, "abbreviation", abbr)
125
123
  end
126
124
 
127
125
  def copyright_parse(node)
@@ -145,8 +143,8 @@ module Metanorma
145
143
 
146
144
  def metadata_id(node, xml)
147
145
  if id = node.attr("docidentifier")
148
- xml.docidentifier id.sub(/^JIS /, ""),
149
- **attr_code(type: "JIS", primary: "true")
146
+ add_noko_elem(xml, "docidentifier", id.sub(/^JIS /, ""),
147
+ **attr_code(type: "JIS", primary: "true"))
150
148
  else iso_id(node, xml)
151
149
  end
152
150
  end
@@ -185,7 +183,8 @@ module Metanorma
185
183
 
186
184
  def iso_id_out(xml, params, _with_prf)
187
185
  id = iso_id_default(params).to_s(with_publisher: false)
188
- xml.docidentifier id.strip, type: "JIS", primary: "true"
186
+ add_noko_elem(xml, "docidentifier", id.strip, type: "JIS",
187
+ primary: "true")
189
188
  end
190
189
 
191
190
  def iso_id_default(params)
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <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">
3
- <!-- VERSION v2.1.3 -->
3
+ <!-- VERSION v2.1.4 -->
4
4
 
5
5
  <!--
6
6
  ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
@@ -905,15 +905,32 @@ titlecase, or lowercase</a:documentation>
905
905
  </element>
906
906
  </define>
907
907
  <define name="image" combine="choice">
908
- <element name="svg">
909
- <a:documentation>Add svg mark up to image</a:documentation>
910
- <oneOrMore>
911
- <choice>
912
- <text/>
913
- <ref name="AnyElement"/>
914
- </choice>
915
- </oneOrMore>
916
- </element>
908
+ <choice>
909
+ <element name="image">
910
+ <ref name="RequiredId"/>
911
+ <ref name="ImageAttributes"/>
912
+ <optional>
913
+ <element name="svg">
914
+ <a:documentation>Allow svg in image/svg, for consistency</a:documentation>
915
+ <oneOrMore>
916
+ <choice>
917
+ <text/>
918
+ <ref name="AnyElement"/>
919
+ </choice>
920
+ </oneOrMore>
921
+ </element>
922
+ </optional>
923
+ </element>
924
+ <element name="svg">
925
+ <a:documentation>Add svg mark up to image</a:documentation>
926
+ <oneOrMore>
927
+ <choice>
928
+ <text/>
929
+ <ref name="AnyElement"/>
930
+ </choice>
931
+ </oneOrMore>
932
+ </element>
933
+ </choice>
917
934
  </define>
918
935
  <define name="ParagraphFnBody" combine="interleave">
919
936
  <ref name="BlockSource">
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Jis
3
- VERSION = "1.0.0".freeze
3
+ VERSION = "1.0.2".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: 1.0.0
4
+ version: 1.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2025-11-03 00:00:00.000000000 Z
11
+ date: 2025-12-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: japanese_calendar