metanorma-iso 3.0.6 → 3.0.8

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.
@@ -153,6 +153,8 @@
153
153
 
154
154
  <xsl:variable name="doctype_uppercased" select="java:toUpperCase(java:java.lang.String.new($doctype_localized))"/>
155
155
 
156
+ <xsl:variable name="doctype_customized" select="normalize-space(/iso:metanorma/iso:metanorma-extension/iso:presentation-metadata/iso:doctype-customized)"/>
157
+
156
158
  <xsl:variable name="stage" select="number(/iso:metanorma/iso:bibdata/iso:status/iso:stage)"/>
157
159
  <xsl:variable name="substage" select="number(/iso:metanorma/iso:bibdata/iso:status/iso:substage)"/>
158
160
  <xsl:variable name="stagename" select="normalize-space(/iso:metanorma/iso:bibdata/iso:ext/iso:stagename)"/>
@@ -413,6 +415,13 @@
413
415
  <xsl:variable name="layoutVersion" select="normalize-space($layoutVersion_)"/>
414
416
  <xsl:variable name="cover_page_border">0.5pt solid black</xsl:variable>
415
417
  <xsl:variable name="color_red">rgb(237, 28, 36)</xsl:variable>
418
+ <xsl:variable name="color_secondary_value" select="normalize-space(/iso:metanorma/iso:metanorma-extension/iso:presentation-metadata/iso:color-secondary)"/>
419
+ <xsl:variable name="color_secondary">
420
+ <xsl:choose>
421
+ <xsl:when test="$color_secondary_value != ''"><xsl:value-of select="$color_secondary_value"/></xsl:when>
422
+ <xsl:otherwise><xsl:value-of select="$color_red"/></xsl:otherwise>
423
+ </xsl:choose>
424
+ </xsl:variable>
416
425
 
417
426
  <xsl:variable name="XML" select="/"/>
418
427
 
@@ -1585,6 +1594,7 @@
1585
1594
 
1586
1595
  <xsl:apply-templates select="/iso:metanorma/iso:bibdata/iso:title[@language = $lang and @type = 'title-intro']"/>
1587
1596
  <xsl:apply-templates select="/iso:metanorma/iso:bibdata/iso:title[@language = $lang and @type = 'title-main']"/>
1597
+ <xsl:apply-templates select="/iso:metanorma/iso:bibdata/iso:title[@language = $lang and @type = 'title-complementary']"/>
1588
1598
  <fo:block font-size="11pt" text-transform="uppercase" margin-top="2mm">
1589
1599
  <xsl:apply-templates select="/iso:metanorma/iso:bibdata/iso:title[@language = $lang and @type = 'title-part']/node()"/>
1590
1600
  </fo:block>
@@ -1744,7 +1754,7 @@
1744
1754
 
1745
1755
  <fo:block margin-top="6mm" font-weight="bold">
1746
1756
  <xsl:call-template name="printEdition"/>
1747
- <xsl:text> — </xsl:text>
1757
+ <xsl:value-of select="$nonbreak_space_em_dash_space"/>
1748
1758
  <xsl:value-of select="/iso:metanorma/iso:bibdata/iso:version/iso:revision-date"/>
1749
1759
  </fo:block>
1750
1760
 
@@ -1874,6 +1884,7 @@
1874
1884
  </xsl:variable>
1875
1885
 
1876
1886
  <xsl:choose>
1887
+ <xsl:when test="$doctype_customized != ''"><xsl:value-of select="$doctype_customized"/></xsl:when>
1877
1888
  <xsl:when test="$stage-abbreviation = 'DIS'"> <!-- or $stage-abbreviation = 'DAMD' or $stage-abbreviation = 'DAM' -->
1878
1889
  <xsl:choose>
1879
1890
  <xsl:when test="normalize-space($stagename_localized_coverpage) != ''">
@@ -1930,7 +1941,7 @@
1930
1941
  <fo:table-cell number-columns-spanned="2" display-align="after" padding-left="6mm">
1931
1942
  <fo:block font-size="19pt" font-weight="bold" line-height="1">
1932
1943
  <xsl:if test="$stage &gt;=60 and $substage != 0">
1933
- <xsl:attribute name="color"><xsl:value-of select="$color_red"/></xsl:attribute>
1944
+ <xsl:attribute name="color"><xsl:value-of select="$color_secondary"/></xsl:attribute>
1934
1945
  </xsl:if>
1935
1946
  <xsl:choose>
1936
1947
  <xsl:when test="contains($docidentifierISO, ' ')">
