metanorma-iec 2.0.5 → 2.0.8

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: 4d7748699d6414de9def85acc9298a31f507492ca7a1fb5bc94b19264fdbbbba
4
- data.tar.gz: 342bcbd3c66cd744bd8c1a63f4a2867f6cb024c504ce9b4a45e90b0d1d50ba8c
3
+ metadata.gz: efffb1911ccc40c61913ea1afe4711abff6eba4396b9fc46a24cb78a24434f51
4
+ data.tar.gz: 6895a2259cc7cabaee3f175cb4186232c29ceca5282a6e8ef81d1d8123c8faf4
5
5
  SHA512:
6
- metadata.gz: 583090be4e32cfcb95eed3071775b35959703175e3821623a43c5e46c3e279d2b7519e7e5367513759f4765298a7edbe32d4efbf7d05ff1d9d8e7e880c925381
7
- data.tar.gz: ccbeaecab184817d9e92d5767e7ce2ed6b53d7dfb3745048570489747cf986f16abdf6607672cf66d57c2702d3234bd321ae5022f9725986754d2f52e514fa3a
6
+ metadata.gz: 2fbec035d589c6a49df172d36a4a37399962f1526e842fdc3303ae7f593c676311c620797105e5a76200cb293992d3c89f1997d8ed3ecd094798211c3662fde0
7
+ data.tar.gz: fc71ae2e1bce8b2f099d488f1448340978ba4b7ab4d3cdcb2b7dfac1b007e07a42cbab7cd9647e85bc9aea5086f6664ae32d388d5ee69f65cbb9af5411fadd4b
@@ -114,7 +114,13 @@
114
114
  <xsl:call-template name="namespaceCheck"/>
115
115
  <!-- https://stackoverflow.com/questions/25261949/xsl-fo-letter-spacing-with-text-align -->
116
116
  <!-- https://xmlgraphics.apache.org/fop/knownissues.html -->
117
- <fo:root xsl:use-attribute-sets="root-style" xml:lang="{$lang}">
117
+ <fo:root xml:lang="{$lang}">
118
+ <xsl:variable name="root-style">
119
+ <root-style xsl:use-attribute-sets="root-style"/>
120
+ </xsl:variable>
121
+ <xsl:call-template name="insertRootStyle">
122
+ <xsl:with-param name="root-style" select="$root-style"/>
123
+ </xsl:call-template>
118
124
  <fo:layout-master-set>
119
125
  <!-- cover pages -->
120
126
  <fo:simple-page-master master-name="cover" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
@@ -1922,7 +1928,7 @@
1922
1928
  </xsl:copy>
1923
1929
  </xsl:template> -->
1924
1930
 
1925
- <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:key name="bibitems" match="*[local-name() = 'bibitem']" use="@id"/><xsl:key name="bibitems_hidden" match="*[local-name() = 'bibitem'][@hidden='true'] | *[local-name() = 'references'][@hidden='true']//*[local-name() = 'bibitem']" use="@id"/><xsl:variable name="lang">
1931
+ <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:variable name="lang">
1926
1932
  <xsl:call-template name="getLang"/>
1927
1933
  </xsl:variable><xsl:variable name="pageWidth_">
1928
1934
  210
@@ -2078,7 +2084,30 @@
2078
2084
 
2079
2085
 
2080
2086
 
2081
- </xsl:attribute-set><xsl:attribute-set name="copyright-statement-style">
2087
+ </xsl:attribute-set><xsl:template name="insertRootStyle">
2088
+ <xsl:param name="root-style"/>
2089
+ <xsl:variable name="root-style_" select="xalan:nodeset($root-style)"/>
2090
+
2091
+ <xsl:variable name="additional_fonts_">
2092
+ <xsl:for-each select="//*[local-name() = 'misc-container'][1]/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'fonts']/*[local-name() = 'value']">
2093
+ <xsl:value-of select="."/><xsl:if test="position() != last()">, </xsl:if>
2094
+ </xsl:for-each>
2095
+ </xsl:variable>
2096
+ <xsl:variable name="additional_fonts" select="normalize-space($additional_fonts_)"/>
2097
+
2098
+ <xsl:for-each select="$root-style_/root-style/@*">
2099
+ <xsl:choose>
2100
+ <xsl:when test="local-name() = 'font-family' and $additional_fonts != ''">
2101
+ <xsl:attribute name="{local-name()}">
2102
+ <xsl:value-of select="."/>, <xsl:value-of select="$additional_fonts"/>
2103
+ </xsl:attribute>
2104
+ </xsl:when>
2105
+ <xsl:otherwise>
2106
+ <xsl:copy-of select="."/>
2107
+ </xsl:otherwise>
2108
+ </xsl:choose>
2109
+ </xsl:for-each>
2110
+ </xsl:template><xsl:attribute-set name="copyright-statement-style">
2082
2111
 
2083
2112
  </xsl:attribute-set><xsl:attribute-set name="copyright-statement-title-style">
2084
2113
 
@@ -2620,7 +2649,7 @@
2620
2649
 
2621
2650
 
2622
2651
 
2623
- </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
2652
+ </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
2624
2653
 
2625
2654
 
2626
2655
 
@@ -3343,8 +3372,27 @@
3343
3372
  <xsl:sort select="@displayorder" data-type="number"/>
3344
3373
  <xsl:apply-templates select="."/>
3345
3374
  </xsl:for-each>
3346
- </xsl:template><xsl:template match="text()">
3347
- <xsl:value-of select="."/>
3375
+ </xsl:template><xsl:variable name="tag_open">###fo:inline###</xsl:variable><xsl:variable name="tag_close">###/fo:inline###</xsl:variable><xsl:template match="text()" name="text">
3376
+ <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
3377
+ <xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new(.),$regex_standard_reference,concat($tag_open,'$1',$tag_close))"/>
3378
+ <xsl:call-template name="replace_fo_inline">
3379
+ <xsl:with-param name="text" select="$text"/>
3380
+ </xsl:call-template>
3381
+ </xsl:template><xsl:template name="replace_fo_inline">
3382
+ <xsl:param name="text"/>
3383
+ <xsl:choose>
3384
+ <xsl:when test="contains($text, $tag_open)">
3385
+ <xsl:value-of select="substring-before($text, $tag_open)"/>
3386
+ <xsl:text disable-output-escaping="yes">&lt;fo:inline keep-together.within-line="always"&gt;</xsl:text>
3387
+ <xsl:variable name="text_after" select="substring-after($text, $tag_open)"/>
3388
+ <xsl:value-of select="substring-before($text_after, $tag_close)"/>
3389
+ <xsl:text disable-output-escaping="yes">&lt;/fo:inline&gt;</xsl:text>
3390
+ <xsl:call-template name="replace_fo_inline">
3391
+ <xsl:with-param name="text" select="substring-after($text_after, $tag_close)"/>
3392
+ </xsl:call-template>
3393
+ </xsl:when>
3394
+ <xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
3395
+ </xsl:choose>
3348
3396
  </xsl:template><xsl:template match="*[local-name()='br']">
