metanorma-jis 0.3.7 → 0.4.0

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: 143689fe642bbafd3b997d46a587850eec0af4af80a0f30e302cfa2451c9cff1
4
- data.tar.gz: c4f55a36d8c9279500128f725553473180c6574c44657e326990b5bfcc4fd74d
3
+ metadata.gz: 2ee0f607f2c8574957f29235f1275f1429da187b745f4ddb33b2ddb56df963df
4
+ data.tar.gz: 2c701b9b9a847ab56e541bfa89071811524ac8aa8b91e23af6aa52d5221e4988
5
5
  SHA512:
6
- metadata.gz: dc0aba1f4821abc37de307e0fc9a2d7b0323a0c3508efcf345c6617c5b0c61ec177f08c87d0fc96676750038e18e985f90ff202ee1bc0d3c1e25b0af6e905480
7
- data.tar.gz: 52d7c1db05596ebae3eac257c6da53394c361c18e93ff1bc5964f304983c24ea33b58f4b7c6d60760ec4814bef052a7706a3ec0a1e022ddffba2eb313c6220e5
6
+ metadata.gz: 7f6f2229ed80159a55fac331a60a9562dcd5dc35d64f74f668d65fe4e357717fe19be77d8e206f8c54a5bd4a846dbfb498c48deec06cc8efc2a5aa81855a706d
7
+ data.tar.gz: 8910abb49ac749e5452324f238b3841213f3f1895faf0301e34e274916f5d483a26a8a5250227f087d346c26465646217816603e765d84d61e46399196345ec6
@@ -12,20 +12,13 @@ module IsoDoc
12
12
  p.span class: "note_label" do |s|
13
13
  name.children.each { |n| parse(n, s) }
14
14
  end
15
- p << termnote_delim
15
+ p << " "
16
16
  end
17
17
  para_then_remainder(node.first_element_child, node, p, div)
18
18
  end
19
19
  end
20
20
  end
21
21
 
22
- def admonition_name_parse(_node, div, name)
23
- div.span class: "note_label" do |s|
24
- name.children.each { |n| parse(n, s) }
25
- s << " &#x2014; "
26
- end
27
- end
28
-
29
22
  def make_tr_attr(cell, row, totalrows, header, bordered)
30
23
  cell["border"] == "0" and bordered = false
31
24
  super
@@ -90,9 +83,10 @@ module IsoDoc
90
83
 
91
84
  def table_name(name, thead, cols)
92
85
  name or return
93
- thead.children.first.previous =
94
- full_row(cols, "<p class='TableTitle' style='text-align:center;'> " \
95
- "#{name.remove.children.to_xml}</p>")
86
+ thead.add_first_child full_row(
87
+ cols, "<p class='TableTitle' style='text-align:center;'> " \
88
+ "#{name.remove.children.to_xml}</p>"
89
+ )
96
90
  end
97
91
 
98
92
  def table_note_cleanup(docxml)
@@ -35,12 +35,14 @@ module IsoDoc
35
35
  }
36
36
  end
37
37
 
38
+ # TODO to Presentation XML
38
39
  def make_table_footnote_target(out, fnid, fnref)
39
40
  attrs = { id: fnid, class: "TableFootnoteRef" }
40
41
  out.span do |s|
42
+ # TODO to Presentation XML
41
43
  s << @i18n.table_footnote
42
44
  out.span **attrs do |a|
43
- a << "#{fnref})"
45
+ a << fnref
44
46
  end
45
47
  insert_tab(s, 1)
46
48
  end
@@ -10,9 +10,8 @@ module IsoDoc
10
10
  end
11
11
 
12
12
  def xref_init(lang, script, _klass, labels, options)
13
- @xrefs = Xref.new(lang, script,
14
- HtmlConvert.new(language: lang, script: script),
15
- labels, options)
13
+ p = HtmlConvert.new(language: lang, script: script)
14
+ @xrefs = Xref.new(lang, script, p, labels, options)
16
15
  end