@@ -3009,6 +3020,7 @@
3009
3020
  <xsl:template name="insertTitlesLangMain">
3010
3021
  <xsl:apply-templates select="/iso:metanorma/iso:bibdata/iso:title[@language = $lang and @type = 'title-intro']"/>
3011
3022
  <xsl:apply-templates select="/iso:metanorma/iso:bibdata/iso:title[@language = $lang and @type = 'title-main']"/>
3023
+ <xsl:apply-templates select="/iso:metanorma/iso:bibdata/iso:title[@language = $lang and @type = 'title-complementary']"/>
3012
3024
  <xsl:apply-templates select="/iso:metanorma/iso:bibdata/iso:title[@language = $lang and @type = 'title-part']">
3013
3025
  <xsl:with-param name="isMainLang">true</xsl:with-param>
3014
3026
  </xsl:apply-templates>
@@ -3021,6 +3033,7 @@
3021
3033
  <xsl:param name="lang_other"/>
3022
3034
  <xsl:apply-templates select="$XML/iso:metanorma/iso:bibdata/iso:title[@language = $lang_other and @type = 'title-intro']"/>
3023
3035
  <xsl:apply-templates select="$XML/iso:metanorma/iso:bibdata/iso:title[@language = $lang_other and @type = 'title-main']"/>
3036
+ <xsl:apply-templates select="$XML/iso:metanorma/iso:bibdata/iso:title[@language = $lang_other and @type = 'title-complementary']"/>
3024
3037
  <xsl:apply-templates select="$XML/iso:metanorma/iso:bibdata/iso:title[@language = $lang_other and @type = 'title-part']">
3025
3038
  <xsl:with-param name="curr_lang" select="$lang_other"/>
3026
3039
  </xsl:apply-templates>
@@ -3463,10 +3476,10 @@
3463
3476
  <xsl:choose>
3464
3477
  <xsl:when test="$layoutVersion = '1951'">
3465
3478
  <fo:block text-transform="uppercase"><xsl:apply-templates/></fo:block>
3466
- </xsl:when>
3479
+ </xsl:when>
3467
3480
  <xsl:otherwise>
3468
3481
  <xsl:apply-templates/>
3469
- <xsl:text> — </xsl:text>
3482
+ <xsl:value-of select="$nonbreak_space_em_dash_space"/>
3470
3483
  </xsl:otherwise>
3471
3484
  </xsl:choose>
3472
3485
  </xsl:template>
@@ -3494,64 +3507,78 @@
3494
3507
  </xsl:choose>
3495
3508
  </xsl:template>
3496
3509
 
3510
+ <xsl:template match="iso:bibdata/iso:title[@type = 'title-complementary']">
3511
+ <xsl:param name="body">false</xsl:param>
3512
+ <xsl:value-of select="$nonbreak_space_em_dash_space"/>
3513
+ <xsl:apply-templates/>
3514
+ </xsl:template>
3515
+
3497
3516
  <xsl:template match="iso:bibdata/iso:title[@type = 'title-part']">
3498
3517
  <xsl:param name="curr_lang" select="$lang"/>
3499
3518
  <xsl:param name="isMainLang">false</xsl:param>
3500
- <xsl:if test="$part != ''">
3501
- <!-- <xsl:text> </xsl:text> -->
3502
- <xsl:choose>
3503
- <xsl:when test="$layoutVersion = '1951'"/>
3504
- <xsl:otherwise><xsl:text> — </xsl:text></xsl:otherwise>
3505
- </xsl:choose>
3506
- <xsl:variable name="part-word">
3519
+ <xsl:choose>
3520
+ <xsl:when test="$part != ''">
3521
+ <!-- <xsl:text> — </xsl:text> -->
3507
3522
  <xsl:choose>
3508
- <xsl:when test="$isMainLang = 'true'">
3509
- <xsl:value-of select="concat($i18n_locality_part, ' ', $part, ':')"/>
3510
- </xsl:when>
3511
- <xsl:otherwise>
3512
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang=$curr_lang]),'#',$part)"/>
3513
- </xsl:otherwise>
3523
+ <xsl:when test="$layoutVersion = '1951'"/>
3524
+ <xsl:otherwise><xsl:value-of select="$nonbreak_space_em_dash_space"/></xsl:otherwise>
3514
3525
  </xsl:choose>
3515
- </xsl:variable>
3516
- <xsl:choose>
3517
- <xsl:when test="$isMainLang = 'true'">
3526
+ <xsl:variable name="part-word">
3518
3527
  <xsl:choose>