3349
3397
  <xsl:value-of select="$linebreak"/>
3350
3398
  </xsl:template><xsl:template match="*[local-name()='copyright-statement']">
@@ -5037,24 +5085,28 @@
5037
5085
  </xsl:template><xsl:template name="add-zero-spaces-equal">
5038
5086
  <xsl:param name="text" select="."/>
5039
5087
  <xsl:variable name="zero-space-after-equals">==========</xsl:variable>
5088
+ <xsl:variable name="regex_zero-space-after-equals">(==========)</xsl:variable>
5040
5089
  <xsl:variable name="zero-space-after-equal">=</xsl:variable>
5090
+ <xsl:variable name="regex_zero-space-after-equal">(=)</xsl:variable>
5041
5091
  <xsl:variable name="zero-space">​</xsl:variable>
5042
5092
  <xsl:choose>
5043
5093
  <xsl:when test="contains($text, $zero-space-after-equals)">
5044
- <xsl:value-of select="substring-before($text, $zero-space-after-equals)"/>
5094
+ <!-- <xsl:value-of select="substring-before($text, $zero-space-after-equals)"/>
5045
5095
  <xsl:value-of select="$zero-space-after-equals"/>
5046
5096
  <xsl:value-of select="$zero-space"/>
5047
5097
  <xsl:call-template name="add-zero-spaces-equal">
5048
5098
  <xsl:with-param name="text" select="substring-after($text, $zero-space-after-equals)"/>
5049
- </xsl:call-template>
5099
+ </xsl:call-template> -->
5100
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),$regex_zero-space-after-equals,concat('$1',$zero_width_space))"/>
5050
5101
  </xsl:when>
5051
5102
  <xsl:when test="contains($text, $zero-space-after-equal)">
5052
- <xsl:value-of select="substring-before($text, $zero-space-after-equal)"/>
5103
+ <!-- <xsl:value-of select="substring-before($text, $zero-space-after-equal)"/>
5053
5104
  <xsl:value-of select="$zero-space-after-equal"/>
5054
5105
  <xsl:value-of select="$zero-space"/>
5055
5106
  <xsl:call-template name="add-zero-spaces-equal">
5056
5107
  <xsl:with-param name="text" select="substring-after($text, $zero-space-after-equal)"/>
5057
- </xsl:call-template>
5108
+ </xsl:call-template> -->
5109
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),$regex_zero-space-after-equal,concat('$1',$zero_width_space))"/>
5058
5110
  </xsl:when>
5059
5111
  <xsl:otherwise>
5060
5112
  <xsl:value-of select="$text"/>
@@ -5534,7 +5586,12 @@
5534
5586
 
5535
5587
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
5536
5588
 
5589
+ <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
5590
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
5591
+ </xsl:if>
5592
+
5537
5593
 
5594
+
5538
5595
 
5539
5596
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
5540
5597
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
@@ -6515,7 +6572,73 @@
6515
6572
  <xsl:with-param name="text" select="$text_step1"/>
6516
6573
  </xsl:call-template>
6517
6574
  </xsl:variable>
6518
- <xsl:value-of select="$text_step2"/>
6575
+
6576
+ <!-- <xsl:value-of select="$text_step2"/> -->
6577
+
6578
+ <!-- add zero-width space after space -->
6579
+ <xsl:variable name="text_step3" select="java:replaceAll(java:java.lang.String.new($text_step2),' ',' ​')"/>
6580
+
6581
+ <!-- split text by zero-width space -->
6582
+ <xsl:variable name="text_step4">
6583
+ <xsl:call-template name="split_for_interspers">
6584
+ <xsl:with-param name="pText" select="$text_step3"/>
6585
+ <xsl:with-param name="sep" select="$zero_width_space"/>
6586
+ </xsl:call-template>
6587
+ </xsl:variable>
6588
+
6589
+ <xsl:for-each select="xalan:nodeset($text_step4)/node()">
6590
+ <xsl:choose>
6591
+ <xsl:when test="local-name() = 'interspers'"> <!-- word with length more than 30 will be interspersed with zero-width space -->
6592
+ <xsl:call-template name="interspers">
6593
+ <xsl:with-param name="str" select="."/>
6594
+ </xsl:call-template>
6595
+ </xsl:when>
6596
+ <xsl:otherwise>
6597
+ <xsl:value-of select="."/>
6598
+ </xsl:otherwise>
6599
+ </xsl:choose>
6600
+ </xsl:for-each>
6601
+
6602
+ </xsl:template><xsl:variable name="interspers_tag_open">###interspers123###</xsl:variable><xsl:variable name="interspers_tag_close">###/interspers123###</xsl:variable><xsl:template name="split_for_interspers">
6603
+ <xsl:param name="pText" select="."/>
6604
+ <xsl:param name="sep" select="','"/>
6605
+ <!-- word with length more than 30 will be interspersed with zero-width space -->
6606
+ <xsl:variable name="regex" select="concat('([^', $zero_width_space, ']{31,})')"/> <!-- sequence of characters (more 31), that doesn't contains zero-width space -->
6607
+ <xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new($pText),$regex,concat($interspers_tag_open,'$1',$interspers_tag_close))"/>
6608
+ <xsl:call-template name="replace_tag_interspers">
6609
+ <xsl:with-param name="text" select="$text"/>
6610
+ </xsl:call-template>
6611
+ </xsl:template><xsl:template name="replace_tag_interspers">
6612
+ <xsl:param name="text"/>
6613
+ <xsl:choose>
6614
+ <xsl:when test="contains($text, $interspers_tag_open)">
6615
+ <xsl:value-of select="substring-before($text, $interspers_tag_open)"/>
6616
+ <xsl:variable name="text_after" select="substring-after($text, $interspers_tag_open)"/>
6617
+ <interspers>
6618
+ <xsl:value-of select="substring-before($text_after, $interspers_tag_close)"/>
6619
+ </interspers>
6620
+ <xsl:call-template name="replace_tag_interspers">
6621
+ <xsl:with-param name="text" select="substring-after($text_after, $interspers_tag_close)"/>
6622
+ </xsl:call-template>
6623
+ </xsl:when>
6624
+ <xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
6625
+ </xsl:choose>
6626
+ </xsl:template><xsl:template name="interspers">
6627
+ <xsl:param name="str"/>
6628
+ <xsl:param name="char" select="$zero_width_space"/>
6629
+ <xsl:if test="$str != ''">
6630
+ <xsl:value-of select="substring($str, 1, 1)"/>
6631
+
6632
+ <xsl:variable name="next_char" select="substring($str, 2, 1)"/>
6633
+ <xsl:if test="not(contains(concat(' -.:=_— ', $char), $next_char))">
6634
+ <xsl:value-of select="$char"/>
6635
+ </xsl:if>
6636
+
6637
+ <xsl:call-template name="interspers">
6638
+ <xsl:with-param name="str" select="substring($str, 2)"/>
6639
+ <xsl:with-param name="char" select="$char"/>
6640
+ </xsl:call-template>
6641
+ </xsl:if>
6519
6642
  </xsl:template><xsl:template match="*" mode="syntax_highlight">
