metanorma-iso 2.1.9 → 2.2.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: 736603eaeed361ebf56fc8903c4d25db5a5a38639bce84a8a27923929d5c591d
4
- data.tar.gz: fa9c3e2707ed1642cbbd934061c556c8bf7613d5d88575cd35bf86b84ed9ce8e
3
+ metadata.gz: 0af0800e26b96ca0808ae0be76f68c3311325d2271c10a1c91cd112bc041dcc4
4
+ data.tar.gz: 587c652c18c8845754062388caf26d4968b6d1f7742bb049a04fe41b88dae29a
5
5
  SHA512:
6
- metadata.gz: 23dbd404fb1b7745a787f7c70f7f7d3885b499b4329c49f821bc7e81361eed76c7378539c973b596b5b033801757081c152069e467267c566f4de14fb56d471e
7
- data.tar.gz: 975d364c1c59be33c513cb5f010d1b393dd9ff33d336816f8433ca5bfccbf09d94137212fd642737c4c1303815099857acf8518bc28d443256ce95b744905d29
6
+ metadata.gz: 9e0ad39b60566f4ddf7aee46f15c9cb68c32e44e61a1f55bf26a64b7ffbe5c65ab8015dc41f4b95afdf06e79fa2c0c46fe75b3ccd93a6d19ebbfb6747fbb4f85
7
+ data.tar.gz: 695551d2e13d64d7b522634fcfb6e81a002e9f0a1c0440cc6ef1614b8bc53546f23d8c2b53159665644f5e31bd2dde43a610930e01fdf6a5850675deac68fcb7
@@ -72,4 +72,3 @@ requirements:
72
72
  modspec:
73
73
  description: Description
74
74
  provisions: Dispositions
75
-
@@ -73,4 +73,3 @@ requirements:
73
73
  modspec:
74
74
  description: 描述
75
75
  provisions: 条件
76
-
@@ -6,8 +6,8 @@ require_relative "i18n"
6
6
  module IsoDoc
7
7
  module Iso
8
8
  module Init
9
- def metadata_init(lang, script, i18n)
10
- @meta = Metadata.new(lang, script, i18n)
9
+ def metadata_init(lang, script, locale, i18n)
10
+ @meta = Metadata.new(lang, script, locale, i18n)
11
11
  end
12
12
 
13
13
  def xref_init(lang, script, _klass, i18n, options)
@@ -15,12 +15,13 @@ module IsoDoc
15
15
  @xrefs = Xref.new(lang, script, html, i18n, options)
16
16
  end
17
17
 
18
- def i18n_init(lang, script, i18nyaml = nil)
19
- @i18n = I18n.new(lang, script, i18nyaml: i18nyaml || @i18nyaml)
18
+ def i18n_init(lang, script, locale, i18nyaml = nil)
19
+ @i18n = I18n.new(lang, script, locale: locale,
20
+ i18nyaml: i18nyaml || @i18nyaml)
20
21
  end
21
22
 
22
23
  def amd(docxml)
23
- doctype = docxml&.at(ns("//bibdata/ext/doctype"))&.text
24
+ doctype = docxml.at(ns("//bibdata/ext/doctype"))&.text
24
25
  %w(amendment technical-corrigendum).include? doctype
25
26
  end
26
27
 
@@ -39,14 +40,18 @@ module IsoDoc
39
40
  ids.map! do |i|
40
41
  if %w(GUIDE TR TS DIR).include?(i)
41
42
  "<span class='stddocNumber'>#{i}</span>"
42
- else
43
- i.sub(/^([^0-9]+)(\s|$)/, "<span class='stdpublisher'>\\1</span>\\2")
44
- .sub(/([0-9]+)/, "<span class='stddocNumber'>\\1</span>")
45
- .sub(/-([0-9]+)/, "-<span class='stddocPartNumber'>\\1</span>")
46
- .sub(/:([0-9]{4})(?!\d)/, ":<span class='stdyear'>\\1</span>")
43
+ else std_docid_semantic_full(i)
47
44
  end
48
45
  end.join(" ")
49
46
  end