3519
- <xsl:when test="$layoutVersion = '1951'">
3520
- <xsl:value-of select="$part-word"/>
3521
- <xsl:apply-templates/>
3528
+ <xsl:when test="$isMainLang = 'true'">
3529
+ <xsl:value-of select="concat($i18n_locality_part, ' ', $part, ':')"/>
3522
3530
  </xsl:when>
3523
- <xsl:when test="$layoutVersion = '1972' or $layoutVersion = '1979'">
3524
- <fo:block font-weight="bold" role="SKIP">
3531
+ <xsl:otherwise>
3532
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang=$curr_lang]),'#',$part)"/>
3533
+ </xsl:otherwise>
3534
+ </xsl:choose>
3535
+ </xsl:variable>
3536
+ <xsl:choose>
3537
+ <xsl:when test="$isMainLang = 'true'">
3538
+ <xsl:choose>
3539
+ <xsl:when test="$layoutVersion = '1951'">
3525
3540
  <xsl:value-of select="$part-word"/>
3526
- <xsl:text> </xsl:text>
3527
3541
  <xsl:apply-templates/>
3528
- </fo:block>
3529
- </xsl:when>
3530
- <xsl:when test="$layoutVersion = '1987'">
3531
- <fo:block font-weight="bold" margin-top="12pt" role="SKIP">
3542
+ </xsl:when>
3543
+ <xsl:when test="$layoutVersion = '1972' or $layoutVersion = '1979'">
3544
+ <fo:block font-weight="bold" role="SKIP">
3545
+ <xsl:value-of select="$part-word"/>
3546
+ <xsl:text> </xsl:text>
3547
+ <xsl:apply-templates/>
3548
+ </fo:block>
3549
+ </xsl:when>
3550
+ <xsl:when test="$layoutVersion = '1987'">
3551
+ <fo:block font-weight="bold" margin-top="12pt" role="SKIP">
3552
+ <xsl:value-of select="$part-word"/>
3553
+ </fo:block>
3554
+ </xsl:when>
3555
+ <xsl:otherwise>
3556
+ <fo:block font-weight="normal" margin-top="6pt" role="SKIP">
3532
3557
  <xsl:value-of select="$part-word"/>
3533
3558
  </fo:block>
3534
- </xsl:when>
3535
- <xsl:otherwise>
3536
- <fo:block font-weight="normal" margin-top="6pt" role="SKIP">
3537
- <xsl:value-of select="$part-word"/>
3538
- </fo:block>
3539
- </xsl:otherwise>
3540
- </xsl:choose>
3541
- </xsl:when>
3542
- <xsl:otherwise>
3543
- <!-- <xsl:value-of select="$linebreak"/> -->
3544
- <xsl:choose>
3545
- <xsl:when test="$layoutVersion = '1972' or $layoutVersion = '1979'"/>
3546
- <xsl:otherwise>
3547
- <fo:block font-size="1pt" margin-top="5pt" role="SKIP"> </fo:block>
3548
- </xsl:otherwise>
3549
- </xsl:choose>
3550
- <xsl:value-of select="$part-word"/>
3551
- <xsl:text> </xsl:text>
3552
- </xsl:otherwise>
3553
- </xsl:choose>
3554
- </xsl:if>
3559
+ </xsl:otherwise>
3560
+ </xsl:choose>
3561
+ </xsl:when>
3562
+ <xsl:otherwise>
3563
+ <!-- <xsl:value-of select="$linebreak"/> -->
3564
+ <xsl:choose>
3565
+ <xsl:when test="$layoutVersion = '1972' or $layoutVersion = '1979'"/>
3566
+ <xsl:otherwise>
3567
+ <fo:block font-size="1pt" margin-top="5pt" role="SKIP"> </fo:block>
3568
+ </xsl:otherwise>
3569
+ </xsl:choose>
3570
+ <xsl:value-of select="$part-word"/>
3571
+ <xsl:text> </xsl:text>
3572
+ </xsl:otherwise>
3573
+ </xsl:choose>
3574
+ </xsl:when>
3575
+ <xsl:otherwise> <!-- $part = '' -->
3576
+ <xsl:choose>
3577
+ <xsl:when test="$layoutVersion = '1951'"/>
3578
+ <xsl:otherwise><xsl:value-of select="$nonbreak_space_em_dash_space"/></xsl:otherwise>
3579
+ </xsl:choose>
3580
+ </xsl:otherwise>
3581
+ </xsl:choose>
3555
3582
  <xsl:choose>