6520
6643
  <xsl:apply-templates mode="syntax_highlight"/>
6521
6644
  </xsl:template><xsl:variable name="syntax_highlight_styles_">
@@ -6953,7 +7076,7 @@
6953
7076
  </xsl:otherwise>
6954
7077
  </xsl:choose> -->
6955
7078
  </fo:block>
6956
- </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()[starts-with(., '[SOURCE: Adapted from: ')]" priority="2">
7079
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()[starts-with(., '[SOURCE: Adapted from: ') or starts-with(., '[SOURCE: Quoted from: ') or starts-with(., '[SOURCE: Modified from: ')]" priority="2">
6957
7080
  <xsl:text>[</xsl:text><xsl:value-of select="substring-after(., '[SOURCE: ')"/>
6958
7081
  </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
6959
7082
  <xsl:if test="normalize-space() != ''">
@@ -6989,7 +7112,8 @@
6989
7112
  <fo:inline><xsl:apply-templates/></fo:inline>
6990
7113
  </xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
6991
7114
  <xsl:if test="normalize-space() != ''">
6992
- <xsl:value-of select="."/>
7115
+ <!-- <xsl:value-of select="."/> -->
7116
+ <xsl:call-template name="text"/>
6993
7117
  </xsl:if>
6994
7118
  </xsl:template><xsl:template match="*[local-name() = 'quote']">
6995
7119
  <fo:block-container margin-left="0mm">
@@ -7029,11 +7153,24 @@
7029
7153
  </xsl:template><xsl:template match="*[local-name() = 'author']">
7030
7154
  <xsl:text>— </xsl:text>
7031
7155
  <xsl:apply-templates/>
7032
- </xsl:template><xsl:template match="*[local-name() = 'eref']">
7156
+ </xsl:template><xsl:variable name="bibitems_">
7157
+ <xsl:for-each select="//*[local-name() = 'bibitem']">
7158
+ <xsl:copy-of select="."/>
7159
+ </xsl:for-each>
7160
+ </xsl:variable><xsl:variable name="bibitems" select="xalan:nodeset($bibitems_)"/><xsl:variable name="bibitems_hidden_">
7161
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden='true']">
7162
+ <xsl:copy-of select="."/>
7163
+ </xsl:for-each>
7164
+ <xsl:for-each select="//*[local-name() = 'references'][@hidden='true']//*[local-name() = 'bibitem']">
7165
+ <xsl:copy-of select="."/>
7166
+ </xsl:for-each>
7167
+ </xsl:variable><xsl:variable name="bibitems_hidden" select="xalan:nodeset($bibitems_hidden_)"/><xsl:template match="*[local-name() = 'eref']">
7033
7168
  <xsl:variable name="current_bibitemid" select="@bibitemid"/>
7034
- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/>
7169
+ <!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/> -->
7170
+ <xsl:variable name="external-destination" select="normalize-space($bibitems/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'citation'])"/>
7035
7171
  <xsl:choose>
7036
- <xsl:when test="$external-destination != '' or not(key('bibitems_hidden', $current_bibitemid))"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
7172
+ <!-- <xsl:when test="$external-destination != '' or not(key('bibitems_hidden', $current_bibitemid))"> --> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
7173
+ <xsl:when test="$external-destination != '' or not($bibitems_hidden/*[local-name() ='bibitem'][@id = $current_bibitemid])"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
7037
7174
  <fo:inline xsl:use-attribute-sets="eref-style">
7038
7175
  <xsl:if test="@type = 'footnote'">
7039
7176
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
@@ -8160,7 +8297,7 @@
8160
8297
  <xsl:copy>
8161
8298
  <xsl:copy-of select="@*"/>
8162
8299
  <!-- copy all elements from bibliography except 'Normative references' (moved to 'sections') -->
8163
- <xsl:for-each select="*[not(@normative='true') and not(*[*[@normative='true']])]">
8300
+ <xsl:for-each select="*[not(@normative='true') and not(*[@normative='true'])]">
8164
8301
  <xsl:sort select="@displayorder" data-type="number"/>
8165
8302
  <xsl:apply-templates select="." mode="update_xml_step1"/>
8166
8303
  </xsl:for-each>
@@ -8409,22 +8546,25 @@
8409
8546
  <xsl:param name="pText" select="."/>
8410
8547
  <xsl:param name="sep" select="','"/>
8411
8548
  <xsl:param name="normalize-space" select="'true'"/>
8549
+ <xsl:param name="keep_sep" select="'false'"/>
8412
8550
  <xsl:if test="string-length($pText) &gt;0">
8413
- <item>
8414
- <xsl:choose>
8415
- <xsl:when test="$normalize-space = 'true'">
8416
- <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
8417
- </xsl:when>
8418
- <xsl:otherwise>
8419
- <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
8420
- </xsl:otherwise>
8421
- </xsl:choose>
8422
- </item>
8423
- <xsl:call-template name="split">
8424
- <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
8425
- <xsl:with-param name="sep" select="$sep"/>
8426
- <xsl:with-param name="normalize-space" select="$normalize-space"/>
8427
- </xsl:call-template>
8551
+ <item>
8552
+ <xsl:choose>
8553
+ <xsl:when test="$normalize-space = 'true'">
8554
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
8555
+ </xsl:when>
8556
+ <xsl:otherwise>
8557
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
8558
+ </xsl:otherwise>
8559
+ </xsl:choose>
8560
+ </item>
8561
+ <xsl:if test="$keep_sep = 'true' and contains($pText, $sep)"><item><xsl:value-of select="$sep"/></item></xsl:if>
8562
+ <xsl:call-template name="split">
8563
+ <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
8564
+ <xsl:with-param name="sep" select="$sep"/>
8565
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
8566
+ <xsl:with-param name="keep_sep" select="$keep_sep"/>
8567
+ </xsl:call-template>
8428
8568
  </xsl:if>