47
+
48
+ def std_docid_semantic_full(ident)
49
+ ident
50
+ .sub(/^([^0-9]+)(\s|$)/, "<span class='stdpublisher'>\\1</span>\\2")
51
+ .sub(/([0-9]+)/, "<span class='stddocNumber'>\\1</span>")
52
+ .sub(/-([0-9]+)/, "-<span class='stddocPartNumber'>\\1</span>")
53
+ .sub(/:([0-9]{4})(?!\d)/, ":<span class='stdyear'>\\1</span>")
54
+ end
50
55
  end
51
56
  end
52
57
  end
@@ -4,7 +4,7 @@
4
4
 
5
5
  <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/>
6
6
 
7
- <xsl:key name="attachments" match="iso:eref[contains(@bibitemid, '.exp')]" use="@bibitemid"/>
7
+ <xsl:key name="attachments" match="iso:eref[java:endsWith(java:java.lang.String.new(@bibitemid),'.exp')]" use="@bibitemid"/>
8
8
 
9
9
  <xsl:variable name="namespace_full">https://www.metanorma.org/ns/iso</xsl:variable>
10
10
 
@@ -1414,7 +1414,23 @@
1414
1414
  </fo:page-sequence>
1415
1415
 
1416
1416
  <!-- Index -->
1417
- <xsl:apply-templates select="//iso:indexsect" mode="index"/>
1417
+ <xsl:variable name="docid">
1418
+ <xsl:call-template name="getDocumentId"/>
1419
+ </xsl:variable>
1420
+
1421
+ <xsl:variable name="current_document_index_id">
1422
+ <xsl:apply-templates select="//iso:indexsect" mode="index_add_id">
1423
+ <xsl:with-param name="docid" select="$docid"/>
1424
+ </xsl:apply-templates>
1425
+
1426
+ </xsl:variable>
1427
+
1428
+ <xsl:variable name="current_document_index">
1429
+ <xsl:apply-templates select="xalan:nodeset($current_document_index_id)" mode="index_update"/>
1430
+ </xsl:variable>
1431
+
1432
+ <!-- <xsl:apply-templates select="//iso:indexsect" mode="index"/> -->
1433
+ <xsl:apply-templates select="xalan:nodeset($current_document_index)" mode="index"/>
1418
1434
 
1419
1435
  <xsl:if test="$isPublished = 'true'">
1420
1436
  <fo:page-sequence master-reference="last-page" force-page-count="no-force">
@@ -1920,7 +1936,7 @@
1920
1936
  </xsl:template>
1921
1937
 
1922
1938
  <!-- For express listings PDF attachments -->
1923
- <xsl:template match="*[local-name() = 'eref'][contains(@bibitemid, '.exp')]" priority="2">
1939
+ <xsl:template match="*[local-name() = 'eref'][java:endsWith(java:java.lang.String.new(@bibitemid),'.exp')]" priority="2">
1924
1940
  <fo:inline xsl:use-attribute-sets="eref-style">
1925
1941
  <xsl:variable name="url" select="concat('url(embedded-file:', @bibitemid, ')')"/>
1926
1942
  <fo:basic-link external-destination="{$url}" fox:alt-text="{@citeas}">
@@ -8065,6 +8081,18 @@
8065
8081
  </xsl:copy>
8066
8082
  </xsl:template>
8067
8083
 
8084
+ <xsl:template match="*[local-name() = 'sub']" mode="contents_item">
8085
+ <xsl:copy>
8086
+ <xsl:apply-templates mode="contents_item"/>
8087
+ </xsl:copy>
8088
+ </xsl:template>
8089
+
8090
+ <xsl:template match="*[local-name() = 'sup']" mode="contents_item">
8091
+ <xsl:copy>
8092
+ <xsl:apply-templates mode="contents_item"/>
8093
+ </xsl:copy>
8094
+ </xsl:template>
8095
+
8068
8096
  <xsl:template match="*[local-name() = 'stem']" mode="contents_item">
8069
8097
  <xsl:copy-of select="."/>
8070
8098
  </xsl:template>