3556
3583
  <xsl:when test="$layoutVersion = '1951'"><fo:inline font-weight="normal"><xsl:apply-templates/></fo:inline></xsl:when>
3557
3584
  <xsl:when test="($layoutVersion = '1972' or $layoutVersion = '1979') and $isMainLang = 'true'"/>
@@ -3617,6 +3644,7 @@
3617
3644
  <xsl:when test="$revision_date_num &gt;= 19680101">
3618
3645
  <fo:block font-weight="normal"><xsl:apply-templates select="/iso:metanorma/iso:bibdata/iso:title[@language = $lang and @type = 'title-intro']"/></fo:block>
3619
3646
  <fo:block space-before="24pt"><xsl:apply-templates select="/iso:metanorma/iso:bibdata/iso:title[@language = $lang and @type = 'title-main']"/></fo:block>
3647
+ <fo:block space-before="24pt"><xsl:apply-templates select="/iso:metanorma/iso:bibdata/iso:title[@language = $lang and @type = 'title-complementary']"/></fo:block>
3620
3648
  </xsl:when>
3621
3649
  <xsl:otherwise>
3622
3650
 
@@ -3624,6 +3652,7 @@
3624
3652
  <xsl:apply-templates select="/iso:metanorma/iso:bibdata/iso:title[@language = $lang and @type = 'title-main']">
3625
3653
  <xsl:with-param name="body">true</xsl:with-param>
3626
3654
  </xsl:apply-templates>
3655
+ <xsl:apply-templates select="/iso:metanorma/iso:bibdata/iso:title[@language = $lang and @type = 'title-complementary']"/>
3627
3656
  <fo:block font-size="11pt" text-transform="uppercase" margin-top="2mm">
3628
3657
  <xsl:apply-templates select="/iso:metanorma/iso:bibdata/iso:title[@language = $lang and @type = 'title-part']/node()"/>
3629
3658
  </fo:block>
@@ -3915,9 +3944,9 @@
3915
3944
  <fo:block>
3916
3945
  <xsl:if test="following-sibling::iso:p">
3917
3946
  <xsl:attribute name="margin-bottom">3pt</xsl:attribute>
3918
- <xsl:attribute name="margin-left">0.5mm</xsl:attribute>
3919
- <xsl:attribute name="margin-right">0.5mm</xsl:attribute>
3920
3947
  </xsl:if>
3948
+ <xsl:attribute name="margin-left">0.5mm</xsl:attribute>
3949
+ <xsl:attribute name="margin-right">0.5mm</xsl:attribute>
3921
3950
  <xsl:if test="contains(@id, 'address') or contains(normalize-space(), 'Tel:') or contains(normalize-space(), 'Phone:')">
3922
3951
  <xsl:attribute name="margin-left">4.5mm</xsl:attribute>
3923
3952
  </xsl:if>
@@ -4907,6 +4936,7 @@
4907
4936
  <fo:table-cell>
4908
4937
  <fo:block>
4909
4938
  <xsl:choose>
4939
+ <xsl:when test="$doctype_customized != ''"><xsl:value-of select="$doctype_customized"/></xsl:when>
4910
4940
  <xsl:when test="$layoutVersion = '2024'">
4911
4941
  <xsl:choose>
4912
4942
  <xsl:when test="$doctype = 'committee-document'"><xsl:value-of select="$doctype_localized"/></xsl:when>
@@ -5472,13 +5502,23 @@
5472
5502
  <fo:block margin-top="18pt" margin-bottom="-1mm" line-height="1.1"><xsl:value-of select="$copyrightTextLastPage2024"/></fo:block>
5473
5503
  </fo:block>
5474
5504
  </fo:table-cell>
5475
- <fo:table-cell number-columns-spanned="2" text-align="right" display-align="after">
5476
- <fo:block font-size="16pt" font-weight="bold" margin-bottom="1mm" margin-right="1.5mm">
5477
- <xsl:if test="$stage &gt;=60 and $substage != 0">
5478
- <xsl:attribute name="color"><xsl:value-of select="$color_red"/></xsl:attribute>
5479
- </xsl:if>
5480
- <xsl:text>iso.org</xsl:text>
5481
- </fo:block>
5505
+ <fo:table-cell number-columns-spanned="2" display-align="after">
5506
+ <xsl:choose>
5507
+ <xsl:when test="/iso:metanorma/iso:boilerplate/iso:feedback-statement">
5508
+ <fo:block font-size="16pt" margin-bottom="1mm" margin-right="1.5mm">
5509
+ <xsl:apply-templates select="/iso:metanorma/iso:boilerplate/iso:feedback-statement"/>
5510
+ </fo:block>
5511
+ </xsl:when>
5512
+ <xsl:otherwise>
5513
+ <xsl:attribute name="text-align">right</xsl:attribute>
5514
+ <fo:block font-size="16pt" font-weight="bold" margin-bottom="1mm" margin-right="1.5mm">
5515
+ <xsl:if test="$stage &gt;=60 and $substage != 0">
5516
+ <xsl:attribute name="color"><xsl:value-of select="$color_red"/></xsl:attribute>
5517
+ </xsl:if>
5518
+ <xsl:text>iso.org</xsl:text>
5519
+ </fo:block>
5520
+ </xsl:otherwise>
5521
+ </xsl:choose>
5482
5522
  </fo:table-cell>