8429
8569
  </xsl:template><xsl:template name="getDocumentId">
8430
8570
  <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
@@ -527,7 +527,7 @@
527
527
  </define>
528
528
  <define name="LocalityType">
529
529
  <data type="string">
530
- <param name="pattern">section|clause|part|paragraph|chapter|page|whole|table|annex|figure|note|list|example|volume|issue|time|anchor|locality:[a-zA-Z0-9_]+</param>
530
+ <param name="pattern">section|clause|part|paragraph|chapter|page|title|line|whole|table|annex|figure|note|list|example|volume|issue|time|anchor|locality:[a-zA-Z0-9_]+</param>
531
531
  </data>
532
532
  </define>
533
533
  <define name="referenceFrom">
@@ -677,6 +677,9 @@
677
677
  <zeroOrMore>
678
678
  <ref name="extent"/>
679
679
  </zeroOrMore>
680
+ <optional>
681
+ <ref name="bibliographic_size"/>
682
+ </optional>
680
683
  <zeroOrMore>
681
684
  <ref name="accesslocation"/>
682
685
  </zeroOrMore>
@@ -922,9 +925,29 @@
922
925
  <text/>
923
926
  </element>
924
927
  </define>
928
+ <define name="sizevalue">
929
+ <element name="value">
930
+ <attribute name="type"/>
931
+ <text/>
932
+ </element>
933
+ </define>
934
+ <define name="bibliographic_size">
935
+ <element name="size">
936
+ <oneOrMore>
937
+ <ref name="sizevalue"/>
938
+ </oneOrMore>
939
+ </element>
940
+ </define>
925
941
  <define name="extent">
926
942
  <element name="extent">
927
- <ref name="BibItemLocality"/>
943
+ <choice>
944
+ <zeroOrMore>
945
+ <ref name="locality"/>
946
+ </zeroOrMore>
947
+ <zeroOrMore>
948
+ <ref name="localityStack"/>
949
+ </zeroOrMore>
950
+ </choice>
928
951
  </element>
929
952
  </define>
930
953
  <define name="series">
@@ -46,7 +46,7 @@ module Metanorma
46
46
 
47
47
  part, subpart = node&.attr("partnumber")&.split(/-/)
48
48
  dn = add_id_parts(node.attr("docnumber"), part, subpart)
49
- dn = id_stage_prefix(dn, node, false)
49
+ dn = id_stage_prefix(dn, node)
50
50
  dn = id_edition_suffix(dn, node)
51
51
  xml.docidentifier dn, **attr_code(type: "ISO")
52
52
  end
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "2.0.5".freeze
3
+ VERSION = "2.0.8".freeze
4
4
  end
5
5
  end
6
6
 
@@ -859,7 +859,7 @@ RSpec.describe IsoDoc do
859
859
  <dd language='zh' script='Hans'>
860
860
  <preferred>
861
861
  <strong>&#x4EA7;&#x54C1;</strong>
862
- &#x3001;&#x3c;&#x5728;&#x53EF;&#x9760;&#x6027;&#x65B9;&#x9762;&#x3e;
862
+ , &#x3c;&#x5728;&#x53EF;&#x9760;&#x6027;&#x65B9;&#x9762;&#x3e;
863
863
  </preferred>
864
864
  </dd>
865
865
  </dl>
@@ -220,7 +220,7 @@ RSpec.describe IsoDoc::Iec do
220
220
  <note><name>NOTE</name><p>This is another annotation of document ISSN.</p></note>
221
221
  <bibitem id="ISO3696" type="standard">
222
222
  <title format="text/plain">Water for analytical laboratory use</title>
223
- <docidentifier type='metanorma-ordinal'>[1]</docidentifier>
223
+ <docidentifier type='metanorma-ordinal'>[3]</docidentifier>
224
224
  <docidentifier type="ISO">ISO 3696</docidentifier>
225
225
  <contributor>
226
226
  <role type="publisher"/>
@@ -235,7 +235,7 @@ RSpec.describe IsoDoc::Iec do
235
235
  </bibitem>
236
236
  <bibitem id="ref11">
237
237
  <title>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</title>
238
- <docidentifier type='metanorma-ordinal'>[2]</docidentifier>
238
+ <docidentifier type='metanorma-ordinal'>[4]</docidentifier>
239
239
  <docidentifier type="IETF">IETF RFC 10</docidentifier>
240
240
  </bibitem>
241
241
  <bibitem id="ref12">
@@ -337,7 +337,7 @@ RSpec.describe IsoDoc::Iec do
337
337
  </p>
338
338
  </div>
339
339
  <p id='ISO3696' class='Biblio'>
340
- [1]&#160; ISO 3696,
340
+ [3]&#160; ISO 3696,
341
341
  <i>Water for analytical laboratory use</i>
342
342
  </p>
343
343
  <p id='ref10' class='Biblio'>
@@ -354,7 +354,7 @@ RSpec.describe IsoDoc::Iec do
354
354
  )
355
355
  </p>
356
356
  <p id='ref11' class='Biblio'>
357
- [2]&#160; IETF RFC 10,
357
+ [4]&#160; IETF RFC 10,
358
358
  <i>Internet Calendaring and Scheduling Core Object Specification (iCalendar)</i>
359
359
  </p>
360
360
  <p id='ref12' class='Biblio'>
@@ -132,7 +132,7 @@ RSpec.describe Metanorma::Iec do
132
132
  <title>Terms and definitions</title>
133
133
  <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
134
134
  #{TERMS_BOILERPLATE}
135
- <term id="term-term1">
135
+ <term id="term-Term1">
136
136
  <preferred><expression><name>Term1</name></expression></preferred>
137
137
  <termnote id="_">
138
138
  <p id="_">This is a note</p>
@@ -254,7 +254,7 @@ RSpec.describe Metanorma::Iec do
254
254
  <title>Terms and definitions</title>
255
255
  <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
256
256
  #{TERMS_BOILERPLATE}
257
- <term id="term-term1">
257
+ <term id="term-Term1">
258
258
  <preferred><expression><name>Term1</name></expression></preferred>
259
259
  <termexample id="_">
260
260
  <p id="_">This is an example</p>