@@ -9515,21 +9543,29 @@
9515
9543
  </xsl:variable>
9516
9544
 
9517
9545
  <xsl:template match="@*|node()" mode="index_add_id">
9546
+ <xsl:param name="docid"/>
9518
9547
  <xsl:copy>
9519
- <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
9548
+ <xsl:apply-templates select="@*|node()" mode="index_add_id">
9549
+ <xsl:with-param name="docid" select="$docid"/>
9550
+ </xsl:apply-templates>
9520
9551
  </xsl:copy>
9521
9552
  </xsl:template>
9522
9553
 
9523
9554
  <xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
9555
+ <xsl:param name="docid"/>
9524
9556
  <xsl:variable name="id">
9525
- <xsl:call-template name="generateIndexXrefId"/>
9557
+ <xsl:call-template name="generateIndexXrefId">
9558
+ <xsl:with-param name="docid" select="$docid"/>
9559
+ </xsl:call-template>
9526
9560
  </xsl:variable>
9527
9561
  <xsl:copy> <!-- add id to xref -->
9528
9562
  <xsl:apply-templates select="@*" mode="index_add_id"/>
9529
9563
  <xsl:attribute name="id">
9530
9564
  <xsl:value-of select="$id"/>
9531
9565
  </xsl:attribute>
9532
- <xsl:apply-templates mode="index_add_id"/>
9566
+ <xsl:apply-templates mode="index_add_id">
9567
+ <xsl:with-param name="docid" select="$docid"/>
9568
+ </xsl:apply-templates>
9533
9569
  </xsl:copy>
9534
9570
  <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
9535
9571
  <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
@@ -9541,7 +9577,9 @@
9541
9577
  <xsl:attribute name="id">
9542
9578
  <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
9543
9579
  </xsl:attribute>
9544
- <xsl:apply-templates mode="index_add_id"/>
9580
+ <xsl:apply-templates mode="index_add_id">
9581
+ <xsl:with-param name="docid" select="$docid"/>
9582
+ </xsl:apply-templates>
9545
9583
  </xsl:copy>
9546
9584
  </xsl:if>
9547
9585
  </xsl:template>
@@ -9578,12 +9616,33 @@
9578
9616
  </xsl:when>
9579
9617
  <xsl:when test="self::* and local-name(.) = 'xref'">
9580
9618
  <xsl:variable name="id" select="@id"/>
9581
- <xsl:variable name="page" select="$index//item[@id = $id]"/>
9582
- <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
9583
- <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
9584
9619
 
9620
+ <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
9585
9621
  <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
9586
- <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
9622
+
9623
+ <xsl:variable name="pages_">
9624
+ <xsl:for-each select="$index/index/item[@id = $id or @id = $id_next or @id = $id_prev]">
9625
+ <xsl:choose>
9626
+ <xsl:when test="@id = $id">
9627
+ <page><xsl:value-of select="."/></page>
9628
+ </xsl:when>
9629
+ <xsl:when test="@id = $id_next">
9630
+ <page_next><xsl:value-of select="."/></page_next>
9631
+ </xsl:when>
9632
+ <xsl:when test="@id = $id_prev">
9633
+ <page_prev><xsl:value-of select="."/></page_prev>
9634
+ </xsl:when>
9635
+ </xsl:choose>
9636
+ </xsl:for-each>
9637
+ </xsl:variable>
9638
+ <xsl:variable name="pages" select="xalan:nodeset($pages_)"/>
9639
+
9640
+ <!-- <xsl:variable name="page" select="$index/index/item[@id = $id]"/> -->
9641
+ <xsl:variable name="page" select="$pages/page"/>
9642
+ <!-- <xsl:variable name="page_next" select="$index/index/item[@id = $id_next]"/> -->
9643
+ <xsl:variable name="page_next" select="$pages/page_next"/>
9644
+ <!-- <xsl:variable name="page_prev" select="$index/index/item[@id = $id_prev]"/> -->
9645
+ <xsl:variable name="page_prev" select="$pages/page_prev"/>
9587
9646
 
9588
9647
  <xsl:choose>
9589
9648
  <!-- 2nd pass -->