5483
5523
  </fo:table-row>
5484
5524
  </fo:table-body>
@@ -5992,6 +6032,7 @@
5992
6032
  <xsl:variable name="hair_space"> </xsl:variable>
5993
6033
  <xsl:variable name="en_dash">–</xsl:variable>
5994
6034
  <xsl:variable name="em_dash">—</xsl:variable>
6035
+ <xsl:variable name="nonbreak_space_em_dash_space"> — </xsl:variable>
5995
6036
  <xsl:variable name="cr">&#13;</xsl:variable>
5996
6037
  <xsl:variable name="lf">
5997
6038
  </xsl:variable>
@@ -14502,11 +14543,11 @@
14502
14543
  </xsl:template>
14503
14544
 
14504
14545
  <!-- figure/fn -->
14505
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
14546
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'fn']" priority="2"/>
14506
14547
  <!-- figure/note -->
14507
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']" priority="2"/>
14548
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'note']" priority="2"/>
14508
14549
  <!-- figure/example -->
14509
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'example']" priority="2"/>
14550
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'example']" priority="2"/>
14510
14551
 
14511
14552
  <!-- figure/note[@type = 'units'] -->
14512
14553
  <!-- image/note[@type = 'units'] -->
@@ -18077,6 +18118,9 @@
18077
18118
  <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']" mode="update_xml_pres"/>
18078
18119
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_step1"/>
18079
18120
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_pres"/>
18121
+ <!-- https://github.com/metanorma/isodoc/issues/687 -->
18122
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_step1"/>
18123
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_pres"/>
18080
18124
 
18081
18125
  <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
18082
18126
  <xsl:copy>
@@ -18394,6 +18438,20 @@
18394
18438
  </xsl:element>
18395
18439
  </xsl:template>
18396
18440
 
18441
+ <xsl:template match="*[local-name() = 'fmt-source']"/>
18442
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_step1">
18443
+ <xsl:element name="source" namespace="{$namespace_full}">
18444
+ <xsl:copy-of select="@*"/>
18445
+ <xsl:apply-templates mode="update_xml_step1"/>
18446
+ </xsl:element>
18447
+ </xsl:template>
18448
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_pres">
18449
+ <xsl:element name="source" namespace="{$namespace_full}">
18450
+ <xsl:copy-of select="@*"/>
18451
+ <xsl:apply-templates mode="update_xml_pres"/>
18452
+ </xsl:element>
18453
+ </xsl:template>
18454
+
18397
18455
  <xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_step1" priority="3">
18398
18456
  <xsl:apply-templates mode="update_xml_step1"/>
18399
18457
  </xsl:template>
@@ -11,8 +11,7 @@ module IsoDoc
11
11
  end
12
12
 
13
13
  def status_abbrev(stage, _substage, iter, draft, doctype)
14
- return "" unless stage
15
-
14
+ stage or return ""
16
15
  if %w(technical-report technical-specification).include?(doctype)
17
16
  stage = "DTS" if stage == "DIS"
18
17
  stage = "FDTS" if stage == "FDIS"
@@ -103,16 +102,16 @@ module IsoDoc
103
102
  end
104
103
 
105
104
  def compose_title(tparts, tnums, lang)
106
- main = ""
107
- tparts[:main].nil? or
108
- main = tparts[:main].children.to_xml
105
+ t = tparts[:main].nil? ? "" : tparts[:main].children.to_xml
109
106
  tparts[:intro] and
110
- main = "#{tparts[:intro].children.to_xml}&#xa0;&#x2014; #{main}"
107
+ t = "#{tparts[:intro].children.to_xml}&#xa0;&#x2014; #{t}"
108
+ tparts[:complementary] and
109
+ t = "#{t}&#xa0;&#x2014; #{tparts[:complementary].children.to_xml}"
111
110
  if tparts[:part]