@@ -127,7 +127,7 @@ RSpec.describe Metanorma::Iec do
127
127
  <p id='_'>So am I</p>
128
128
  </li>
129
129
  </ul>
130
- <term id="term-time">
130
+ <term id="term-Time">
131
131
  <preferred><expression><name>Time</name></expression></preferred>
132
132
  <definition><verbal-definition><p id="_">This paragraph is extraneous</p></verbal-definition></definition>
133
133
  </term></terms>
@@ -164,7 +164,7 @@ RSpec.describe Metanorma::Iec do
164
164
  <title>Terms and definitions</title>
165
165
  <terms id='_' obligation='normative'>
166
166
  <title>General</title>
167
- <term id='term-term-1'>
167
+ <term id='term-Term-1'>
168
168
  <preferred><expression><name>Term 1</name></expression></preferred>
169
169
  </term>
170
170
  </terms>
@@ -1,12 +1,12 @@
1
1
  require "spec_helper"
2
2
 
3
3
  RSpec.describe Metanorma::Iec do
4
- before(:all) do
5
- @blank_hdr = blank_hdr_gen
6
- end
4
+ before(:all) do
5
+ @blank_hdr = blank_hdr_gen
6
+ end
7
7
 
8
8
  it "processes breaks" do
9
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
9
+ input = <<~INPUT
10
10
  #{ASCIIDOC_BLANK_HDR}
11
11
  Line break +
12
12
  line break
@@ -15,47 +15,56 @@ end
15
15
 
16
16
  <<<
17
17
  INPUT
18
- #{@blank_hdr}
19
- <sections><p id="_">Line break<br/>
20
- line break</p>
21
- <hr/>
22
- <pagebreak/></sections>
23
- </iec-standard>
18
+ output = <<~OUTPUT
19
+ #{@blank_hdr}
20
+ <sections><p id="_">Line break<br/>
21
+ line break</p>
22
+ <hr/>
23
+ <pagebreak/></sections>
24
+ </iec-standard>
24
25
  OUTPUT
26
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, OPTIONS))))
27
+ .to be_equivalent_to xmlpp(output)
25
28
  end
26
29
 
27
30
  it "processes links" do
28
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
31
+ input = <<~INPUT
29
32
  #{ASCIIDOC_BLANK_HDR}
30
33
  mailto:fred@example.com
31
34
  http://example.com[]
32
35
  http://example.com[Link]
33
36
  INPUT
34
- #{@blank_hdr}
35
- <sections>
36
- <p id="_">mailto:fred@example.com
37
- <link target="http://example.com"/>
38
- <link target="http://example.com">Link</link></p>
39
- </sections>
40
- </iec-standard>
37
+ output = <<~OUTPUT
38
+ #{@blank_hdr}
39
+ <sections>
40
+ <p id="_">mailto:fred@example.com
41
+ <link target="http://example.com"/>
42
+ <link target="http://example.com">Link</link></p>
43
+ </sections>
44
+ </iec-standard>
41
45
  OUTPUT
46
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, OPTIONS))))
47
+ .to be_equivalent_to xmlpp(output)
42
48
  end
43
49
 
44
- it "processes bookmarks" do
45
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
50
+ it "processes bookmarks" do
51
+ input = <<~INPUT
46
52
  #{ASCIIDOC_BLANK_HDR}
47
53
  Text [[bookmark]] Text
48
54
  INPUT
49
- #{@blank_hdr}
50
- <sections>
51
- <p id="_">Text <bookmark id="bookmark"/> Text</p>
52
- </sections>
53
- </iec-standard>
55
+ output = <<~OUTPUT
56
+ #{@blank_hdr}
57
+ <sections>
58
+ <p id="_">Text <bookmark id="bookmark"/> Text</p>
59
+ </sections>
60
+ </iec-standard>
54
61
  OUTPUT
55
- end
62
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, OPTIONS))))
63
+ .to be_equivalent_to xmlpp(output)
64
+ end
56
65
 
57
- it "processes crossreferences" do
58
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
66
+ it "processes crossreferences" do
67
+ input = <<~INPUT
59
68
  #{ASCIIDOC_BLANK_HDR}
60
69
  [[reference]]
61
70
  == Section
@@ -65,22 +74,25 @@ end
65
74
  Inline Reference with Text to <<reference,text>>
66
75
  Footnoted Reference with Text to <<reference,fn: text>>
67
76
  INPUT
68
- #{@blank_hdr}
69
- <sections>
70
- <clause id="reference" inline-header="false" obligation="normative">
71
- <title>Section</title>
72
- <p id="_">Inline Reference to <xref target="reference"/>
73
- Footnoted Reference to <xref target="reference"/>
74
- Inline Reference with Text to <xref target="reference">text</xref>
75
- Footnoted Reference with Text to <xref target="reference">text</xref></p>
76
- </clause>
77
- </sections>
78
- </iec-standard>
79
- OUTPUT
80
- end
77
+ output = <<~OUTPUT
78
+ #{@blank_hdr}
79
+ <sections>
80
+ <clause id="reference" inline-header="false" obligation="normative">
81
+ <title>Section</title>
82
+ <p id="_">Inline Reference to <xref target="reference"/>
83
+ Footnoted Reference to <xref target="reference"/>
84
+ Inline Reference with Text to <xref target="reference">text</xref>
85
+ Footnoted Reference with Text to <xref target="reference">text</xref></p>
86
+ </clause>
87
+ </sections>
88
+ </iec-standard>
89
+ OUTPUT
90
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, OPTIONS))))
91
+ .to be_equivalent_to xmlpp(output)
92
+ end
81
93
 
82
- it "processes bibliographic anchors" do
83
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
94
+ it "processes bibliographic anchors" do
95
+ input = <<~INPUT
84
96
  #{ASCIIDOC_BLANK_HDR}
85
97
  [bibliography]
86
98
  == Normative References
@@ -89,41 +101,45 @@ end
89
101
  * [[[ISO713]]] Reference
90
102
 
91
103
  INPUT
92
- #{@blank_hdr}
93
- <sections>
104
+ output = <<~OUTPUT
105
+ #{@blank_hdr}
106
+ <sections>
94
107
 