@@ -9643,16 +9702,20 @@
9643
9702
  </xsl:template>
9644
9703
 
9645
9704
  <xsl:template name="generateIndexXrefId">
9705
+ <xsl:param name="docid"/>
9706
+
9646
9707
  <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
9647
9708
 
9648
- <xsl:variable name="docid">
9649
- <xsl:call-template name="getDocumentId"/>
9709
+ <xsl:variable name="docid_curr">
9710
+ <xsl:value-of select="$docid"/>
9711
+ <xsl:if test="normalize-space($docid) = ''"><xsl:call-template name="getDocumentId"/></xsl:if>
9650
9712
  </xsl:variable>
9713
+
9651
9714
  <xsl:variable name="item_number">
9652
9715
  <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
9653
9716
  </xsl:variable>
9654
9717
  <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
9655
- <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
9718
+ <xsl:value-of select="concat($docid_curr, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
9656
9719
  </xsl:template>
9657
9720
 
9658
9721
  <xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'title']" priority="4">
@@ -4,7 +4,7 @@
4
4
 
5
5
  <xsl:key name="kfn" match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])]" use="@reference"/>
6
6
 
7
- <xsl:key name="attachments" match="iso:eref[contains(@bibitemid, '.exp')]" use="@bibitemid"/>
7
+ <xsl:key name="attachments" match="iso:eref[java:endsWith(java:java.lang.String.new(@bibitemid),'.exp')]" use="@bibitemid"/>
8
8
 
9
9
  <xsl:variable name="namespace_full">https://www.metanorma.org/ns/iso</xsl:variable>
10
10
 
@@ -1414,7 +1414,23 @@
1414
1414
  </fo:page-sequence>
1415
1415
 
1416
1416
  <!-- Index -->
1417
- <xsl:apply-templates select="//iso:indexsect" mode="index"/>
1417
+ <xsl:variable name="docid">
1418
+ <xsl:call-template name="getDocumentId"/>
1419
+ </xsl:variable>
1420
+
1421
+ <xsl:variable name="current_document_index_id">
1422
+ <xsl:apply-templates select="//iso:indexsect" mode="index_add_id">
1423
+ <xsl:with-param name="docid" select="$docid"/>
1424
+ </xsl:apply-templates>
1425
+
1426
+ </xsl:variable>
1427
+
1428
+ <xsl:variable name="current_document_index">
1429
+ <xsl:apply-templates select="xalan:nodeset($current_document_index_id)" mode="index_update"/>
1430
+ </xsl:variable>
1431
+
1432
+ <!-- <xsl:apply-templates select="//iso:indexsect" mode="index"/> -->
1433
+ <xsl:apply-templates select="xalan:nodeset($current_document_index)" mode="index"/>
1418
1434
 
1419
1435
  <xsl:if test="$isPublished = 'true'">
1420
1436
  <fo:page-sequence master-reference="last-page" force-page-count="no-force">
@@ -1920,7 +1936,7 @@
1920
1936
  </xsl:template>
1921
1937
 
1922
1938
  <!-- For express listings PDF attachments -->
1923
- <xsl:template match="*[local-name() = 'eref'][contains(@bibitemid, '.exp')]" priority="2">
1939
+ <xsl:template match="*[local-name() = 'eref'][java:endsWith(java:java.lang.String.new(@bibitemid),'.exp')]" priority="2">
1924
1940
  <fo:inline xsl:use-attribute-sets="eref-style">
1925
1941
  <xsl:variable name="url" select="concat('url(embedded-file:', @bibitemid, ')')"/>
1926
1942
  <fo:basic-link external-destination="{$url}" fox:alt-text="{@citeas}">
@@ -8065,6 +8081,18 @@
8065
8081
  </xsl:copy>
8066
8082
  </xsl:template>
8067
8083
 