112
111
  suffix = part_title(tparts[:part], tnums, lang)
113
- main = "#{main}&#xa0;&#x2014; #{suffix}"
112
+ t = "#{t}&#xa0;&#x2014; #{suffix}"
114
113
  end
115
- main
114
+ t
116
115
  end
117
116
 
118
117
  def title_nums(isoxml)
@@ -125,16 +124,10 @@ module IsoDoc
125
124
  end
126
125
 
127
126
  def title_parts(isoxml, lang)
128
- { intro: isoxml.at(ns("//bibdata/title[@type='title-intro' and " \
129
- "@language='#{lang}']")),
130
- main: isoxml.at(ns("//bibdata/title[@type='title-main' and " \
131
- "@language='#{lang}']")),
132
- part: isoxml.at(ns("//bibdata/title[@type='title-part' and " \
133
- "@language='#{lang}']")),
134
- amd: isoxml.at(ns("//bibdata/title[@type='title-amd' and " \
135
- "@language='#{lang}']")),
136
- add: isoxml.at(ns("//bibdata/title[@type='title-add' and " \
137
- "@language='#{lang}']")) }
127
+ %w(intro main complementary part amd add).each_with_object({}) do |w, m|
128
+ m[w.to_sym] = isoxml.at(ns("//bibdata/title[@type='title-#{w}' and " \
129
+ "@language='#{lang}']"))
130
+ end
138
131
  end
139
132
 
140
133
  def title(isoxml, _out)
@@ -142,13 +135,15 @@ module IsoDoc
142
135
  when "fr", "ru" then @lang
143
136
  else "en"
144
137
  end
145
- # intro, main, part, amd = title_parts(isoxml, lang)
138
+ # intro, main, complementary, part, amd = title_parts(isoxml, lang)
146
139
  tp = title_parts(isoxml, lang)
147
140
  tn = title_nums(isoxml)
148
141
  set(:doctitlemain, tp[:main] ? tp[:main].children.to_xml : "")
149
142
  main = compose_title(tp, tn, lang)
150
143
  set(:doctitle, main)
151
144
  tp[:intro] and set(:doctitleintro, tp[:intro].children.to_xml)
145
+ tp[:complementary] and
146
+ set(:doctitlecomplementary, tp[:complementary].children.to_xml)
152
147
  set(:doctitlepartlabel, part_prefix(tn, lang))
153
148
  set(:doctitlepart, tp[:part].children.to_xml) if tp[:part]
154
149
  set(:doctitleamdlabel, amd_prefix(tn, lang)) if tn[:amd]
@@ -167,6 +162,8 @@ module IsoDoc
167
162
  main = compose_title(tp, tn, lang)
168
163
  set(:docsubtitle, main)
169
164
  tp[:intro] and set(:docsubtitleintro, tp[:intro].children.to_xml)
165
+ tp[:complementary] and
166
+ set(:docsubtitlecomplementary, tp[:complementary].children.to_xml)
170
167
  set(:docsubtitlepartlabel, part_prefix(tn, lang))
171
168
  tp[:part] and set(:docsubtitlepart, tp[:part].children.to_xml)
172
169
  set(:docsubtitleamdlabel, amd_prefix(tn, lang)) if tn[:amd]
@@ -98,7 +98,8 @@ module IsoDoc
98
98
  @meta.get[:doctitleintro] && @meta.get[:doctitlemain] and
99
99
  ret += " &#x2014; "
100
100
  ret += @meta.get[:doctitlemain]
101
- @meta.get[:doctitlemain] && @meta.get[:doctitlepart] and
101
+ @meta.get[:doctitlemain] &&
102
+ (@meta.get[:doctitlepart] || @meta.get[:doctitlecomplementary]) and
102
103
  ret += " &#x2014; "
103
104
  ret += "</span>#{middle_title_part}"
104
105
  "<p class='zzSTDTitle1'>#{ret}</p>"
@@ -106,7 +107,9 @@ module IsoDoc
106
107
 
107
108
  def middle_title_part
108
109
  ret = ""
109
- if a = @meta.get[:doctitlepart]
110
+ if a = @meta.get[:doctitlecomplementary]
111
+ ret += "<span class='boldtitle'>#{a}</span>"
112
+ elsif a = @meta.get[:doctitlepart]
110
113
  b = @meta.get[:doctitlepartlabel] and
111
114
  ret += "<span class='nonboldtitle'>#{b}:</span> "
112
115
  ret += "<span class='boldtitle'>#{a}</span>"