95
- </sections><bibliography><references id="_" obligation="informative" normative="true">
96
- <title>Normative references</title>
97
- <p id="_">The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
98
- <bibitem id="ISO712">
99
- <formattedref format="application/x-isodoc+xml">Reference</formattedref>
100
- <docidentifier>x</docidentifier>
101
- </bibitem>
102
- <bibitem id="ISO713">
103
- <formattedref format="application/x-isodoc+xml">Reference</formattedref>
104
- <docidentifier>ISO713</docidentifier>
105
- <docnumber>713</docnumber>
106
- </bibitem>
107
- </references>
108
- </bibliography>
109
- </iec-standard>
108
+ </sections><bibliography><references id="_" obligation="informative" normative="true">
109
+ <title>Normative references</title>
110
+ <p id="_">The following documents are referred to in the text in such a way that some or all of their content constitutes requirements of this document. For dated references, only the edition cited applies. For undated references, the latest edition of the referenced document (including any amendments) applies.</p>
111
+ <bibitem id="ISO712">
112
+ <formattedref format="application/x-isodoc+xml">Reference</formattedref>
113
+ <docidentifier>x</docidentifier>
114
+ </bibitem>
115
+ <bibitem id="ISO713">
116
+ <formattedref format="application/x-isodoc+xml">Reference</formattedref>
117
+ <docidentifier>ISO713</docidentifier>
118
+ <docnumber>713</docnumber>
119
+ </bibitem>
120
+ </references>
121
+ </bibliography>
122
+ </iec-standard>
110
123
  OUTPUT
124
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, OPTIONS))))
125
+ .to be_equivalent_to xmlpp(output)
111
126
  end
112
127
 
113
128
  it "processes footnotes" do
114
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
129
+ input = <<~INPUT
115
130
  #{ASCIIDOC_BLANK_HDR}
116
131
  Hello!footnote:[Footnote text]
117
132
  INPUT
118
- #{@blank_hdr}
119
- <sections>
120
- <p id="_">Hello!<fn reference="1">
121
- <p id="_">Footnote text</p>
122
- </fn></p>
123
- </sections>
124
- </iec-standard>
133
+ output = <<~OUTPUT
134
+ #{@blank_hdr}
135
+ <sections>
136
+ <p id="_">Hello!<fn reference="1">
137
+ <p id="_">Footnote text</p>
138
+ </fn></p>
139
+ </sections>
140
+ </iec-standard>
125
141
  OUTPUT
142
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, OPTIONS))))
143
+ .to be_equivalent_to xmlpp(output)
126
144
  end
127
-
128
-
129
145
  end
@@ -1,12 +1,12 @@
1
1
  require "spec_helper"
2
2
 
3
3
  RSpec.describe Metanorma::Iec do
4
- before(:all) do
5
- @blank_hdr = blank_hdr_gen
6
- end
4
+ before(:all) do
5
+ @blank_hdr = blank_hdr_gen
6
+ end
7
7
 
8
8
  it "processes sections" do
9
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
9
+ input = <<~INPUT
10
10
  #{ASCIIDOC_BLANK_HDR}
11
11
  .Foreword
12
12
 
@@ -56,69 +56,72 @@ end
56
56
 
57
57
  === Bibliography Subsection
58
58
  INPUT
59
- #{@blank_hdr}
60
- <preface><foreword id="_" obligation="informative">
61
- <title>FOREWORD</title>
62
- <p id="_">Text</p>
63
- </foreword><introduction id="_" obligation="informative">
64
- <title>INTRODUCTION</title><clause id="_" inline-header="false" obligation="informative">
65
- <title>Introduction Subsection</title>
66
- </clause>
67
- </introduction></preface><sections>
68
- <clause id="_" obligation="normative" type="scope" inline-header='false'>
69
- <title>Scope</title>
70
- <p id="_">Text</p>
71
- </clause>
72
-
73
- <terms id="_" obligation="normative">
74
- <title>Terms and definitions</title>
75
- <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
76
- #{TERMS_BOILERPLATE}
77
- <term id="term-term1">
78
- <preferred><expression><name>Term1</name></expression></preferred>
79
- </term>
80
- </terms>
81
- <clause id="_" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="_" obligation="normative">
82
- <title>Normal Terms</title>
83
- <term id="term-term2">
84
- <preferred><expression><name>Term2</name></expression></preferred>
85
- </term>
86
- </terms>
87
- <definitions id="_" obligation="normative"><title>Symbols and abbreviated terms</title></definitions></clause>
88
- <definitions id="_" obligation="normative"><title>Symbols and abbreviated terms</title></definitions>
89
- <clause id="_" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="_" inline-header="false" obligation="normative">
90
- <title>Introduction</title>
91
- </clause>
92
- <clause id="_" inline-header="false" obligation="normative">
93
- <title>Clause 4.2</title>
94
- </clause></clause>
95
- <clause id="_" inline-header="false" obligation="normative">
96
- <title>Terms and Definitions</title>
97
- </clause>
98
-
99
-
100
- </sections><annex id="_" inline-header="false" obligation="normative">
101
- <title>Annex</title>
102
- <clause id="_" inline-header="false" obligation="normative">
103
- <title>Annex A.1</title>
104
- </clause>
105
- <appendix id="_" inline-header="false" obligation="normative">
106
- <title>Appendix 1</title>
107
- </appendix></annex><bibliography><references id="_" obligation="informative" normative="true">
108
- <title>Normative references</title><p id="_">There are no normative references in this document.</p>
109
- </references><clause id="_" obligation="informative">
110
- <title>Bibliography</title>
111
- <references id="_" obligation="informative" normative="false">
112
- <title>Bibliography Subsection</title>
113
- </references>
114
- </clause>
115
- </bibliography>
116
- </iec-standard>
59
+ output = <<~OUTPUT
60
+ #{@blank_hdr}
61
+ <preface><foreword id="_" obligation="informative">
62
+ <title>FOREWORD</title>
63
+ <p id="_">Text</p>
64
+ </foreword><introduction id="_" obligation="informative">
65
+ <title>INTRODUCTION</title><clause id="_" inline-header="false" obligation="informative">
66
+ <title>Introduction Subsection</title>
67
+ </clause>
68
+ </introduction></preface><sections>
69
+ <clause id="_" obligation="normative" type="scope" inline-header='false'>
70
+ <title>Scope</title>
71
+ <p id="_">Text</p>
72
+ </clause>
73
+
74
+ <terms id="_" obligation="normative">
75
+ <title>Terms and definitions</title>
76
+ <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
77
+ #{TERMS_BOILERPLATE}
78
+ <term id="term-Term1">
79
+ <preferred><expression><name>Term1</name></expression></preferred>
80
+ </term>
81
+ </terms>
82
+ <clause id="_" obligation="normative"><title>Terms, definitions, symbols and abbreviated terms</title><terms id="_" obligation="normative">
83
+ <title>Normal Terms</title>
84
+ <term id="term-Term2">
85
+ <preferred><expression><name>Term2</name></expression></preferred>
86
+ </term>
87
+ </terms>
88
+ <definitions id="_" obligation="normative"><title>Symbols and abbreviated terms</title></definitions></clause>
89
+ <definitions id="_" obligation="normative"><title>Symbols and abbreviated terms</title></definitions>
90
+ <clause id="_" inline-header="false" obligation="normative"><title>Clause 4</title><clause id="_" inline-header="false" obligation="normative">
91
+ <title>Introduction</title>
92
+ </clause>
93
+ <clause id="_" inline-header="false" obligation="normative">
94
+ <title>Clause 4.2</title>
95
+ </clause></clause>
96
+ <clause id="_" inline-header="false" obligation="normative">
97
+ <title>Terms and Definitions</title>
98
+ </clause>
99
+
100
+
101
+ </sections><annex id="_" inline-header="false" obligation="normative">
102
+ <title>Annex</title>
103
+ <clause id="_" inline-header="false" obligation="normative">
104
+ <title>Annex A.1</title>
105
+ </clause>
106
+ <appendix id="_" inline-header="false" obligation="normative">
107
+ <title>Appendix 1</title>
108
+ </appendix></annex><bibliography><references id="_" obligation="informative" normative="true">
109
+ <title>Normative references</title><p id="_">There are no normative references in this document.</p>
110
+ </references><clause id="_" obligation="informative">
111
+ <title>Bibliography</title>
112
+ <references id="_" obligation="informative" normative="false">
113
+ <title>Bibliography Subsection</title>
114
+ </references>
115
+ </clause>
116
+ </bibliography>
117
+ </iec-standard>
117
118
  OUTPUT