8084
+ <xsl:template match="*[local-name() = 'sub']" mode="contents_item">
8085
+ <xsl:copy>
8086
+ <xsl:apply-templates mode="contents_item"/>
8087
+ </xsl:copy>
8088
+ </xsl:template>
8089
+
8090
+ <xsl:template match="*[local-name() = 'sup']" mode="contents_item">
8091
+ <xsl:copy>
8092
+ <xsl:apply-templates mode="contents_item"/>
8093
+ </xsl:copy>
8094
+ </xsl:template>
8095
+
8068
8096
  <xsl:template match="*[local-name() = 'stem']" mode="contents_item">
8069
8097
  <xsl:copy-of select="."/>
8070
8098
  </xsl:template>
@@ -9515,21 +9543,29 @@
9515
9543
  </xsl:variable>
9516
9544
 
9517
9545
  <xsl:template match="@*|node()" mode="index_add_id">
9546
+ <xsl:param name="docid"/>
9518
9547
  <xsl:copy>
9519
- <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
9548
+ <xsl:apply-templates select="@*|node()" mode="index_add_id">
9549
+ <xsl:with-param name="docid" select="$docid"/>
9550
+ </xsl:apply-templates>
9520
9551
  </xsl:copy>
9521
9552
  </xsl:template>
9522
9553
 
9523
9554
  <xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
9555
+ <xsl:param name="docid"/>
9524
9556
  <xsl:variable name="id">
9525
- <xsl:call-template name="generateIndexXrefId"/>
9557
+ <xsl:call-template name="generateIndexXrefId">
9558
+ <xsl:with-param name="docid" select="$docid"/>
9559
+ </xsl:call-template>
9526
9560
  </xsl:variable>
9527
9561
  <xsl:copy> <!-- add id to xref -->
9528
9562
  <xsl:apply-templates select="@*" mode="index_add_id"/>
9529
9563
  <xsl:attribute name="id">
9530
9564
  <xsl:value-of select="$id"/>
9531
9565
  </xsl:attribute>
9532
- <xsl:apply-templates mode="index_add_id"/>
9566
+ <xsl:apply-templates mode="index_add_id">
9567
+ <xsl:with-param name="docid" select="$docid"/>
9568
+ </xsl:apply-templates>
9533
9569
  </xsl:copy>
9534
9570
  <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
9535
9571
  <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
@@ -9541,7 +9577,9 @@
9541
9577
  <xsl:attribute name="id">
9542
9578
  <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
9543
9579
  </xsl:attribute>
9544
- <xsl:apply-templates mode="index_add_id"/>
9580
+ <xsl:apply-templates mode="index_add_id">
9581
+ <xsl:with-param name="docid" select="$docid"/>
9582
+ </xsl:apply-templates>
9545
9583
  </xsl:copy>
9546
9584
  </xsl:if>
9547
9585
  </xsl:template>
@@ -9578,12 +9616,33 @@
9578
9616
  </xsl:when>
9579
9617
  <xsl:when test="self::* and local-name(.) = 'xref'">
9580
9618
  <xsl:variable name="id" select="@id"/>
9581
- <xsl:variable name="page" select="$index//item[@id = $id]"/>
9582
- <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
9583
- <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
9584
9619
 
9620
+ <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
9585
9621
  <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
9586
- <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
9622
+
9623
+ <xsl:variable name="pages_">
9624
+ <xsl:for-each select="$index/index/item[@id = $id or @id = $id_next or @id = $id_prev]">
9625
+ <xsl:choose>
9626
+ <xsl:when test="@id = $id">
9627
+ <page><xsl:value-of select="."/></page>
9628
+ </xsl:when>
9629
+ <xsl:when test="@id = $id_next">
9630
+ <page_next><xsl:value-of select="."/></page_next>
9631
+ </xsl:when>
9632
+ <xsl:when test="@id = $id_prev">
9633
+ <page_prev><xsl:value-of select="."/></page_prev>
9634
+ </xsl:when>
9635
+ </xsl:choose>
9636
+ </xsl:for-each>
9637
+ </xsl:variable>
9638
+ <xsl:variable name="pages" select="xalan:nodeset($pages_)"/>
9639
+
9640
+ <!-- <xsl:variable name="page" select="$index/index/item[@id = $id]"/> -->
9641
+ <xsl:variable name="page" select="$pages/page"/>
9642
+ <!-- <xsl:variable name="page_next" select="$index/index/item[@id = $id_next]"/> -->
9643
+ <xsl:variable name="page_next" select="$pages/page_next"/>
9644
+ <!-- <xsl:variable name="page_prev" select="$index/index/item[@id = $id_prev]"/> -->
9645
+ <xsl:variable name="page_prev" select="$pages/page_prev"/>
9587
9646
 
