metanorma-cc 2.7.6 → 2.7.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.
- checksums.yaml +4 -4
- data/lib/isodoc/cc/cc.standard.xsl +132 -40
- data/lib/isodoc/cc/init.rb +2 -1
- data/lib/metanorma/cc/biblio.rng +4 -4
- data/lib/metanorma/cc/converter.rb +2 -0
- data/lib/metanorma/cc/isodoc.rng +27 -10
- data/lib/metanorma/cc/log.rb +45 -0
- data/lib/metanorma/cc/validate_section.rb +14 -27
- data/lib/metanorma/cc/version.rb +1 -1
- data/metanorma-cc.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 133aa4b414d618cedc7b55af3a6757def2340c8d08924c1223d0150374aadc7d
|
|
4
|
+
data.tar.gz: 8d806a8a001e20ec52b6afb2424fcb929d02b57a650a36a5516508521aa6b686
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: fb3411b4bb45194a3e88b1b7651954ce87f535d43d44c14cf2ba04213e6275950b30ce1e9aa208134df76e97f429f5aa5463af33503091c6dc1ace3f258db029
|
|
7
|
+
data.tar.gz: '026800bbab8312d4df0776fb6b08bc756f019a87f4c7859cbe2be56f64872ef37d4ad3c1c9d7b7cba405869eb8810b85363c835a77d563f9ab347a3d39415eb9'
|
|
@@ -308,7 +308,7 @@
|
|
|
308
308
|
<fo:block> </fo:block>
|
|
309
309
|
<fo:block margin-bottom="12pt"> </fo:block>
|
|
310
310
|
<fo:block-container font-size="16pt" text-align="center" border="0.5pt solid black" margin-bottom="12pt" margin-left="-1mm" margin-right="-1mm">
|
|
311
|
-
<fo:block-container
|
|
311
|
+
<fo:block-container xsl:use-attribute-sets="reset-margins-style">
|
|
312
312
|
<fo:block padding-top="1mm">
|
|
313
313
|
<xsl:call-template name="capitalizeWords">
|
|
314
314
|
<!-- ex: final-draft -->
|
|
@@ -324,7 +324,7 @@
|
|
|
324
324
|
</fo:block-container>
|
|
325
325
|
<fo:block margin-bottom="10pt"> </fo:block>
|
|
326
326
|
<fo:block-container font-size="10pt" border="0.5pt solid black" margin-bottom="12pt" margin-left="-1mm" margin-right="-1mm">
|
|
327
|
-
<fo:block-container
|
|
327
|
+
<fo:block-container xsl:use-attribute-sets="reset-margins-style">
|
|
328
328
|
<fo:block text-align="center" font-weight="bold" padding-top="1mm" margin-bottom="6pt">Warning for drafts</fo:block>
|
|
329
329
|
<fo:block margin-left="2mm" margin-right="2mm">
|
|
330
330
|
<fo:block margin-bottom="6pt">This document is not a CalConnect Standard. It is distributed for review and comment, and is subject to change without notice and may not be referred to as a Standard. Recipients of this draft are invited to submit, with their comments, notification of any relevant patent rights of which they are aware and to provide supporting documentation.</fo:block>
|
|
@@ -550,16 +550,6 @@
|
|
|
550
550
|
<xsl:call-template name="getLevel"/>
|
|
551
551
|
</xsl:variable>
|
|
552
552
|
|
|
553
|
-
<xsl:variable name="font-size">
|
|
554
|
-
<xsl:choose>
|
|
555
|
-
<xsl:when test="ancestor::mn:preface">13pt</xsl:when>
|
|
556
|
-
<xsl:when test="$level = 1">13pt</xsl:when>
|
|
557
|
-
<xsl:when test="$level = 2">12pt</xsl:when>
|
|
558
|
-
<xsl:when test="$level >= 3">11pt</xsl:when>
|
|
559
|
-
<xsl:otherwise>16pt</xsl:otherwise>
|
|
560
|
-
</xsl:choose>
|
|
561
|
-
</xsl:variable>
|
|
562
|
-
|
|
563
553
|
<xsl:variable name="element-name">
|
|
564
554
|
<xsl:choose>
|
|
565
555
|
<xsl:when test="../@inline-header = 'true'">fo:inline</xsl:when>
|
|
@@ -567,18 +557,13 @@
|
|
|
567
557
|
</xsl:choose>
|
|
568
558
|
</xsl:variable>
|
|
569
559
|
|
|
570
|
-
<xsl:variable name="
|
|
560
|
+
<xsl:variable name="title_styles">
|
|
561
|
+
<styles xsl:use-attribute-sets="title-style"><xsl:call-template name="refine_title-style"/></styles>
|
|
562
|
+
</xsl:variable>
|
|
571
563
|
|
|
572
564
|
<xsl:element name="{$element-name}">
|
|
573
|
-
<xsl:
|
|
574
|
-
|
|
575
|
-
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
|
576
|
-
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
|
577
|
-
<xsl:attribute name="color"><xsl:value-of select="$color"/></xsl:attribute>
|
|
578
|
-
<xsl:if test="ancestor::mn:sections">
|
|
579
|
-
<xsl:attribute name="margin-top">13.5pt</xsl:attribute>
|
|
580
|
-
</xsl:if>
|
|
581
|
-
<xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
|
|
565
|
+
<xsl:copy-of select="xalan:nodeset($title_styles)/styles/@*"/>
|
|
566
|
+
|
|
582
567
|
<xsl:apply-templates/>
|
|
583
568
|
<xsl:apply-templates select="following-sibling::*[1][self::mn:variant-title][@type = 'sub']" mode="subtitle"/>
|
|
584
569
|
</xsl:element>
|
|
@@ -597,17 +582,16 @@
|
|
|
597
582
|
<xsl:otherwise>fo:block</xsl:otherwise>
|
|
598
583
|
</xsl:choose>
|
|
599
584
|
</xsl:variable>
|
|
600
|
-
<xsl:element name="{$element-name}">
|
|
601
585
|
|
|
602
|
-
|
|
586
|
+
<xsl:variable name="p_styles">
|
|
587
|
+
<styles xsl:use-attribute-sets="p-style">
|
|
588
|
+
<xsl:call-template name="refine_p-style"><xsl:with-param name="element-name" select="$element-name"/></xsl:call-template>
|
|
589
|
+
</styles>
|
|
590
|
+
</xsl:variable>
|
|
591
|
+
|
|
592
|
+
<xsl:element name="{$element-name}">
|
|
593
|
+
<xsl:copy-of select="xalan:nodeset($p_styles)/styles/@*"/>
|
|
603
594
|
|
|
604
|
-
<xsl:attribute name="margin-bottom">
|
|
605
|
-
<xsl:choose>
|
|
606
|
-
<xsl:when test="ancestor::mn:li">0pt</xsl:when>
|
|
607
|
-
<xsl:otherwise>12pt</xsl:otherwise>
|
|
608
|
-
</xsl:choose>
|
|
609
|
-
</xsl:attribute>
|
|
610
|
-
<xsl:attribute name="line-height">115%</xsl:attribute>
|
|
611
595
|
<xsl:apply-templates>
|
|
612
596
|
<xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
|
|
613
597
|
</xsl:apply-templates>
|
|
@@ -2655,6 +2639,10 @@
|
|
|
2655
2639
|
</xsl:element>
|
|
2656
2640
|
</xsl:template>
|
|
2657
2641
|
|
|
2642
|
+
<!-- show sourcecode's name 'before' or 'after' source code -->
|
|
2643
|
+
<xsl:variable name="sourcecode-name-position"><xsl:text>after</xsl:text>
|
|
2644
|
+
</xsl:variable>
|
|
2645
|
+
|
|
2658
2646
|
<xsl:template match="mn:sourcecode" name="sourcecode">
|
|
2659
2647
|
|
|
2660
2648
|
<xsl:variable name="sourcecode_attributes">
|
|
@@ -2678,7 +2666,12 @@
|
|
|
2678
2666
|
|
|
2679
2667
|
<xsl:call-template name="refine_sourcecode-container-style"/>
|
|
2680
2668
|
|
|
2681
|
-
<fo:block-container margin-left="0mm" role="SKIP">
|
|
2669
|
+
<fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
|
|
2670
|
+
|
|
2671
|
+
<!-- <xsl:if test="$namespace = 'rsd'"> -->
|
|
2672
|
+
<xsl:if test="$sourcecode-name-position = 'before'">
|
|
2673
|
+
<xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name BEFORE content -->
|
|
2674
|
+
</xsl:if>
|
|
2682
2675
|
|
|
2683
2676
|
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
|
2684
2677
|
|
|
@@ -2700,7 +2693,16 @@
|
|
|
2700
2693
|
</fo:block>
|
|
2701
2694
|
|
|
2702
2695
|
<xsl:apply-templates select="mn:dl"/> <!-- Key table -->
|
|
2703
|
-
|
|
2696
|
+
|
|
2697
|
+
<!-- <xsl:choose>
|
|
2698
|
+
<xsl:when test="$namespace = 'rsd'"></xsl:when>
|
|
2699
|
+
<xsl:otherwise>
|
|
2700
|
+
<xsl:apply-templates select="mn:fmt-name" /> --><!-- show sourcecode's name AFTER content -->
|
|
2701
|
+
<!-- </xsl:otherwise>
|
|
2702
|
+
</xsl:choose> -->
|
|
2703
|
+
<xsl:if test="$sourcecode-name-position = 'after'">
|
|
2704
|
+
<xsl:apply-templates select="mn:fmt-name"/> <!-- show sourcecode's name AFTER content -->
|
|
2705
|
+
</xsl:if>
|
|
2704
2706
|
|
|
2705
2707
|
</fo:block-container>
|
|
2706
2708
|
</fo:block-container>
|
|
@@ -8466,6 +8468,10 @@
|
|
|
8466
8468
|
<!-- image -->
|
|
8467
8469
|
<!-- ====== -->
|
|
8468
8470
|
|
|
8471
|
+
<!-- show figure's name 'before' or 'after' image -->
|
|
8472
|
+
<xsl:variable name="figure-name-position"><xsl:text>after</xsl:text>
|
|
8473
|
+
</xsl:variable>
|
|
8474
|
+
|
|
8469
8475
|
<xsl:template match="mn:figure" name="figure">
|
|
8470
8476
|
<xsl:variable name="isAdded" select="@added"/>
|
|
8471
8477
|
<xsl:variable name="isDeleted" select="@deleted"/>
|
|
@@ -8478,6 +8484,10 @@
|
|
|
8478
8484
|
<xsl:with-param name="isDeleted" select="$isDeleted"/>
|
|
8479
8485
|
</xsl:call-template>
|
|
8480
8486
|
|
|
8487
|
+
<xsl:if test="$figure-name-position = 'before'"> <!-- show figure's name BEFORE image -->
|
|
8488
|
+
<xsl:apply-templates select="mn:fmt-name"/>
|
|
8489
|
+
</xsl:if>
|
|
8490
|
+
|
|
8481
8491
|
<!-- Example: Dimensions in millimeters -->
|
|
8482
8492
|
<xsl:apply-templates select="mn:note[@type = 'units']"/>
|
|
8483
8493
|
|
|
@@ -8498,7 +8508,16 @@
|
|
|
8498
8508
|
<xsl:if test="normalize-space($show_figure_key_in_block_container) = 'true'">
|
|
8499
8509
|
<xsl:call-template name="showFigureKey"/>
|
|
8500
8510
|
</xsl:if>
|
|
8501
|
-
|
|
8511
|
+
|
|
8512
|
+
<!-- <xsl:choose>
|
|
8513
|
+
<xsl:when test="$namespace = 'bsi' or $namespace = 'pas' or $namespace = 'rsd'"></xsl:when>
|
|
8514
|
+
<xsl:otherwise>
|
|
8515
|
+
<xsl:apply-templates select="mn:fmt-name" /> --> <!-- show figure's name AFTER image -->
|
|
8516
|
+
<!-- </xsl:otherwise>
|
|
8517
|
+
</xsl:choose> -->
|
|
8518
|
+
<xsl:if test="$figure-name-position = 'after'">
|
|
8519
|
+
<xsl:apply-templates select="mn:fmt-name"/> <!-- show figure's name AFTER image -->
|
|
8520
|
+
</xsl:if>
|
|
8502
8521
|
|
|
8503
8522
|
</fo:block-container>
|
|
8504
8523
|
</xsl:template>
|
|
@@ -10573,11 +10592,10 @@
|
|
|
10573
10592
|
<!-- END Admonition -->
|
|
10574
10593
|
<!-- ================ -->
|
|
10575
10594
|
|
|
10576
|
-
<xsl:attribute-set name="
|
|
10595
|
+
<xsl:attribute-set name="bibliography-title-style">
|
|
10577
10596
|
</xsl:attribute-set>
|
|
10578
10597
|
|
|
10579
|
-
<xsl:template name="
|
|
10580
|
-
|
|
10598
|
+
<xsl:template name="refine_bibliography-title-style">
|
|
10581
10599
|
</xsl:template>
|
|
10582
10600
|
|
|
10583
10601
|
<!-- bibitem in Normative References (references/@normative="true") -->
|
|
@@ -12640,7 +12658,8 @@
|
|
|
12640
12658
|
<!-- ===================================== -->
|
|
12641
12659
|
|
|
12642
12660
|
<xsl:attribute-set name="annex-title-style">
|
|
12643
|
-
|
|
12661
|
+
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
|
12662
|
+
</xsl:attribute-set> <!-- annex-title-style -->
|
|
12644
12663
|
|
|
12645
12664
|
<xsl:template name="refine_annex-title-style">
|
|
12646
12665
|
</xsl:template>
|
|
@@ -12651,6 +12670,66 @@
|
|
|
12651
12670
|
<xsl:template name="refine_p-zzSTDTitle1-style">
|
|
12652
12671
|
</xsl:template>
|
|
12653
12672
|
|
|
12673
|
+
<xsl:attribute-set name="p-style">
|
|
12674
|
+
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
|
12675
|
+
<xsl:attribute name="line-height">115%</xsl:attribute>
|
|
12676
|
+
</xsl:attribute-set> <!-- p-style -->
|
|
12677
|
+
|
|
12678
|
+
<xsl:template name="refine_p-style">
|
|
12679
|
+
<xsl:param name="element-name"/>
|
|
12680
|
+
<xsl:param name="margin"/>
|
|
12681
|
+
<xsl:call-template name="setBlockAttributes"/>
|
|
12682
|
+
|
|
12683
|
+
<xsl:if test="ancestor::mn:li">
|
|
12684
|
+
<xsl:attribute name="margin-bottom">0pt</xsl:attribute>
|
|
12685
|
+
</xsl:if>
|
|
12686
|
+
<!-- $namespace = 'csd' -->
|
|
12687
|
+
|
|
12688
|
+
</xsl:template> <!-- refine_p-style -->
|
|
12689
|
+
|
|
12690
|
+
<xsl:attribute-set name="title-style">
|
|
12691
|
+
<!-- Note: font-size for level 1 title -->
|
|
12692
|
+
<xsl:attribute name="font-size">13pt</xsl:attribute>
|
|
12693
|
+
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
|
12694
|
+
<xsl:attribute name="margin-bottom">12pt</xsl:attribute>
|
|
12695
|
+
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
|
12696
|
+
<xsl:attribute name="color">rgb(14, 26, 133)</xsl:attribute>
|
|
12697
|
+
</xsl:attribute-set> <!-- title-style -->
|
|
12698
|
+
|
|
12699
|
+
<xsl:template name="refine_title-style">
|
|
12700
|
+
<xsl:param name="element-name"/>
|
|
12701
|
+
<xsl:variable name="level">
|
|
12702
|
+
<xsl:call-template name="getLevel"/>
|
|
12703
|
+
</xsl:variable>
|
|
12704
|
+
<xsl:if test="$level = 2">
|
|
12705
|
+
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
|
12706
|
+
</xsl:if>
|
|
12707
|
+
<xsl:if test="$level >= 3">
|
|
12708
|
+
<xsl:attribute name="font-size">11pt</xsl:attribute>
|
|
12709
|
+
</xsl:if>
|
|
12710
|
+
<xsl:if test="ancestor::mn:preface">
|
|
12711
|
+
<xsl:attribute name="font-size">13pt</xsl:attribute>
|
|
12712
|
+
</xsl:if>
|
|
12713
|
+
<xsl:if test="ancestor::mn:sections">
|
|
12714
|
+
<xsl:attribute name="margin-top">13.5pt</xsl:attribute>
|
|
12715
|
+
</xsl:if>
|
|
12716
|
+
<xsl:if test="parent::mn:annex"><!-- Annex title -->
|
|
12717
|
+
<xsl:variable name="annex_title_styles">
|
|
12718
|
+
<styles xsl:use-attribute-sets="annex-title-style"><xsl:call-template name="refine_annex-title-style"/></styles>
|
|
12719
|
+
</xsl:variable>
|
|
12720
|
+
<xsl:copy-of select="xalan:nodeset($annex_title_styles)/styles/@*"/>
|
|
12721
|
+
</xsl:if>
|
|
12722
|
+
<xsl:if test="parent::mn:references[not(@normative='true')]"><!-- Bibliography section title -->
|
|
12723
|
+
<xsl:variable name="bibliography_title_styles">
|
|
12724
|
+
<styles xsl:use-attribute-sets="bibliography-title-style"><xsl:call-template name="refine_bibliography-title-style"/></styles>
|
|
12725
|
+
</xsl:variable>
|
|
12726
|
+
<xsl:copy-of select="xalan:nodeset($bibliography_title_styles)/styles/@*"/>
|
|
12727
|
+
</xsl:if>
|
|
12728
|
+
|
|
12729
|
+
<!-- $namespace = 'csd' -->
|
|
12730
|
+
<xsl:attribute name="role">H<xsl:value-of select="$level"/></xsl:attribute>
|
|
12731
|
+
</xsl:template> <!-- refine_title-style -->
|
|
12732
|
+
|
|
12654
12733
|
<xsl:template name="processPrefaceSectionsDefault">
|
|
12655
12734
|
<xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
|
|
12656
12735
|
<xsl:sort select="@displayorder" data-type="number"/>
|
|
@@ -12989,6 +13068,12 @@
|
|
|
12989
13068
|
</xsl:choose>
|
|
12990
13069
|
</xsl:template>
|
|
12991
13070
|
|
|
13071
|
+
<xsl:attribute-set name="reset-margins-style">
|
|
13072
|
+
<xsl:attribute name="margin-left">0mm</xsl:attribute>
|
|
13073
|
+
<xsl:attribute name="margin-right">0mm</xsl:attribute>
|
|
13074
|
+
<xsl:attribute name="role">SKIP</xsl:attribute>
|
|
13075
|
+
</xsl:attribute-set>
|
|
13076
|
+
|
|
12992
13077
|
<xsl:attribute-set name="clause-style">
|
|
12993
13078
|
|
|
12994
13079
|
</xsl:attribute-set>
|
|
@@ -14004,8 +14089,9 @@
|
|
|
14004
14089
|
|
|
14005
14090
|
<xsl:template name="setTextAlignment">
|
|
14006
14091
|
<xsl:param name="default">left</xsl:param>
|
|
14092
|
+
<xsl:param name="skip_default">false</xsl:param>
|
|
14007
14093
|
<xsl:variable name="align" select="normalize-space(@align)"/>
|
|
14008
|
-
<xsl:
|
|
14094
|
+
<xsl:variable name="text_align">
|
|
14009
14095
|
<xsl:choose>
|
|
14010
14096
|
<xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
|
|
14011
14097
|
<xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
|
|
@@ -14013,9 +14099,13 @@
|
|
|
14013
14099
|
<xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
|
|
14014
14100
|
<xsl:when test="ancestor::mn:td/@align"><xsl:value-of select="ancestor::mn:td/@align"/></xsl:when>
|
|
14015
14101
|
<xsl:when test="ancestor::mn:th/@align"><xsl:value-of select="ancestor::mn:th/@align"/></xsl:when>
|
|
14102
|
+
<xsl:when test="$skip_default = 'true'"/>
|
|
14016
14103
|
<xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
|
|
14017
14104
|
</xsl:choose>
|
|
14018
|
-
</xsl:
|
|
14105
|
+
</xsl:variable>
|
|
14106
|
+
<xsl:if test="normalize-space($text_align) != ''">
|
|
14107
|
+
<xsl:attribute name="text-align"><xsl:value-of select="$text_align"/></xsl:attribute>
|
|
14108
|
+
</xsl:if>
|
|
14019
14109
|
<xsl:if test="$align = 'indent'">
|
|
14020
14110
|
<xsl:attribute name="margin-left">7mm</xsl:attribute>
|
|
14021
14111
|
</xsl:if>
|
|
@@ -14023,8 +14113,10 @@
|
|
|
14023
14113
|
|
|
14024
14114
|
<xsl:template name="setBlockAttributes">
|
|
14025
14115
|
<xsl:param name="text_align_default">left</xsl:param>
|
|
14116
|
+
<xsl:param name="skip_text_align_default">false</xsl:param>
|
|
14026
14117
|
<xsl:call-template name="setTextAlignment">
|
|
14027
14118
|
<xsl:with-param name="default" select="$text_align_default"/>
|
|
14119
|
+
<xsl:with-param name="skip_default" select="$skip_text_align_default"/>
|
|
14028
14120
|
</xsl:call-template>
|
|
14029
14121
|
<xsl:call-template name="setKeepAttributes"/>
|
|
14030
14122
|
<xsl:if test="node()[1][self::mn:span][contains(@style, 'line-height')]">
|
data/lib/isodoc/cc/init.rb
CHANGED
data/lib/metanorma/cc/biblio.rng
CHANGED
|
@@ -690,7 +690,7 @@ Examples include GRID, LEI, CrossRef, and Ringgold</a:documentation>
|
|
|
690
690
|
<define name="CitationType">
|
|
691
691
|
<attribute name="bibitemid">
|
|
692
692
|
<a:documentation>Bibliographic item that the citation applies to, referenced as the anchor of a bibliographic description</a:documentation>
|
|
693
|
-
<
|
|
693
|
+
<ref name="IdRefType"/>
|
|
694
694
|
</attribute>
|
|
695
695
|
<choice>
|
|
696
696
|
<zeroOrMore>
|
|
@@ -1296,17 +1296,17 @@ for which this claim of validity is made, if applicable</a:documentation>
|
|
|
1296
1296
|
</define>
|
|
1297
1297
|
<define name="validityBegins">
|
|
1298
1298
|
<element name="validityBegins">
|
|
1299
|
-
<ref name="
|
|
1299
|
+
<ref name="ISO8601DateTime"/>
|
|
1300
1300
|
</element>
|
|
1301
1301
|
</define>
|
|
1302
1302
|
<define name="validityEnds">
|
|
1303
1303
|
<element name="validityEnds">
|
|
1304
|
-
<ref name="
|
|
1304
|
+
<ref name="ISO8601DateTime"/>
|
|
1305
1305
|
</element>
|
|
1306
1306
|
</define>
|
|
1307
1307
|
<define name="validityRevision">
|
|
1308
1308
|
<element name="revision">
|
|
1309
|
-
<ref name="
|
|
1309
|
+
<ref name="ISO8601DateTime"/>
|
|
1310
1310
|
</element>
|
|
1311
1311
|
</define>
|
|
1312
1312
|
<define name="TypedTitleString">
|
data/lib/metanorma/cc/isodoc.rng
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<?xml version="1.0" encoding="UTF-8"?>
|
|
2
2
|
<grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
|
|
3
|
-
<!-- VERSION v2.1.
|
|
3
|
+
<!-- VERSION v2.1.4 -->
|
|
4
4
|
|
|
5
5
|
<!--
|
|
6
6
|
ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
|
|
@@ -905,15 +905,32 @@ titlecase, or lowercase</a:documentation>
|
|
|
905
905
|
</element>
|
|
906
906
|
</define>
|
|
907
907
|
<define name="image" combine="choice">
|
|
908
|
-
<
|
|
909
|
-
<
|
|
910
|
-
|
|
911
|
-
<
|
|
912
|
-
|
|
913
|
-
<
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
908
|
+
<choice>
|
|
909
|
+
<element name="image">
|
|
910
|
+
<ref name="RequiredId"/>
|
|
911
|
+
<ref name="ImageAttributes"/>
|
|
912
|
+
<optional>
|
|
913
|
+
<element name="svg">
|
|
914
|
+
<a:documentation>Allow svg in image/svg, for consistency</a:documentation>
|
|
915
|
+
<oneOrMore>
|
|
916
|
+
<choice>
|
|
917
|
+
<text/>
|
|
918
|
+
<ref name="AnyElement"/>
|
|
919
|
+
</choice>
|
|
920
|
+
</oneOrMore>
|
|
921
|
+
</element>
|
|
922
|
+
</optional>
|
|
923
|
+
</element>
|
|
924
|
+
<element name="svg">
|
|
925
|
+
<a:documentation>Add svg mark up to image</a:documentation>
|
|
926
|
+
<oneOrMore>
|
|
927
|
+
<choice>
|
|
928
|
+
<text/>
|
|
929
|
+
<ref name="AnyElement"/>
|
|
930
|
+
</choice>
|
|
931
|
+
</oneOrMore>
|
|
932
|
+
</element>
|
|
933
|
+
</choice>
|
|
917
934
|
</define>
|
|
918
935
|
<define name="ParagraphFnBody" combine="interleave">
|
|
919
936
|
<ref name="BlockSource">
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
module Metanorma
|
|
2
|
+
module Cc
|
|
3
|
+
class Converter
|
|
4
|
+
CC_LOG_MESSAGES = {
|
|
5
|
+
# rubocop:disable Naming/VariableNumber
|
|
6
|
+
"CC_1": { category: "Style",
|
|
7
|
+
error: "Only one Symbols and Abbreviated Terms section in the standard",
|
|
8
|
+
severity: 2 },
|
|
9
|
+
"CC_2": { category: "Style",
|
|
10
|
+
error: "Symbols and Abbreviated Terms can only contain a definition list",
|
|
11
|
+
severity: 2 },
|
|
12
|
+
"CC_3": { category: "Style",
|
|
13
|
+
error: "(section sequencing) %s",
|
|
14
|
+
severity: 2 },
|
|
15
|
+
"CC_4": { category: "Style",
|
|
16
|
+
error: "Document must contain at least one clause",
|
|
17
|
+
severity: 2 },
|
|
18
|
+
"CC_5": { category: "Style",
|
|
19
|
+
error: "Document must contain clause after Terms and Definitions",
|
|
20
|
+
severity: 2 },
|
|
21
|
+
"CC_6": { category: "Style",
|
|
22
|
+
error: "Scope must occur before Terms and Definitions",
|
|
23
|
+
severity: 2 },
|
|
24
|
+
"CC_8": { category: "Style",
|
|
25
|
+
error: "Only annexes and references can follow clauses",
|
|
26
|
+
severity: 2 },
|
|
27
|
+
"CC_9": { category: "Style",
|
|
28
|
+
error: "Document must include (references) Normative References",
|
|
29
|
+
severity: 2 },
|
|
30
|
+
"CC_11": { category: "Style",
|
|
31
|
+
error: "Final section must be (references) Bibliography",
|
|
32
|
+
severity: 2 },
|
|
33
|
+
"CC_12": { category: "Style",
|
|
34
|
+
error: "There are sections after the final Bibliography",
|
|
35
|
+
severity: 2 },
|
|
36
|
+
|
|
37
|
+
}.freeze
|
|
38
|
+
# rubocop:enable Naming/VariableNumber
|
|
39
|
+
|
|
40
|
+
def log_messages
|
|
41
|
+
super.merge(CC_LOG_MESSAGES)
|
|
42
|
+
end
|
|
43
|
+
end
|
|
44
|
+
end
|
|
45
|
+
end
|
|
@@ -11,19 +11,13 @@ module Metanorma
|
|
|
11
11
|
super
|
|
12
12
|
end
|
|
13
13
|
|
|
14
|
-
ONE_SYMBOLS_WARNING = "Only one Symbols and Abbreviated "\
|
|
15
|
-
"Terms section in the standard".freeze
|
|
16
|
-
|
|
17
|
-
NON_DL_SYMBOLS_WARNING = "Symbols and Abbreviated Terms can "\
|
|
18
|
-
"only contain a definition list".freeze
|
|
19
|
-
|
|
20
14
|
def symbols_validate(root)
|
|
21
15
|
f = root.xpath("//definitions")
|
|
22
16
|
f.empty? && return
|
|
23
|
-
|
|
17
|
+
f.size == 1 or @log.add("CC_1", f.first)
|
|
24
18
|
f.first.elements.each do |e|
|
|
25
19
|
unless e.name == "dl"
|
|
26
|
-
@log.add("
|
|
20
|
+
@log.add("CC_2", f.first)
|
|
27
21
|
return
|
|
28
22
|
end
|
|
29
23
|
end
|
|
@@ -35,7 +29,7 @@ module Metanorma
|
|
|
35
29
|
|
|
36
30
|
test = accepted.map { |a| n.at(a) }
|
|
37
31
|
if test.all?(&:nil?)
|
|
38
|
-
@log.add("
|
|
32
|
+
@log.add("CC_3", nil, params: [msg])
|
|
39
33
|
end
|
|
40
34
|
names
|
|
41
35
|
end
|
|
@@ -83,42 +77,35 @@ module Metanorma
|
|
|
83
77
|
n = names.shift
|
|
84
78
|
end
|
|
85
79
|
if n.nil? || n.name != "clause"
|
|
86
|
-
@log.add("
|
|
80
|
+
@log.add("CC_4", nil)
|
|
87
81
|
end
|
|
88
82
|
n&.at("./self::clause") ||
|
|
89
|
-
@log.add("
|
|
90
|
-
"Terms and Definitions")
|
|
83
|
+
@log.add("CC_5", nil)
|
|
91
84
|
n&.at("./self::clause[@type = 'scope']") &&
|
|
92
|
-
@log.add("
|
|
93
|
-
"Scope must occur before Terms and Definitions")
|
|
85
|
+
@log.add("CC_6", nil)
|
|
94
86
|
n = names.shift
|
|
95
87
|
while n&.name == "clause"
|
|
96
88
|
n&.at("./self::clause[@type = 'scope']")
|
|
97
|
-
@log.add("
|
|
98
|
-
"Scope must occur before Terms and Definitions")
|
|
89
|
+
@log.add("CC_6", nil)
|
|
99
90
|
n = names.shift
|
|
100
91
|
end
|
|
101
92
|
unless %w(annex references).include? n&.name
|
|
102
|
-
@log.add("
|
|
103
|
-
"Only annexes and references can follow clauses")
|
|
93
|
+
@log.add("CC_8", nil)
|
|
104
94
|
end
|
|
105
95
|
while n&.name == "annex"
|
|
106
96
|
n = names.shift
|
|
107
97
|
if n.nil?
|
|
108
|
-
@log.add("
|
|
109
|
-
|
|
98
|
+
@log.add("CC_9", nil)
|
|
99
|
+
|
|
110
100
|
end
|
|
111
101
|
end
|
|
112
102
|
n&.at("./self::references[@normative = 'true']") ||
|
|
113
|
-
@log.add("
|
|
114
|
-
"Normative References")
|
|
103
|
+
@log.add("CC_9", nil)
|
|
115
104
|
n = names&.shift
|
|
116
105
|
n&.at("./self::references[@normative = 'false']") ||
|
|
117
|
-
@log.add("
|
|
118
|
-
"Final section must be (references) Bibliography")
|
|
106
|
+
@log.add("CC_11", nil)
|
|
119
107
|
names.empty? ||
|
|
120
|
-
@log.add("
|
|
121
|
-
"There are sections after the final Bibliography")
|
|
108
|
+
@log.add("CC_12", nil)
|
|
122
109
|
end
|
|
123
110
|
|
|
124
111
|
def style_warning(node, msg, text = nil)
|
|
@@ -126,7 +113,7 @@ module Metanorma
|
|
|
126
113
|
|
|
127
114
|
w = msg
|
|
128
115
|
w += ": #{text}" if text
|
|
129
|
-
@log.add("
|
|
116
|
+
@log.add("STANDOC_48", node, params: [w])
|
|
130
117
|
end
|
|
131
118
|
end
|
|
132
119
|
end
|
data/lib/metanorma/cc/version.rb
CHANGED
data/metanorma-cc.gemspec
CHANGED
|
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
|
|
|
29
29
|
spec.require_paths = ["lib"]
|
|
30
30
|
spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
|
|
31
31
|
|
|
32
|
-
spec.add_dependency "metanorma-generic", "~> 3.
|
|
32
|
+
spec.add_dependency "metanorma-generic", "~> 3.2.0"
|
|
33
33
|
|
|
34
34
|
spec.add_development_dependency "debug"
|
|
35
35
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: metanorma-cc
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 2.7.
|
|
4
|
+
version: 2.7.8
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2025-
|
|
11
|
+
date: 2025-11-17 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: metanorma-generic
|
|
@@ -16,14 +16,14 @@ dependencies:
|
|
|
16
16
|
requirements:
|
|
17
17
|
- - "~>"
|
|
18
18
|
- !ruby/object:Gem::Version
|
|
19
|
-
version: 3.
|
|
19
|
+
version: 3.2.0
|
|
20
20
|
type: :runtime
|
|
21
21
|
prerelease: false
|
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
|
23
23
|
requirements:
|
|
24
24
|
- - "~>"
|
|
25
25
|
- !ruby/object:Gem::Version
|
|
26
|
-
version: 3.
|
|
26
|
+
version: 3.2.0
|
|
27
27
|
- !ruby/object:Gem::Dependency
|
|
28
28
|
name: debug
|
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
|
@@ -246,6 +246,7 @@ files:
|
|
|
246
246
|
- lib/metanorma/cc/cc.rng
|
|
247
247
|
- lib/metanorma/cc/converter.rb
|
|
248
248
|
- lib/metanorma/cc/isodoc.rng
|
|
249
|
+
- lib/metanorma/cc/log.rb
|
|
249
250
|
- lib/metanorma/cc/processor.rb
|
|
250
251
|
- lib/metanorma/cc/relaton-cc.rng
|
|
251
252
|
- lib/metanorma/cc/reqt.rng
|