119
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
120
+ .to be_equivalent_to xmlpp(output)
118
121
  end
119
122
 
120
123
  it "processes sections with title attributes" do
121
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
124
+ input = <<~INPUT
122
125
  #{ASCIIDOC_BLANK_HDR}
123
126
  .Foreword
124
127
 
@@ -174,84 +177,86 @@ end
174
177
 
175
178
  === Bibliography Subsection
176
179
  INPUT
177
- #{@blank_hdr}
178
- <preface>
179
- <foreword id="_" obligation="informative">
180
- <title>FOREWORD</title>
181
- <p id="_">Text</p>
182
- </foreword>
183
- <introduction id="_" obligation="informative">
184
- <title>INTRODUCTION</title><clause id="_" inline-header="false" obligation="informative">
185
- <title>Introduction Subsection</title>
186
- </clause>
187
- </introduction>
188
- </preface>
189
- <sections>
190
- <clause id="_" obligation="normative" type="scope" inline-header='false'>
191
- <title>Scope</title>
192
- <p id="_">Text</p>
193
- </clause>
194
-
195
- <terms id="_" obligation="normative">
196
- <title>Terms and definitions</title>
197
- <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
198
- #{TERMS_BOILERPLATE}
199
- <term id="term-term1">
200
- <preferred><expression><name>Term1</name></expression></preferred>
201
- </term>
202
- </terms>
203
- <clause id='_' obligation='normative'>
204
- <title>Terms, definitions, symbols and abbreviated terms</title>
205
- <terms id='_' obligation='normative'>
206
- <title>Normal Terms</title>
207
- <term id='term-term2'>
208
- <preferred><expression><name>Term2</name></expression></preferred>
209
- </term>
210
- </terms>
211
- <definitions id='_' obligation="normative">
212
- <title>Symbols and abbreviated terms</title>
213
- </definitions>
214
- </clause>
215
- <definitions id='_' obligation="normative">
216
- <title>Symbols and abbreviated terms</title>
217
- </definitions>
218
- <clause id='_' inline-header='false' obligation='normative'>
219
- <title>Clause 4</title>
220
- <clause id='_' inline-header='false' obligation='normative'>
221
- <title>Introduction</title>
180
+ output = <<~OUTPUT
181
+ #{@blank_hdr}
182
+ <preface>
183
+ <foreword id="_" obligation="informative">
184
+ <title>FOREWORD</title>
185
+ <p id="_">Text</p>
186
+ </foreword>
187
+ <introduction id="_" obligation="informative">
188
+ <title>INTRODUCTION</title><clause id="_" inline-header="false" obligation="informative">
189
+ <title>Introduction Subsection</title>
222
190
  </clause>
223
- <clause id='_' inline-header='false' obligation='normative'>
224
- <title>Clause 4.2</title>
191
+ </introduction>
192
+ </preface>
193
+ <sections>
194
+ <clause id="_" obligation="normative" type="scope" inline-header='false'>
195
+ <title>Scope</title>
196
+ <p id="_">Text</p>
225
197
  </clause>
226
- </clause>
227
- </sections>
228
- <annex id='_' inline-header='false' obligation='normative'>
229
- <title>Annex</title>
230
- <clause id='_' inline-header='false' obligation='normative'>
231
- <title>Annex A.1</title>
232
- </clause>
233
- <appendix id='_' inline-header='false' obligation='normative'>
234
- <title>Appendx 1</title>
235
- </appendix>
236
- </annex>
237
- <bibliography>
238
- <references id='_' obligation='informative' normative="true">
239
- <title>Normative references</title>
240
- <p id="_">There are no normative references in this document.</p>
241
- </references>
242
- <clause id='_' obligation='informative'>
243
- <title>Bibliography</title>
244
- <references id='_' obligation='informative' normative="false">
245
- <title>Bibliography Subsection</title>
246
- </references>
247
- </clause>
248
- </bibliography>
249
- </iec-standard>
198
+ <terms id="_" obligation="normative">
199
+ <title>Terms and definitions</title>
200
+ <p id="_">For the purposes of this document, the following terms and definitions apply.</p>
201
+ #{TERMS_BOILERPLATE}
202
+ <term id="term-Term1">
203
+ <preferred><expression><name>Term1</name></expression></preferred>
204
+ </term>
205
+ </terms>
206
+ <clause id='_' obligation='normative'>
207
+ <title>Terms, definitions, symbols and abbreviated terms</title>
208
+ <terms id='_' obligation='normative'>
209
+ <title>Normal Terms</title>
210
+ <term id='term-Term2'>
211
+ <preferred><expression><name>Term2</name></expression></preferred>
212
+ </term>
213
+ </terms>
214
+ <definitions id='_' obligation="normative">
215
+ <title>Symbols and abbreviated terms</title>
216
+ </definitions>
217
+ </clause>
218
+ <definitions id='_' obligation="normative">
219
+ <title>Symbols and abbreviated terms</title>
220
+ </definitions>
221
+ <clause id='_' inline-header='false' obligation='normative'>
222
+ <title>Clause 4</title>
223
+ <clause id='_' inline-header='false' obligation='normative'>
224
+ <title>Introduction</title>
225
+ </clause>
226
+ <clause id='_' inline-header='false' obligation='normative'>
227
+ <title>Clause 4.2</title>
228
+ </clause>
229
+ </clause>
230
+ </sections>
231
+ <annex id='_' inline-header='false' obligation='normative'>
232
+ <title>Annex</title>
233
+ <clause id='_' inline-header='false' obligation='normative'>
234
+ <title>Annex A.1</title>
235
+ </clause>
236
+ <appendix id='_' inline-header='false' obligation='normative'>
237
+ <title>Appendx 1</title>
238
+ </appendix>
239
+ </annex>
240
+ <bibliography>
241
+ <references id='_' obligation='informative' normative="true">
242
+ <title>Normative references</title>
243
+ <p id="_">There are no normative references in this document.</p>
244
+ </references>
245
+ <clause id='_' obligation='informative'>
246
+ <title>Bibliography</title>
247
+ <references id='_' obligation='informative' normative="false">
248
+ <title>Bibliography Subsection</title>
249
+ </references>
250
+ </clause>
251
+ </bibliography>
252
+ </iec-standard>
250
253
  OUTPUT