9588
9647
  <xsl:choose>
9589
9648
  <!-- 2nd pass -->
@@ -9643,16 +9702,20 @@
9643
9702
  </xsl:template>
9644
9703
 
9645
9704
  <xsl:template name="generateIndexXrefId">
9705
+ <xsl:param name="docid"/>
9706
+
9646
9707
  <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
9647
9708
 
9648
- <xsl:variable name="docid">
9649
- <xsl:call-template name="getDocumentId"/>
9709
+ <xsl:variable name="docid_curr">
9710
+ <xsl:value-of select="$docid"/>
9711
+ <xsl:if test="normalize-space($docid) = ''"><xsl:call-template name="getDocumentId"/></xsl:if>
9650
9712
  </xsl:variable>
9713
+
9651
9714
  <xsl:variable name="item_number">
9652
9715
  <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
9653
9716
  </xsl:variable>
9654
9717
  <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
9655
- <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
9718
+ <xsl:value-of select="concat($docid_curr, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
9656
9719
  </xsl:template>
9657
9720
 
9658
9721
  <xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'title']" priority="4">
@@ -3,7 +3,7 @@ require "isodoc"
3
3
  module IsoDoc
4
4
  module Iso
5
5
  class Metadata < IsoDoc::Metadata
6
- def initialize(lang, script, i18n)
6
+ def initialize(lang, script, locale, i18n)
7
7
  super
8
8
  DATETYPES.each { |w| @metadata["#{w.gsub(/-/, '_')}date".to_sym] = nil }
9
9
  set(:editorialgroup, [])
@@ -54,6 +54,7 @@ module IsoDoc
54
54
  target&.gsub(/<[^>]+>/, "")&.match(/^IEV$|^IEC 60050-/)
55
55
  end
56
56
 