17
16
 
18
17
  def i18n_init(lang, script, locale, i18nyaml = nil)
@@ -25,12 +24,6 @@ module IsoDoc
25
24
  i18nhash: @i18n.get))
26
25
  end
27
26
 
28
- def omit_docid_prefix(prefix)
29
- return true if prefix.nil? || prefix.empty?
30
-
31
- super || %w(JIS).include?(prefix)
32
- end
33
-
34
27
  def std_docid_semantic(text)
35
28
  text
36
29
  end
@@ -902,7 +902,7 @@
902
902
  </xsl:if>
903
903
  <xsl:choose>
904
904
  <xsl:when test="$vertical_layout = 'true'">
905
- <xsl:attribute name="provisional-distance-between-starts">10mm</xsl:attribute>
905
+ <xsl:attribute name="provisional-distance-between-starts">15mm</xsl:attribute> <!-- 10 isn't enought for 3 chars numbers -->
906
906
  </xsl:when>
907
907
  <xsl:otherwise>
908
908
  <xsl:variable name="provisional-distance-between-starts">
@@ -1585,6 +1585,7 @@
1585
1585
  <xsl:template match="*[local-name() = 'preface']/*[local-name() = 'clause']" priority="3">
1586
1586
  <fo:block>
1587
1587
  <xsl:call-template name="setId"/>
1588
+ <xsl:call-template name="addReviewHelper"/>
1588
1589
  <xsl:apply-templates/>
1589
1590
  </fo:block>
1590
1591
  </xsl:template>
@@ -6232,7 +6233,7 @@
6232
6233
  <xsl:attribute name="font-family">Times New Roman</xsl:attribute>
6233
6234
  </xsl:if>
6234
6235
  <xsl:value-of select="@reference"/>
6235
- <fo:inline font-weight="normal">)</fo:inline>
6236
+ <!-- <fo:inline font-weight="normal">)</fo:inline> --> <!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
6236
6237
  </fo:inline>
6237
6238
  </fo:block>
6238
6239
  </fo:list-item-label>
@@ -6247,7 +6248,7 @@
6247
6248
 
6248
6249
  </xsl:if>
6249
6250
  </xsl:for-each>
6250
- </xsl:template>
6251
+ </xsl:template> <!-- table_fn_display -->
6251
6252
 
6252
6253
  <xsl:template name="create_fn">
6253
6254
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
@@ -6275,8 +6276,10 @@
6275
6276
  <!-- EMD table's footnotes rendering -->
6276
6277
  <!-- ============================ -->
6277
6278
 
6279
+ <!-- ============================ -->
6278
6280
  <!-- figure's footnotes rendering -->
6279
- <xsl:template name="fn_display_figure">
6281
+ <!-- ============================ -->
6282
+ <xsl:template name="fn_display_figure"> <!-- figure_fn_display -->
6280
6283
 
6281
6284
  <!-- current figure id -->
6282
6285
  <xsl:variable name="figure_id_">
@@ -6389,9 +6392,28 @@
6389
6392
 
6390
6393
  </fo:block>
6391
6394
  </xsl:if>
6392
-
6393
6395
  </xsl:template> <!-- fn_display_figure -->
6394
6396
 
6397
+ <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
6398
+ <!-- figure's footnote label -->
6399
+ <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">
6400
+ <xsl:variable name="key_iso">
6401
+
6402
+ </xsl:variable>
6403
+ <xsl:if test="normalize-space($key_iso) = 'true'">
6404
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
6405
+
6406
+ </xsl:if>
6407
+ <fo:inline xsl:use-attribute-sets="figure-fn-number-style"> <!-- id="{@id}" -->
6408
+ <!-- <xsl:value-of select="@reference"/> -->
6409
+ <xsl:apply-templates/>
6410
+ </fo:inline>
6411
+ </xsl:template>
6412
+
6413
+ <!-- ============================ -->
6414
+ <!-- END: figure's footnotes rendering -->
6415
+ <!-- ============================ -->
6416
+
6395
6417
  <!-- fn reference in the text rendering (for instance, 'some text 1) some text' ) -->