254
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
255
+ .to be_equivalent_to xmlpp(output)
251
256
  end
252
257
 
253
258
  it "processes section obligations" do
254
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
259
+ input = <<~INPUT
255
260
  #{ASCIIDOC_BLANK_HDR}
256
261
  [obligation=informative]
257
262
  == Clause 1
@@ -263,26 +268,29 @@ end
263
268
 
264
269
  [appendix,obligation=informative]
265
270
  == Annex
266
- INPUT
267
- #{@blank_hdr}
268
- <sections><clause id="_" inline-header="false" obligation="informative">
269
- <title>Clause 1</title>
270
- <clause id="_" inline-header="false" obligation="informative">
271
- <title>Clause 1a</title>
272
- </clause>
273
- </clause>
274
- <clause id="_" inline-header="false" obligation="normative">
275
- <title>Clause 2</title>
276
- </clause>
277
- </sections><annex id="_" inline-header="false" obligation="informative">
278
- <title>Annex</title>
279
- </annex>
280
- </iec-standard>
281
- OUTPUT
271
+ INPUT
272
+ output = <<~OUTPUT
273
+ #{@blank_hdr}
274
+ <sections><clause id="_" inline-header="false" obligation="informative">
275
+ <title>Clause 1</title>
276
+ <clause id="_" inline-header="false" obligation="informative">
277
+ <title>Clause 1a</title>
278
+ </clause>
279
+ </clause>
280
+ <clause id="_" inline-header="false" obligation="normative">
281
+ <title>Clause 2</title>
282
+ </clause>
283
+ </sections><annex id="_" inline-header="false" obligation="informative">
284
+ <title>Annex</title>
285
+ </annex>
286
+ </iec-standard>
287
+ OUTPUT
288
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
289
+ .to be_equivalent_to xmlpp(output)
282
290
  end
283
291
 
284
- it "processes inline headers" do
285
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
292
+ it "processes inline headers" do
293
+ input = <<~INPUT
286
294
  #{ASCIIDOC_BLANK_HDR}
287
295
  == Clause 1
288
296
 
@@ -294,42 +302,47 @@ end
294
302
 
295
303
  [%inline-header]
296
304
  === Clause Aa
297
- INPUT
298
- #{@blank_hdr}
299
- <sections><clause id="_" inline-header="false" obligation="normative">
300
- <title>Clause 1</title>
301
- <clause id="_" inline-header="true" obligation="normative">
302
- <title>Clause 1a</title>
303
- </clause>
304
- </clause>
305
- </sections><annex id="_" inline-header="false" obligation="normative">
306
- <title>Annex A</title>
307
- <clause id="_" inline-header="true" obligation="normative">
308
- <title>Clause Aa</title>
309
- </clause>
310
- </annex>
311
- </iec-standard>
312
- OUTPUT
313
- end
305
+ INPUT
306
+ output = <<~OUTPUT
307
+ #{@blank_hdr}
308
+ <sections><clause id="_" inline-header="false" obligation="normative">
309
+ <title>Clause 1</title>
310
+ <clause id="_" inline-header="true" obligation="normative">
311
+ <title>Clause 1a</title>
312
+ </clause>
313
+ </clause>
314
+ </sections><annex id="_" inline-header="false" obligation="normative">
315
+ <title>Annex A</title>
316
+ <clause id="_" inline-header="true" obligation="normative">
317
+ <title>Clause Aa</title>
318
+ </clause>
319
+ </annex>
320
+ </iec-standard>
321
+ OUTPUT
322
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
323
+ .to be_equivalent_to xmlpp(output)
324
+ end
314
325
 
315
326
  it "processes blank headers" do
316
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
327
+ input = <<~INPUT
317
328
  #{ASCIIDOC_BLANK_HDR}
318
329
  == Clause 1
319
330
 
320
331
  === {blank}
321
332
 
322
- INPUT
323
- #{@blank_hdr}
324
- <sections>
325
- <clause id="_" inline-header="false" obligation="normative">
326
- <title>Clause 1</title>
327
- <clause id="_" inline-header="false" obligation="normative">
328
- </clause>
329
- </clause>
330
- </sections>
331
- </iec-standard>
332
- OUTPUT
333
+ INPUT
334
+ output = <<~OUTPUT
335
+ #{@blank_hdr}
336
+ <sections>
337
+ <clause id="_" inline-header="false" obligation="normative">
338
+ <title>Clause 1</title>
339
+ <clause id="_" inline-header="false" obligation="normative">
340
+ </clause>
341
+ </clause>
342
+ </sections>
343
+ </iec-standard>
344
+ OUTPUT
345
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
346
+ .to be_equivalent_to xmlpp(output)
333
347
  end
334
-
335
348
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iec
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.5
4
+ version: 2.0.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-03-07 00:00:00.000000000 Z
11
+ date: 2022-04-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-iso
@@ -298,7 +298,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
298
298
  - !ruby/object:Gem::Version
299
299
  version: '0'
300
300
  requirements: []
301
- rubygems_version: 3.2.32
301
+ rubygems_version: 3.3.9
302
302
  signing_key:
303
303
  specification_version: 4
304
304
  summary: metanorma-iec lets you write IEC standards in AsciiDoc.