57
+ # ISO has not bothered to communicate to us what most of these span classes mean
57
58
  LOCALITY2SPAN = {
58
59
  annex: "citeapp",
59
60
  dunno: "citebase",
@@ -196,6 +196,12 @@ module IsoDoc
196
196
  end
197
197
  end
198
198
 
199
+ def table_attrs(node)
200
+ ret = super
201
+ node["class"] == "modspec" and ret[:width] = "100%"
202
+ ret
203
+ end
204
+
199
205
  include BaseConvert
200
206
  include Init
201
207
  end
@@ -24,12 +24,12 @@ module IsoDoc
24
24
  c.element? and preface_names(c)
25
25
  end
26
26
  end
27
- if @parse_settings.empty?
28
- sequential_asset_names(doc.xpath(ns("//preface/*")))
29
- middle_section_asset_names(doc)
30
- termnote_anchor_names(doc)
31
- termexample_anchor_names(doc)
32
- end
27
+ end
28
+
29
+ def asset_anchor_names(doc)
30
+ super
31
+ @parse_settings.empty? or return
32
+ sequential_asset_names(doc.xpath(ns("//preface/*")))
33
33
  end
34
34
 
35
35
  def initial_anchor_names1(doc)
@@ -47,11 +47,6 @@ module IsoDoc
47
47
  n = section_names(c, n, 1)
48
48
  end
49
49
  end
50
- if @parse_settings.empty?
51
- middle_section_asset_names(doc)
52
- termnote_anchor_names(doc)
53
- termexample_anchor_names(doc)
54
- end
55
50
  end
56
51
 
57
52
  # we can reference 0-number clauses in introduction
@@ -73,8 +73,14 @@
73
73
  <text/>
74
74
  </element>
75
75
  </define>
76
- <define name="script">
76
+ <define name="locale">
77
77
  <a:documentation>ISO-639</a:documentation>
78
+ <element name="locale">
79
+ <text/>
80
+ </element>
81
+ </define>
82
+ <define name="script">
83
+ <a:documentation>ISO-3166</a:documentation>
78
84
  <element name="script">
79
85
  <text/>
80
86
  </element>
@@ -93,6 +99,9 @@
93
99
  <!-- multiple languages and scripts possible: comma delimit them if so -->
94
100
  <attribute name="language"/>
95
101
  </optional>
102
+ <optional>
103
+ <attribute name="locale"/>
104
+ </optional>
96
105
  <optional>
97
106
  <attribute name="script"/>
98
107
  </optional>
@@ -136,6 +145,9 @@
136
145
  <!-- multiple languages and scripts possible: comma delimit them if so -->
137
146
  <attribute name="language"/>
138
147
  </optional>
148
+ <optional>
149
+ <attribute name="locale"/>
150
+ </optional>
139
151
  <optional>
140
152
  <attribute name="script"/>
141
153
  </optional>
@@ -650,6 +662,9 @@
650
662
  <zeroOrMore>
651
663
  <ref name="language"/>
652
664
  </zeroOrMore>
665
+ <zeroOrMore>
666
+ <ref name="locale"/>
667
+ </zeroOrMore>
653
668
  <zeroOrMore>
654
669
  <ref name="script"/>
655
670
  </zeroOrMore>
@@ -741,6 +756,9 @@
741
756
  <zeroOrMore>
742
757
  <ref name="language"/>
743
758
  </zeroOrMore>
759
+ <zeroOrMore>
760
+ <ref name="locale"/>
761
+ </zeroOrMore>
744
762
  <zeroOrMore>
745
763
  <ref name="script"/>
746
764
  </zeroOrMore>
@@ -854,6 +872,15 @@
854
872
  <optional>
855
873
  <attribute name="type"/>
856
874
  </optional>
875
+ <optional>
876
+ <attribute name="language"/>
877
+ </optional>
878
+ <optional>
879
+ <attribute name="locale"/>
880
+ </optional>
881
+ <optional>
882
+ <attribute name="script"/>
883
+ </optional>
857
884
  <data type="anyURI"/>
858
885
  </define>
859
886
  <define name="DateType">
@@ -882,6 +909,7 @@
882
909
  <value>vote-started</value>
883
910
  <value>vote-ended</value>
884
911
  <value>announced</value>
912
+ <value>stable-until</value>
885
913
  </choice>
886
914
  </define>
887
915
  <define name="bdate">
@@ -930,6 +958,9 @@
930
958
  <optional>
931
959
  <attribute name="language"/>
932
960
  </optional>
961
+ <optional>
962
+ <attribute name="locale"/>
963
+ </optional>
933
964
  <optional>
934
965
  <attribute name="script"/>
935
966
  </optional>
@@ -215,11 +215,11 @@ pub = (node.attr("publisher") || "ISO").split(/[;,]/)
215
215
 
216
216
  def id_stage_abbr1(stage, substage, node, bare)
217
217
  if bare
218
- IsoDoc::Iso::Metadata.new("en", "Latn", @i18n)
218
+ IsoDoc::Iso::Metadata.new("en", "Latn", nil, @i18n)
219
219
  .status_abbrev(stage_abbr(stage, substage, doctype(node)),
220
220
  substage, nil, nil, doctype(node))
221
221
  else
222
- IsoDoc::Iso::Metadata.new("en", "Latn", @i18n)
222
+ IsoDoc::Iso::Metadata.new("en", "Latn", nil, @i18n)
223
223
  .status_abbrev(stage_abbr(stage, substage, doctype(node)),
224
224
  substage, node.attr("iteration"),
225
225
  node.attr("draft"), doctype(node))
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ISO
3
- VERSION = "2.1.9".freeze
3
+ VERSION = "2.2.0".freeze
4
4
  end
5
5
  end
data/lib/metanorma/iso.rb CHANGED
@@ -2,6 +2,5 @@ require_relative "./iso/processor"
2
2
 
3
3
  module Metanorma
4
4
  module Iso
5
-
6
5
  end
7
6
  end