@@ -11,7 +11,7 @@ module IsoDoc
11
11
  concept_term(docxml)
12
12
  (docxml.xpath(ns("//concept")) - docxml.xpath(ns("//term//concept")))
13
13
  .each do |node|
14
- node.ancestors("definition, termsource, related").empty? and
14
+ node.ancestors("definition, source, related").empty? and
15
15
  concept_render(node, ital: "false", ref: "false",
16
16
  linkref: "true", linkmention: "false")
17
17
  end
@@ -22,7 +22,7 @@ module IsoDoc
22
22
  m = {}
23
23
  (f.xpath(ns(".//concept")) - f.xpath(ns(".//term//concept")))
24
24
  .each do |c|
25
- c.ancestors("definition, termsource, related").empty? and
25
+ c.ancestors("definition, source, related").empty? and
26
26
  concept_term1(c, m)
27
27
  end
28
28
  end
@@ -236,7 +236,7 @@ module IsoDoc
236
236
 
237
237
  def table_parse_tail(node, out)
238
238
  (dl = node.at(ns("./dl"))) && parse(dl, out)
239
- node.xpath(ns("./source")).each { |n| parse(n, out) }
239
+ node.xpath(ns("./fmt-source")).each { |n| parse(n, out) }
240
240
  node.xpath(ns("./note[not(@type = 'units')]"))
241
241
  .each { |n| parse(n, out) }
242
242
  node.xpath(ns("./fmt-footnote-container/fmt-fn-body"))
@@ -65,9 +65,8 @@ module Metanorma
65
65
  end
66
66
 
67
67
  def ol_attrs(node)