6396
6418
  <xsl:template match="*[local-name()='fn']">
6397
6419
  <fo:inline xsl:use-attribute-sets="fn-reference-style">
@@ -6407,8 +6429,10 @@
6407
6429
 
6408
6430
  <xsl:value-of select="@reference"/>
6409
6431
 
6432
+ <!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
6433
+ <!-- <xsl:if test="$namespace = 'jis'">
6410
6434
  <fo:inline font-weight="normal">)</fo:inline>
6411
-
6435
+ </xsl:if> -->
6412
6436
  </fo:basic-link>
6413
6437
  </fo:inline>
6414
6438
  </xsl:template>
@@ -6535,17 +6559,22 @@
6535
6559
  </fo:block>
6536
6560
  </xsl:when> <!-- END: a few components -->
6537
6561
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
6538
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
6562
+ <!-- Presentation XML contains 'Key' caption, https://github.com/metanorma/isodoc/issues/607 -->
6563
+ <xsl:if test="not(preceding-sibling::*[1][local-name() = 'p' and @keep-with-next])"> <!-- for old Presentation XML -->
6539
6564
 
6540
- <xsl:call-template name="refine_figure_key_style"/>
6565
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
6541
6566
 
6542
- <xsl:variable name="title-key">
6543
- <xsl:call-template name="getLocalizedString">
6544
- <xsl:with-param name="key">key</xsl:with-param>
6545
- </xsl:call-template>
6546
- </xsl:variable>
6547
- <xsl:value-of select="$title-key"/>
6548
- </fo:block>
6567
+ <xsl:call-template name="refine_figure_key_style"/>
6568
+
6569
+ <xsl:variable name="title-key">
6570
+ <xsl:call-template name="getLocalizedString">
6571
+ <xsl:with-param name="key">key</xsl:with-param>
6572
+ </xsl:call-template>
6573
+ </xsl:variable>
6574
+ <xsl:value-of select="$title-key"/>
6575
+ </fo:block>
6576
+
6577
+ </xsl:if>
6549
6578
  </xsl:when> <!-- END: definition list in a figure -->
6550
6579
  </xsl:choose>
6551
6580
 
@@ -6738,6 +6767,14 @@
6738
6767
 
6739
6768
  </xsl:template> <!-- END: dl -->
6740
6769
 
6770
+ <!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
6771
+ <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
6772
+ <fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
6773
+ <xsl:call-template name="refine_figure_key_style"/>
6774
+ <xsl:apply-templates/>
6775
+ </fo:block>
6776
+ </xsl:template>
6777
+
6741
6778
  <xsl:template name="refine_dl_formula_where_style">
6742
6779
 
6743
6780
  </xsl:template> <!-- refine_dl_formula_where_style -->
@@ -8781,6 +8818,39 @@
8781
8818
  </xsl:copy>
8782
8819
  </xsl:template>
8783
8820
 
8821
+ <xsl:template match="@*|node()" mode="mathml_linebreak">
8822
+ <xsl:copy>
8823
+ <xsl:apply-templates select="@*|node()" mode="mathml_linebreak"/>
8824
+ </xsl:copy>
8825
+ </xsl:template>
8826
+
8827
+ <!-- split math into two math -->
8828
+ <xsl:template match="mathml:mo[@linebreak] | mathml:mspace[@linebreak]" mode="mathml_linebreak">
8829
+ <xsl:variable name="math_elements_tree_">
8830
+ <xsl:for-each select="ancestor::*[ancestor-or-self::mathml:math]">
8831
+ <element pos="{position()}">
8832
+ <xsl:copy-of select="@*[local-name() != 'id']"/>
8833
+ <xsl:value-of select="name()"/>
8834
+ </element>
8835
+ </xsl:for-each>
8836
+ </xsl:variable>
8837
+
8838
+ <xsl:variable name="math_elements_tree" select="xalan:nodeset($math_elements_tree_)"/>
8839
+
8840
+ <xsl:call-template name="insertClosingElements">
8841
+ <xsl:with-param name="tree" select="$math_elements_tree"/>
8842
+ </xsl:call-template>
8843
+
8844
+ <xsl:element name="br" namespace="{$namespace_full}"/>
8845
+
8846
+ <xsl:call-template name="insertOpeningElements">
8847
+ <xsl:with-param name="tree" select="$math_elements_tree"/>
8848
+ <xsl:with-param name="xmlns">http://www.w3.org/1998/Math/MathML</xsl:with-param>
8849
+ <xsl:with-param name="add_continue">false</xsl:with-param>
8850
+ </xsl:call-template>
8851
+
8852
+ </xsl:template>
8853
+
8784
8854
  <!-- Examples:
8785
8855
  <stem type="AsciiMath">x = 1</stem>
8786
8856
  <stem type="AsciiMath"><asciimath>x = 1</asciimath></stem>
@@ -9036,9 +9106,11 @@
9036
9106
  </xsl:template>
9037
9107
 
9038
9108
  <xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"> <!-- show in 'stem' template -->
9109
+ <!-- https://github.com/metanorma/isodoc/issues/607
9039
9110
  <xsl:if test="normalize-space() != ''">
9040
- <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
9041
- </xsl:if>
9111
+ <xsl:text>(</xsl:text><xsl:apply-templates /><xsl:text>)</xsl:text>
9112
+ </xsl:if> -->
9113
+ <xsl:apply-templates/>
9042
9114
  </xsl:template>
9043
9115
 
9044
9116
  <!-- stem inside formula with name (with formula's number) -->
@@ -9187,6 +9259,17 @@
9187
9259
  </xsl:when>
9188
9260
  <xsl:otherwise>
9189
9261
 
9262
+ <!-- https://github.com/metanorma/isodoc/issues/607 -->
9263
+ <!-- <xsl:if test="$namespace = 'ieee'">
9264
+ <xsl:text>—</xsl:text> em dash &#x2014;
9265
+ </xsl:if> -->
9266
+ <!-- <xsl:if test="$namespace = 'iho' or $namespace = 'gb' or $namespace = 'm3d' or $namespace = 'unece-rec' or $namespace = 'unece' or $namespace = 'rsd'">
9267
+ <xsl:text>:</xsl:text>
9268
+ </xsl:if> -->
9269
+
9270
+ <!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp'">
9271
+ <xsl:text> – </xsl:text> en dash &#x2013;
9272
+ </xsl:if> -->
9190
9273
  </xsl:otherwise>
9191
9274
  </xsl:choose>
9192
9275
  </xsl:variable>
@@ -9205,6 +9288,16 @@
9205
9288
  </xsl:when>
9206
9289
  <xsl:otherwise>
9207
9290
 
9291
+ <!-- https://github.com/metanorma/isodoc/issues/607 -->
9292
+ <!-- <xsl:if test="$namespace = 'ieee'">
9293
+ <xsl:text>—</xsl:text> em dash &#x2014;
9294
+ </xsl:if> -->
9295
+ <!-- <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'">
9296
+ <xsl:text>:</xsl:text>
9297
+ </xsl:if> -->
9298
+ <!-- <xsl:if test="$namespace = 'itu' or $namespace = 'nist-cswp' or $namespace = 'nist-sp' or $namespace = 'unece-rec' or $namespace = 'unece'">
9299
+ <xsl:text> – </xsl:text> en dash &#x2013;
9300
+ </xsl:if> -->
9208
9301
  </xsl:otherwise>
9209
9302
  </xsl:choose>
9210
9303
  </xsl:variable>
@@ -11370,7 +11463,7 @@
11370
11463
  <xsl:if test="normalize-space() != ''">
11371
11464
  <fo:inline xsl:use-attribute-sets="termexample-name-style">
11372
11465
  <xsl:call-template name="refine_termexample-name-style"/>
11373
- <xsl:apply-templates/>
11466
+ <xsl:apply-templates/> <!-- commented $namespace = 'ieee', https://github.com/metanorma/isodoc/issues/614-->
11374
11467
  </fo:inline>
11375
11468
  </xsl:if>
11376
11469
  </xsl:template>
@@ -11536,7 +11629,7 @@
11536
11629
  <xsl:otherwise>
11537
11630
  <fo:inline xsl:use-attribute-sets="example-name-style">
11538
11631
  <xsl:call-template name="refine_example-name-style"/>
11539
- <xsl:apply-templates/>
11632
+ <xsl:apply-templates/> <!-- $namespace = 'ieee', see https://github.com/metanorma/isodoc/issues/614 -->
11540
11633
  </fo:inline>
11541
11634
  </xsl:otherwise>
11542
11635
  </xsl:choose>
@@ -11722,15 +11815,17 @@
11722
11815
 
11723
11816
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
11724
11817
  <fo:block role="BlockQuote">
11725
- <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
11818
+ <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 -->
11726
11819
  </fo:block>
11727
11820
  </fo:block-container>
11728
11821
  </fo:block-container>
11729
- <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
11822
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source'] or *[local-name() = 'attribution']">
11730
11823
  <fo:block xsl:use-attribute-sets="quote-source-style">
11731
11824
  <!-- — ISO, ISO 7301:2011, Clause 1 -->
11732
11825
  <xsl:apply-templates select="*[local-name() = 'author']"/>
11733
11826
  <xsl:apply-templates select="*[local-name() = 'source']"/>
11827
+ <!-- added for https://github.com/metanorma/isodoc/issues/607 -->
11828
+ <xsl:apply-templates select="*[local-name() = 'attribution']/*[local-name() = 'p']/node()"/>
11734
11829
  </fo:block>
11735
11830
  </xsl:if>
11736
11831
 
@@ -11757,9 +11852,13 @@
11757
11852
  </xsl:template>
11758
11853
 
11759
11854
  <xsl:template match="*[local-name() = 'author']">
11760
- <xsl:text>— </xsl:text>
11855
+ <xsl:if test="local-name(..) = 'quote'"> <!-- for old Presentation XML, https://github.com/metanorma/isodoc/issues/607 -->
11856
+ <xsl:text>— </xsl:text>
11857
+ </xsl:if>
11761
11858
  <xsl:apply-templates/>
11762
11859
  </xsl:template>
11860
+
11861
+ <xsl:template match="*[local-name() = 'quote']//*[local-name() = 'referenceFrom']"/>
11763
11862
  <!-- ====== -->
11764
11863
  <!-- ====== -->
11765
11864
 
@@ -11950,8 +12049,12 @@
11950
12049
  </xsl:template>
11951
12050
 
11952
12051
  <xsl:template match="*[local-name() = 'domain']">
12052
+ <!-- https://github.com/metanorma/isodoc/issues/607
11953
12053
  <fo:inline xsl:use-attribute-sets="domain-style">&lt;<xsl:apply-templates/>&gt;</fo:inline>
11954
- <xsl:text> </xsl:text>
12054
+ <xsl:text> </xsl:text> -->
12055
+ <xsl:if test="not(@hidden = 'true')">
12056
+ <xsl:apply-templates/>
12057
+ </xsl:if>
11955
12058
  </xsl:template>
11956
12059
 
11957
12060
  <xsl:template match="*[local-name() = 'admitted']">
@@ -11999,6 +12102,29 @@
11999
12102
  <!-- END definition -->
12000
12103
  <!-- ========== -->
12001
12104
 
12105
+ <xsl:variable name="reviews_">
12106
+ <xsl:for-each select="//*[local-name() = 'review'][@from]">
12107
+ <xsl:copy>
12108
+ <xsl:copy-of select="@from"/>
12109
+ <xsl:copy-of select="@id"/>
12110
+ </xsl:copy>
12111
+ </xsl:for-each>
12112
+ </xsl:variable>
12113
+ <xsl:variable name="reviews" select="xalan:nodeset($reviews_)"/>
12114
+
12115
+ <xsl:template name="addReviewHelper">
12116
+ <!-- if there is review with from="...", then add small helper block for Annot tag adding, see 'review' template -->
12117
+ <xsl:variable name="curr_id" select="@id"/>
12118
+ <xsl:variable name="review_id" select="normalize-space($reviews//*[local-name() = 'review'][@from = $curr_id]/@id)"/>
12119
+ <xsl:if test="$review_id != ''"> <!-- i.e. if review found -->
12120
+ <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>
12121
+ </xsl:if>
12122
+ <!-- <fo:block>
12123
+ <curr_id><xsl:value-of select="$curr_id"/></curr_id>
12124
+ <xsl:copy-of select="$reviews"/>
12125
+ </fo:block> -->
12126
+ </xsl:template>
12127
+
12002
12128
  <!-- main sections -->
12003
12129
  <xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
12004
12130
 
@@ -12007,6 +12133,8 @@
12007
12133
 
12008
12134
  <xsl:call-template name="sections_element_style"/>
12009
12135
 
12136
+ <xsl:call-template name="addReviewHelper"/>
12137
+
12010
12138
  <xsl:apply-templates/>
12011
12139
  </fo:block>
12012
12140
 
@@ -12042,6 +12170,7 @@
12042
12170
 
12043
12171
  <fo:block>
12044
12172
  <xsl:call-template name="setId"/>
12173
+ <xsl:call-template name="addReviewHelper"/>
12045
12174
  <xsl:apply-templates/>
12046
12175
  </fo:block>
12047
12176
  </xsl:template>
@@ -12078,6 +12207,8 @@
12078
12207
 
12079
12208
  <xsl:call-template name="refine_clause_style"/>
12080
12209
 
12210
+ <xsl:call-template name="addReviewHelper"/>
12211
+
12081
12212
  <xsl:apply-templates/>
12082
12213
  </fo:block>
12083
12214
  </xsl:template>
@@ -12130,6 +12261,23 @@
12130
12261
 
12131
12262
  <xsl:variable name="id_from" select="normalize-space(current()/@from)"/>
12132
12263
 
12264
+ <xsl:if test="1 = 1">
12265
+ <xsl:choose>
12266
+ <!-- if there isn't the attribute '@from', then -->
12267
+ <xsl:when test="$id_from = ''">
12268
+ <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>
12269
+ </xsl:when>
12270
+ <!-- if there isn't element with id 'from', then create 'bookmark' here -->
12271
+ <xsl:when test="ancestor::*[contains(local-name(), '-standard')] and not(ancestor::*[contains(local-name(), '-standard')]//*[@id = $id_from])">
12272
+ <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>
12273
+ </xsl:when>
12274
+ <xsl:when test="not(/*[@id = $id_from]) and not(/*//*[@id = $id_from]) and not(preceding-sibling::*[@id = $id_from])">
12275
+ <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>
12276
+ </xsl:when>
12277
+ </xsl:choose>
12278
+ </xsl:if>
12279
+
12280
+ <xsl:if test="1 = 2">
12133
12281
  <xsl:choose>
12134
12282
  <!-- if there isn't the attribute '@from', then -->
12135
12283
  <xsl:when test="$id_from = ''">
@@ -12143,6 +12291,7 @@
12143
12291
  <fo:block id="{@from}" font-size="1pt"><xsl:value-of select="$hair_space"/></fo:block>
12144
12292
  </xsl:when>
12145
12293
  </xsl:choose>
12294
+ </xsl:if>
12146
12295
 
12147
12296
  </xsl:template>
12148
12297
 
@@ -13561,7 +13710,7 @@
13561
13710
  <!-- remove preprocess-xslt -->
13562
13711
  <xsl:template match="*[local-name() = 'preprocess-xslt']" mode="update_xml_step1"/>
13563
13712
 
13564
- <xsl:template match="*[local-name() = 'stem'] | *[local-name() = 'image'] | *[local-name() = 'sourcecode'] | *[local-name() = 'bibdata'] | *[local-name() = 'localized-strings']" mode="update_xml_step1">
13713
+ <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">
13565
13714
  <xsl:copy-of select="."/>
13566
13715
  </xsl:template>
13567
13716
 
@@ -13627,6 +13776,22 @@
13627
13776
  </xsl:choose>
13628
13777
  </xsl:template>
13629
13778
 
13779
+ <xsl:variable name="regex_passthrough">.*\bpdf\b.*</xsl:variable>
13780
+ <xsl:template match="*[local-name() = 'passthrough']" mode="update_xml_step1">
13781
+ <!-- <xsl:if test="contains(@formats, ' pdf ')"> -->
13782
+ <xsl:if test="normalize-space(java:matches(java:java.lang.String.new(@formats), $regex_passthrough)) = 'true'">
13783
+ <xsl:apply-templates mode="update_xml_step1"/>
13784
+ </xsl:if>
13785
+ </xsl:template>
13786
+
13787
+ <!-- split math by element with @linebreak into maths -->
13788
+ <xsl:template match="mathml:math[.//mathml:mo[@linebreak] or .//mathml:mspace[@linebreak]]" mode="update_xml_step1">
13789
+ <xsl:variable name="maths">
13790
+ <xsl:apply-templates select="." mode="mathml_linebreak"/>
13791
+ </xsl:variable>
13792
+ <xsl:copy-of select="$maths"/>
13793
+ </xsl:template>
13794
+
13630
13795
  <!-- =========================================================================== -->
13631
13796
  <!-- END STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
13632
13797
  <!-- =========================================================================== -->
@@ -13730,6 +13895,8 @@
13730
13895
 
13731
13896
  <xsl:template name="insertOpeningElements">
13732
13897
  <xsl:param name="tree"/>
13898
+ <xsl:param name="xmlns"/>
13899
+ <xsl:param name="add_continue">true</xsl:param>
13733
13900
  <xsl:for-each select="$tree//element">
13734
13901
  <xsl:text disable-output-escaping="yes">&lt;</xsl:text>
13735
13902
  <xsl:value-of select="."/>
@@ -13740,7 +13907,8 @@
13740
13907
  <xsl:value-of select="."/>
13741
13908
  <xsl:text>"</xsl:text>
13742
13909
  </xsl:for-each>
13743
- <xsl:if test="position() = 1"> continue="true"</xsl:if>
13910
+ <xsl:if test="position() = 1 and $add_continue = 'true'"> continue="true"</xsl:if>
13911
+ <xsl:if test="position() = 1 and $xmlns != ''"> xmlns="<xsl:value-of select="$xmlns"/>"</xsl:if>
13744
13912
  <xsl:text disable-output-escaping="yes">&gt;</xsl:text>
13745
13913
  <xsl:if test="$debug = 'true'">
13746
13914
  <xsl:message>&lt;<xsl:value-of select="."/>&gt;</xsl:message>
@@ -54,7 +54,7 @@ module IsoDoc
54
54
  isoxml.xpath(ns("//bibdata/date")).each do |d|
55
55
  val = Common::date_range(d)
56
56
  @lang == "ja" and val = @i18n.japanese_date(val)
57
- set("#{d['type'].gsub(/-/, '_')}date".to_sym, val)
57
+ set("#{d['type'].tr('-', '_')}date".to_sym, val)
58
58
  end
59
59
  end
60
60
 
@@ -65,7 +65,7 @@ module IsoDoc
65
65
  dest = doc.at(ns("//sections")) ||
66
66
  doc.at(ns("//preface")).after("<sections> </sections>").next_element
67
67
  dest.children.empty? and dest.children = " "
68
- dest.children.first.next = source
68
+ dest.add_first_child source
69
69
  end
70
70
 
71
71
  def move_participants(doc)
@@ -73,7 +73,7 @@ module IsoDoc
73
73
  t = participant_table(p) or return
74
74
  p.remove
75
75
  ins = make_preface(doc) or return nil
76
- ins.children.first.previous = t
76
+ ins.add_first_child t
77
77
  end
78
78
 
79
79
  def participant_table(clause)
@@ -45,12 +45,8 @@ module IsoDoc
45
45
  elem.children.first.previous = @i18n.l10n("#{@i18n.admitted}: ")
46
46
  end
47
47
 
48
- def block(docxml)
49
- super
50
- dl docxml
51
- end
52
-
53
48
  def dl(docxml)
49
+ super
54
50
  docxml.xpath(ns("//table//dl | //figure//dl")).each do |l|
55
51
  l.at(ns("./dl")) || l.at("./ancestor::xmlns:dl") and next
56
52
  dl_to_para(l)
@@ -135,6 +131,10 @@ module IsoDoc
135
131
  elem.children = l10n("#{@i18n.source}: #{to_xml(elem.children).strip}")
136
132
  end
137
133
 
134
+ def table_fn1(_table, fnote, _idx)
135
+ fnote["reference"] += ")"
136
+ end
137
+
138
138
  def bibdata_i18n(bibdata)
139
139
  super
140
140
  @lang == "ja" and date_translate(bibdata)
@@ -182,6 +182,18 @@ module IsoDoc
182
182
  a << ret
183
183
  end
184
184
 
185
+ def figure_fn(elem)
186
+ (elem.xpath(ns(".//fn")) - elem.xpath(ns("./name//fn")))
187
+ .each do |f|
188
+ table_fn1(elem, f, nil)
189
+ end
190
+ end
191
+
192
+ def omit_docid_prefix(prefix)
193
+ prefix.nil? || prefix.empty? and return true
194
+ super || %w(JIS).include?(prefix)
195
+ end
196
+
185
197
  include Init
186
198
  end
187
199
  end
@@ -29,7 +29,7 @@ module IsoDoc
29
29
  def make_tr_attr_style(cell, row, rowmax, totalrows, opt)
30
30
  top = row.zero? ? "#{SW1} 1.5pt;" : "none;"
31
31
  bottom = "#{SW1} #{rowmax >= totalrows ? '1.5' : '1.0'}pt;"
32
- ret = <<~STYLE.gsub(/\n/, "")
32
+ ret = <<~STYLE.delete("\n")
33
33
  border-top:#{top}mso-border-top-alt:#{top}
34
34
  border-left:#{bottom}mso-border-top-alt:#{bottom}
35
35
  border-right:#{bottom}mso-border-top-alt:#{bottom}
@@ -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">
@@ -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>
@@ -27,7 +27,6 @@ module Metanorma
27
27
  "Noto Serif JP" => nil,
28
28
  "Noto Serif JP ExtraLight" => nil,
29
29
  "Noto Serif JP Medium" => nil,
30
- "Noto Serif JP Bold" => nil,
31
30
  "Noto Serif JP Black" => nil,
32
31
  "Noto Sans JP Thin" => nil,
33
32
  "Noto Sans JP Medium" => nil,
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Jis
3
- VERSION = "0.3.7".freeze
3
+ VERSION = "0.4.0".freeze
4
4
  end
5
5
  end
6
6
 
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
32
32
 
33
33
  spec.add_dependency "japanese_calendar", "~> 0"
34
- spec.add_dependency "metanorma-iso", "~> 2.8.0"
34
+ spec.add_dependency "metanorma-iso", "~> 2.9.0"
35
35
  spec.add_dependency "pubid"
36
36
 
37
37
  spec.add_development_dependency "debug"
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.3.7
4
+ version: 0.4.0
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-10-28 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: japanese_calendar
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 2.8.0
33
+ version: 2.9.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 2.8.0
40
+ version: 2.9.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: pubid
43
43
  requirement: !ruby/object:Gem::Requirement