metanorma-iso 2.1.8 → 2.2.0
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 +4 -4
- data/lib/isodoc/iso/html/htmlstyle.css +47 -0
- data/lib/isodoc/iso/html/isodoc-dis.css +4493 -0
- data/lib/isodoc/iso/html/isodoc.css +1346 -0
- data/lib/isodoc/iso/html/style-human.css +1062 -0
- data/lib/isodoc/iso/html/style-iso.css +1088 -0
- data/lib/isodoc/iso/html/wordstyle-dis.css +2280 -0
- data/lib/isodoc/iso/html/wordstyle.css +1728 -0
- data/lib/isodoc/iso/i18n-fr.yaml +0 -1
- data/lib/isodoc/iso/i18n-zh-Hans.yaml +0 -1
- data/lib/isodoc/iso/init.rb +15 -10
- data/lib/isodoc/iso/iso.amendment.xsl +77 -14
- data/lib/isodoc/iso/iso.international-standard.xsl +77 -14
- data/lib/isodoc/iso/metadata.rb +1 -1
- data/lib/isodoc/iso/presentation_xref.rb +1 -0
- data/lib/isodoc/iso/word_convert.rb +6 -0
- data/lib/isodoc/iso/xref.rb +6 -11
- data/lib/metanorma/iso/biblio.rng +32 -1
- data/lib/metanorma/iso/front_id.rb +2 -2
- data/lib/metanorma/iso/version.rb +1 -1
- data/lib/metanorma/iso.rb +0 -1
- data/lib/metanorma/requirements/modspec.rb +67 -4
- data/lib/metanorma-iso.rb +1 -0
- data/lib/relaton/render/config.yml +53 -1
- data/metanorma-iso.gemspec +1 -1
- data/spec/isodoc/i18n_spec.rb +2 -2
- data/spec/isodoc/ref_spec.rb +4 -4
- data/spec/relaton/render_spec.rb +568 -0
- data/spec/requirements/requirement_components_spec.rb +622 -0
- data/spec/requirements/requirements_spec.rb +434 -52
- data/spec/requirements/xref_spec.rb +6 -0
- data/spec/vcr_cassettes/docrels.yml +34 -34
- data/spec/vcr_cassettes/withdrawn_iso.yml +29 -29
- metadata +13 -4
data/lib/isodoc/iso/i18n-fr.yaml
CHANGED
data/lib/isodoc/iso/init.rb
CHANGED
@@ -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,
|
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
|
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[
|
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:
|
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'][
|
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
|
-
|
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
|
-
|
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="
|
9649
|
-
<xsl:
|
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($
|
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[
|
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:
|
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'][
|
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
|
-
|
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
|
-
|
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="
|
9649
|
-
<xsl:
|
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($
|
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">
|
data/lib/isodoc/iso/metadata.rb
CHANGED
@@ -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, [])
|
data/lib/isodoc/iso/xref.rb
CHANGED
@@ -24,12 +24,12 @@ module IsoDoc
|
|
24
24
|
c.element? and preface_names(c)
|
25
25
|
end
|
26
26
|
end
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
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="
|
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))
|