68
- attr_code(keep_attrs(node)
69
- .merge(id: ::Metanorma::Utils::anchor_or_uuid(node),
70
- "explicit-type": olist_style(node.attributes[1]),
68
+ attr_code(keep_attrs(node).merge(id_attr(node))
69
+ .merge("explicit-type": olist_style(node.attributes[1]),
71
70
  start: node.attr("start")))
72
71
  end
73
72
 
@@ -267,6 +267,10 @@ in a document (e.g. sourcecode annotations)</a:documentation>
267
267
  <value>justified</value>
268
268
  </choice>
269
269
  </define>
270
+ <define name="IdRefType">
271
+ <a:documentation>Type of cross-references to elements. In BasicDoc, these always point to id { xsd:ID } </a:documentation>
272
+ <data type="IDREF"/>
273
+ </define>
270
274
  <define name="RequiredId">
271
275
  <a:documentation>Mandatory anchor of element, to be used for cross-references within the document</a:documentation>
272
276
  <attribute name="id">
@@ -409,13 +413,13 @@ in a document (e.g. sourcecode annotations)</a:documentation>
409
413
  <attribute name="from">
410
414
  <a:documentation>Identifier for the start of the text or point in the text to which the comment applies.
411
415
  If not provided, the comment applies in the vicinity of the place it has been inserted into the text</a:documentation>
412
- <data type="IDREF"/>
416
+ <ref name="IdRefType"/>
413
417
  </attribute>
414
418
  </optional>
415
419
  <optional>
416
420
  <attribute name="to">
417
421
  <a:documentation>Identifier for the end of the text to which the comment applies</a:documentation>
418
- <data type="IDREF"/>
422
+ <ref name="IdRefType"/>
419
423
  </attribute>
420
424
  </optional>
421
425
  </define>
@@ -1504,7 +1508,7 @@ Restricted recursively to contain only other such inline elements with no identi
1504
1508
  <attribute name="to">
1505
1509
  <a:documentation>A reference to an anchor element (typically a bookmark),
1506
1510
  to indicate that the index range covers a range of locations between the current index element and the `to` anchor</a:documentation>
1507
- <data type="IDREF"/>
1511
+ <ref name="IdRefType"/>
1508
1512
  </attribute>
1509
1513
  </optional>
1510
1514
  <ref name="index-primary">
@@ -1662,7 +1666,7 @@ which can be bookmarks as well as block or section references</a:documentation>
1662
1666
  <define name="XrefAttributes">
1663
1667
  <attribute name="target">
1664
1668
  <a:documentation>The identifier of a section, block or inlined element being referenced</a:documentation>
1665
- <data type="IDREF"/>
1669
+ <ref name="IdRefType"/>
1666
1670
  </attribute>
1667
1671
  <optional>
1668
1672
  <attribute name="type">
@@ -1723,7 +1727,7 @@ The target of a footnote is the location it is embedded in within the text</a:do
1723
1727
  <attribute name="target">
1724
1728
  <a:documentation>The target of the callout is understood to be the location of the callout within the source code;
1725
1729
  the extent of the target is not expressed overtly</a:documentation>
1726
- <data type="IDREF"/>
1730
+ <ref name="IdRefType"/>
1727
1731
  </attribute>
1728
1732
  <text>
1729
1733
  <a:documentation>The label of the callout, used to identify its target within the source code</a:documentation>
@@ -69,7 +69,7 @@ module Metanorma
69
69
 
70
70
  def unpub_footnotes(xmldoc)
71
71
  xmldoc.xpath("//bibitem/note[@type = 'Unpublished-Status']").each do |n|
72
- e = xmldoc.at("//eref[@bibitemid = '#{n.parent['id']}']") or next
72
+ e = xmldoc.at("//eref[@bibitemid = '#{n.parent['anchor']}']") or next
73
73
  fn = n.children.to_xml
74
74
  n.elements&.first&.name == "p" or fn = "<p>#{fn}</p>"
75
75
  e.next = "<fn>#{fn}</fn>"
@@ -71,6 +71,13 @@ module Metanorma
71
71
  @log.add("Document Attributes", nil, err)
72
72
  end
73
73
 
74
+ def title_component(node, xml, lang, attr, comp)
75
+ t = node.attr("title-#{comp[:name]}-#{lang}") or return
76
+ xml.title(**attr_code(attr.merge(type: "title-#{comp[:abbr]}"))) do |t1|
77
+ t1 << Metanorma::Utils::asciidoc_sub(t)
78
+ end
79
+ end
80
+
74
81
  def title_intro(node, xml, lang, at)
75
82
  t = node.attr("title-intro-#{lang}") or return
76
83
  xml.title(**attr_code(at.merge(type: "title-intro"))) do |t1|
@@ -106,30 +113,44 @@ module Metanorma
106
113
  end
107
114
 
108
115
  def title_full(node, xml, lang, at)
109
- title = node.attr("title-main-#{lang}")
110
- intro = node.attr("title-intro-#{lang}")
111
- part = node.attr("title-part-#{lang}")
112
- amd = node.attr("title-amendment-#{lang}")
113
- add = node.attr("title-addendum-#{lang}")
116
+ title, intro, part, amd, add = title_full_prep(node, lang)
114
117
  title = "#{intro} -- #{title}" if intro
115
118
  title = "#{title} -- #{part}" if part
116
- title = "#{title} -- #{amd}" if amd && @amd
117
- title = "#{title} -- #{add}" if amd && node.attr("addendum-number")
119
+ title = "#{title} -- #{amd}" if amd
120
+ title = "#{title} -- #{add}" if add
118
121
  xml.title **attr_code(at.merge(type: "main")) do |t1|
119
122
  t1 << Metanorma::Utils::asciidoc_sub(title)
120
123
  end
121
124
  end
122
125
 
126
+ def title_full_prep(node, lang)
127
+ title = node.attr("title-main-#{lang}")
128
+ intro = node.attr("title-intro-#{lang}")
129
+ part = node.attr("title-part-#{lang}") ||
130
+ node.attr("title-complementary-#{lang}")
131
+ @amd and amd = node.attr("title-amendment-#{lang}")
132
+ node.attr("addendum-number") and
133
+ add = node.attr("title-addendum-#{lang}")
134
+ [title, intro, part, amd, add]
135
+ end
136
+
123
137
  def title(node, xml)
124
138
  %w(en ru fr).each do |lang|
125
139
  at = { language: lang, format: "text/plain" }
126
- title_full(node, xml, lang, at)
127
- title_intro(node, xml, lang, at)
128
- title_main(node, xml, lang, at)
129
- title_part(node, xml, lang, at)
130
- title_amd(node, xml, lang, at) if @amd
131
- title_add(node, xml, lang, at) if node.attr("addendum-number")
140
+ title1(node, xml, lang, at)
141
+ end
142
+ end
143
+
144
+ def title1(node, xml, lang, at)
145
+ title_full(node, xml, lang, at)
146
+ %w(intro main part complementary).each do |w|
147
+ title_component(node, xml, lang, at, { name: w, abbr: w })
132
148
  end
149
+ @amd and title_component(node, xml, lang, at,
150
+ { name: "amendment", abbr: "amd" })
151
+ node.attr("addendum-number") and
152
+ title_component(node, xml, lang, at,
153
+ { name: "addendum", abbr: "add" })
133
154
  end
134
155
 
135
156
  def relaton_relations