metanorma-iec 1.3.2 → 1.3.3

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: b4e58e3044f0a6f4fd01e08d6fc4e19b4caaa04fe33a295057a96fea097d13c6
4
- data.tar.gz: 90a31ef3903fb1d5a75a3ee906379d6e31911a983853298ab25565101b605013
3
+ metadata.gz: 4a24900a199a0791b4bb2358674e8b34b109c9d8953b656f0d6662c9f8fd0466
4
+ data.tar.gz: b5db833a6cc328ff262ae38411438ca4549d36dacd74bb7ec14695183b41afec
5
5
  SHA512:
6
- metadata.gz: d454b76d5ed87f9cb9c3cfb09ee02777f55b608eacc002ac8b4fccbdf1777b7fb7f987182c5293d5f4f78fd8ce57c0bf7e1cedef8517f826bc43c6217a606d43
7
- data.tar.gz: ca98d72d39fd8088c1d5daf366748b89807929b05d7e406050b6fda4a688916321334b405ac03a01d198f6f35a7678bc167dbada7cbb944cb5eb40da6bea0397
6
+ metadata.gz: 7c7741d485f92f29adc57dfac10b8d842db1fab885f5f220fdcd216644ee78831ea9feee2fa3d028f612e78e44c1bccf074aaeed96fcf237462e4ef0c7621364
7
+ data.tar.gz: 94b6790578314e2bf8fc68c77241a14b4ac68f8bbffa69706593f6345b82ccc9766ac6b80f7931c97c7ed3c5003bd309644863706eef6308ac8cdfe08b8e8852
@@ -787,6 +787,7 @@
787
787
  <value>adapted</value>
788
788
  <value>vote-started</value>
789
789
  <value>vote-ended</value>
790
+ <value>announced</value>
790
791
  </choice>
791
792
  </define>
792
793
  <define name="bdate">
@@ -1191,9 +1191,7 @@
1191
1191
  </define>
1192
1192
  <define name="IsoWorkgroup">
1193
1193
  <optional>
1194
- <attribute name="number">
1195
- <data type="int"/>
1196
- </attribute>
1194
+ <attribute name="number"/>
1197
1195
  </optional>
1198
1196
  <optional>
1199
1197
  <attribute name="type"/>
@@ -2611,6 +2611,9 @@
2611
2611
  <title-continued lang="en">(continued)</title-continued>
2612
2612
  <title-continued lang="fr">(continué)</title-continued>
2613
2613
 
2614
+ </xsl:variable><xsl:variable name="bibdata">
2615
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
2616
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
2614
2617
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
2615
2618
  <xsl:param name="name"/>
2616
2619
  <xsl:param name="lang"/>
@@ -2641,6 +2644,7 @@
2641
2644
 
2642
2645
 
2643
2646
 
2647
+
2644
2648
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
2645
2649
  <xsl:attribute name="white-space">pre</xsl:attribute>
2646
2650
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -2751,6 +2755,7 @@
2751
2755
 
2752
2756
  </xsl:attribute-set><xsl:attribute-set name="table-name-style">
2753
2757
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2758
+
2754
2759
 
2755
2760
 
2756
2761
 
@@ -2787,6 +2792,7 @@
2787
2792
 
2788
2793
 
2789
2794
 
2795
+
2790
2796
  </xsl:attribute-set><xsl:attribute-set name="eref-style">
2791
2797
 
2792
2798
 
@@ -2797,6 +2803,7 @@
2797
2803
 
2798
2804
 
2799
2805
 
2806
+
2800
2807
  <xsl:attribute name="font-size">8pt</xsl:attribute>
2801
2808
  <xsl:attribute name="margin-top">5pt</xsl:attribute>
2802
2809
  <xsl:attribute name="margin-bottom">9pt</xsl:attribute>
@@ -2816,6 +2823,7 @@
2816
2823
 
2817
2824
 
2818
2825
 
2826
+
2819
2827
  <xsl:attribute name="padding-right">6mm</xsl:attribute>
2820
2828
 
2821
2829
 
@@ -2845,6 +2853,7 @@
2845
2853
  </xsl:attribute-set><xsl:attribute-set name="termnote-style">
2846
2854
 
2847
2855
 
2856
+
2848
2857
  <xsl:attribute name="font-size">8pt</xsl:attribute>
2849
2858
  <xsl:attribute name="margin-top">5pt</xsl:attribute>
2850
2859
  <xsl:attribute name="margin-bottom">5pt</xsl:attribute>
@@ -2853,6 +2862,7 @@
2853
2862
 
2854
2863
 
2855
2864
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
2865
+
2856
2866
 
2857
2867
 
2858
2868
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
@@ -2880,6 +2890,7 @@
2880
2890
  </xsl:attribute-set><xsl:attribute-set name="termsource-style">
2881
2891
 
2882
2892
 
2893
+
2883
2894
  <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
2884
2895
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
2885
2896
 
@@ -2894,6 +2905,7 @@
2894
2905
 
2895
2906
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
2896
2907
 
2908
+
2897
2909
 
2898
2910
 
2899
2911
 
@@ -2926,12 +2938,14 @@
2926
2938
 
2927
2939
 
2928
2940
 
2941
+
2929
2942
  </xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
2930
2943
 
2931
2944
  </xsl:attribute-set><xsl:attribute-set name="image-graphic-style">
2932
2945
 
2933
2946
 
2934
2947
 
2948
+
2935
2949
  <xsl:attribute name="width">75%</xsl:attribute>
2936
2950
  <xsl:attribute name="content-height">scale-to-fit</xsl:attribute>
2937
2951
  <xsl:attribute name="scaling">uniform</xsl:attribute>
@@ -2967,6 +2981,7 @@
2967
2981
 
2968
2982
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2969
2983
 
2984
+
2970
2985
  </xsl:attribute-set><xsl:variable name="color-added-text">
2971
2986
  <xsl:text>rgb(0, 255, 0)</xsl:text>
2972
2987
  </xsl:variable><xsl:attribute-set name="add-style">
@@ -3106,6 +3121,7 @@
3106
3121
 
3107
3122
 
3108
3123
 
3124
+
3109
3125
  <xsl:attribute name="font-size">8pt</xsl:attribute>
3110
3126
  <xsl:attribute name="space-after">12pt</xsl:attribute>
3111
3127
  <xsl:if test="ancestor::*[local-name() = 'preface']">
@@ -3123,6 +3139,8 @@
3123
3139
 
3124
3140
 
3125
3141
 
3142
+
3143
+
3126
3144
  <xsl:variable name="table_width">
3127
3145
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
3128
3146
  100%
@@ -3138,6 +3156,7 @@
3138
3156
 
3139
3157
 
3140
3158
 
3159
+
3141
3160
  <attribute name="border">0.5pt solid black</attribute>
3142
3161
 
3143
3162
 
@@ -3284,11 +3303,22 @@
3284
3303
  </xsl:choose>
3285
3304
 
3286
3305
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
3306
+ <xsl:param name="continued"/>
3287
3307
  <xsl:if test="normalize-space() != ''">
3288
3308
  <fo:block xsl:use-attribute-sets="table-name-style">
3289
3309
 
3290
3310
 
3291
- <xsl:apply-templates/>
3311
+ <xsl:choose>
3312
+ <xsl:when test="$continued = 'true'">
3313
+ <!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
3314
+
3315
+ </xsl:when>
3316
+ <xsl:otherwise>
3317
+ <xsl:apply-templates/>
3318
+ </xsl:otherwise>
3319
+ </xsl:choose>
3320
+
3321
+
3292
3322
  </fo:block>
3293
3323
  </xsl:if>
3294
3324
  </xsl:template><xsl:template name="calculate-columns-numbers">
@@ -3428,18 +3458,18 @@
3428
3458
  <xsl:apply-templates/>
3429
3459
  </fo:table-header>
3430
3460
  </xsl:template><xsl:template name="table-header-title">
3431
- <xsl:param name="cols-count"/>
3461
+ <xsl:param name="cols-count"/>
3432
3462
  <!-- row for title -->
3433
3463
  <fo:table-row>
3434
3464
  <fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black">
3435
- <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
3465
+
3466
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
3467
+ <xsl:with-param name="continued">true</xsl:with-param>
3468
+ </xsl:apply-templates>
3436
3469
  <xsl:for-each select="ancestor::*[local-name()='table'][1]">
3437
3470
  <xsl:call-template name="fn_name_display"/>
3438
- </xsl:for-each>
3439
- <fo:block text-align="right" font-style="italic">
3440
- <xsl:text> </xsl:text>
3441
- <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
3442
- </fo:block>
3471
+ </xsl:for-each>
3472
+
3443
3473
  </fo:table-cell>
3444
3474
  </fo:table-row>
3445
3475
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
@@ -3683,6 +3713,7 @@
3683
3713
 
3684
3714
 
3685
3715
 
3716
+
3686
3717
  <xsl:attribute name="border-top">solid black 0.5pt</xsl:attribute>
3687
3718
  <xsl:attribute name="border-bottom">solid black 0.5pt</xsl:attribute>
3688
3719
 
@@ -3717,6 +3748,7 @@
3717
3748
  </xsl:choose>
3718
3749
  </xsl:attribute>
3719
3750
 
3751
+
3720
3752
  <xsl:attribute name="padding-top">1mm</xsl:attribute>
3721
3753
 
3722
3754
 
@@ -4457,6 +4489,7 @@
4457
4489
 
4458
4490
 
4459
4491
 
4492
+
4460
4493
 
4461
4494
  </xsl:variable>
4462
4495
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -4838,11 +4871,15 @@
4838
4871
  </xsl:apply-templates>
4839
4872
  </xsl:template><xsl:template name="getLang">
4840
4873
  <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4874
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4841
4875
  <xsl:variable name="language">
4842
4876
  <xsl:choose>
4843
4877
  <xsl:when test="$language_current != ''">
4844
4878
  <xsl:value-of select="$language_current"/>
4845
4879
  </xsl:when>
4880
+ <xsl:when test="$language_current_2 != ''">
4881
+ <xsl:value-of select="$language_current_2"/>
4882
+ </xsl:when>
4846
4883
  <xsl:otherwise>
4847
4884
  <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
4848
4885
  </xsl:otherwise>
@@ -5059,6 +5096,7 @@
5059
5096
 
5060
5097
 
5061
5098
  <fo:inline xsl:use-attribute-sets="note-name-style">
5099
+
5062
5100
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
5063
5101
  </fo:inline>
5064
5102
  <xsl:apply-templates/>
@@ -5085,6 +5123,7 @@
5085
5123
  </xsl:template><xsl:template match="*[local-name() = 'termnote']">
5086
5124
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
5087
5125
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
5126
+
5088
5127
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
5089
5128
  </fo:inline>
5090
5129
  <xsl:apply-templates/>
@@ -5164,7 +5203,10 @@
5164
5203
  <xsl:for-each select="*[local-name() = 'note']">
5165
5204
  <xsl:call-template name="note"/>
5166
5205
  </xsl:for-each>
5167
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
5206
+
5207
+
5208
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
5209
+
5168
5210
  </fo:block-container>
5169
5211
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
5170
5212
  <fo:block id="{@id}">
@@ -5283,15 +5325,15 @@
5283
5325
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
5284
5326
  <xsl:apply-templates mode="bookmarks"/>
5285
5327
  <xsl:text> </xsl:text>
5286
- </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
5328
+ </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2">
5287
5329
  <xsl:value-of select="."/>
5288
- </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
5330
+ </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
5289
5331
  <xsl:value-of select="."/>
5290
5332
  </xsl:template><xsl:template match="node()" mode="contents">
5291
5333
  <xsl:apply-templates mode="contents"/>
5292
5334
  </xsl:template><xsl:template match="node()" mode="bookmarks">
5293
5335
  <xsl:apply-templates mode="bookmarks"/>
5294
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
5336
+ </xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
5295
5337
  <xsl:apply-templates select="."/>
5296
5338
  </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
5297
5339
  <xsl:apply-templates mode="bookmarks"/>
@@ -5490,6 +5532,8 @@
5490
5532
  </fo:list-item-body>
5491
5533
  </fo:list-item>
5492
5534
  </fo:list-block>
5535
+ </xsl:template><xsl:template name="extractSection">
5536
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
5493
5537
  </xsl:template><xsl:template name="extractTitle">
5494
5538
  <xsl:choose>
5495
5539
  <xsl:when test="*[local-name() = 'tab']">
@@ -5537,6 +5581,7 @@
5537
5581
 
5538
5582
 
5539
5583
 
5584
+
5540
5585
 
5541
5586
 
5542
5587
 
@@ -5859,7 +5904,7 @@
5859
5904
  </fo:inline>
5860
5905
  </xsl:otherwise>
5861
5906
  </xsl:choose>
5862
- </xsl:template><xsl:template match="*[local-name() = 'termsource']">
5907
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
5863
5908
  <fo:block xsl:use-attribute-sets="termsource-style">
5864
5909
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
5865
5910
  <xsl:variable name="termsource_text">
@@ -5868,13 +5913,15 @@
5868
5913
 
5869
5914
  <xsl:choose>
5870
5915
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
5871
- <xsl:apply-templates/>
5916
+ <!-- <xsl:apply-templates /> -->
5917
+ <xsl:copy-of select="$termsource_text"/>
5872
5918
  </xsl:when>
5873
5919
  <xsl:otherwise>
5874
5920
 
5875
5921
  <xsl:text>[</xsl:text>
5876
5922
 
5877
- <xsl:apply-templates/>
5923
+ <!-- <xsl:apply-templates /> -->
5924
+ <xsl:copy-of select="$termsource_text"/>
5878
5925
 
5879
5926
  <xsl:text>]</xsl:text>
5880
5927
 
@@ -5885,14 +5932,20 @@
5885
5932
  <xsl:if test="normalize-space() != ''">
5886
5933
  <xsl:value-of select="."/>
5887
5934
  </xsl:if>
5888
- </xsl:template><xsl:template match="*[local-name() = 'origin']">
5935
+ </xsl:template><xsl:variable name="localized.source">
5936
+ <xsl:call-template name="getLocalizedString">
5937
+ <xsl:with-param name="key">source</xsl:with-param>
5938
+ </xsl:call-template>
5939
+ </xsl:variable><xsl:template match="*[local-name() = 'origin']">
5889
5940
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
5941
+ <xsl:if test="normalize-space(@citeas) = ''">
5942
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
5943
+ </xsl:if>
5890
5944
 
5891
5945
  <fo:inline>
5892
5946
 
5893
5947
 
5894
5948
 
5895
-
5896
5949
  <xsl:call-template name="getTitle">
5897
5950
  <xsl:with-param name="name" select="'title-source'"/>
5898
5951
  </xsl:call-template>
@@ -6103,7 +6156,6 @@
6103
6156
 
6104
6157
 
6105
6158
 
6106
-
6107
6159
  <xsl:apply-templates/>
6108
6160
  </fo:block>
6109
6161
 
@@ -6146,7 +6198,7 @@
6146
6198
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
6147
6199
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
6148
6200
  <xsl:choose>
6149
- <xsl:when test="parent::*[local-name() = 'note']">
6201
+ <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
6150
6202
  <fo:block-container>
6151
6203
  <xsl:attribute name="margin-left">
6152
6204
  <xsl:choose>
@@ -6156,6 +6208,7 @@
6156
6208
  </xsl:attribute>
6157
6209
 
6158
6210
 
6211
+
6159
6212
  <fo:block-container margin-left="0mm">
6160
6213
  <fo:block>
6161
6214
  <xsl:apply-templates select="." mode="ul_ol"/>
@@ -6357,6 +6410,10 @@
6357
6410
 
6358
6411
 
6359
6412
 
6413
+
6414
+
6415
+
6416
+
6360
6417
  </xsl:template><xsl:template name="processBibitemDocId">
6361
6418
  <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
6362
6419
  <xsl:choose>
@@ -6740,6 +6797,7 @@
6740
6797
  <xsl:variable name="XSLNS">
6741
6798
 
6742
6799
 
6800
+
6743
6801
  <xsl:value-of select="document('')//*/namespace::iec"/>
6744
6802
 
6745
6803
 
@@ -6808,13 +6866,18 @@
6808
6866
  </xsl:call-template>
6809
6867
  </xsl:if>
6810
6868
  </xsl:template><xsl:template name="getLocalizedString">
6811
- <xsl:param name="key"/>
6869
+ <xsl:param name="key"/>
6812
6870
 
6813
6871
  <xsl:variable name="curr_lang">
6814
6872
  <xsl:call-template name="getLang"/>
6815
6873
  </xsl:variable>
6816
6874
 
6875
+ <xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
6876
+
6817
6877
  <xsl:choose>
6878
+ <xsl:when test="$data_value != ''">
6879
+ <xsl:value-of select="$data_value"/>
6880
+ </xsl:when>
6818
6881
  <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
6819
6882
  <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
6820
6883
  </xsl:when>
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "1.3.2".freeze
3
+ VERSION = "1.3.3".freeze
4
4
  end
5
5
  end
6
6
 
@@ -1,6 +1,8 @@
1
1
  require "spec_helper"
2
2
  require "fileutils"
3
3
 
4
+ OPTIONS = [backend: :iec, header_footer: true].freeze
5
+
4
6
  RSpec.describe Asciidoctor::Iec do
5
7
  before(:all) do
6
8
  @blank_hdr = blank_hdr_gen
@@ -10,42 +12,37 @@ RSpec.describe Asciidoctor::Iec do
10
12
  expect(Metanorma::Iec::VERSION).not_to be nil
11
13
  end
12
14
 
13
- # it "generates output for the Rice document" do
14
- # FileUtils.rm_f %w(spec/examples/rice.xml spec/examples/rice.doc spec/examples/rice.html spec/examples/rice_alt.html)
15
- # FileUtils.cd "spec/examples"
16
- # Asciidoctor.convert_file "rice.adoc", {:attributes=>{"backend"=>"iso"}, :safe=>0, :header_footer=>true, :requires=>["metanorma-iso"], :failure_level=>4, :mkdirs=>true, :to_file=>nil}
17
- # FileUtils.cd "../.."
18
- # expect(File.exist?("spec/examples/rice.xml")).to be true
19
- # expect(File.exist?("spec/examples/rice.doc")).to be true
20
- # expect(File.exist?("spec/examples/rice.html")).to be true
21
- # expect(File.exist?("spec/examples/rice_alt.html")).to be true
22
- # end
23
-
24
15
  it "processes a blank document" do
25
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
16
+ input = <<~INPUT
26
17
  #{ASCIIDOC_BLANK_HDR}
27
18
  INPUT
19
+ output = <<~OUTPUT
28
20
  #{@blank_hdr}
29
21
  <sections/>
30
22
  </iec-standard>
31
23
  OUTPUT
24
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
25
+ .to be_equivalent_to xmlpp(output)
32
26
  end
33
27
 
34
28
  it "converts a blank document" do
35
29
  FileUtils.rm_f "test.doc"
36
30
  FileUtils.rm_f "test.html"
37
31
  FileUtils.rm_f "test.pdf"
38
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
32
+ input = <<~INPUT
39
33
  = Document title
40
34
  Author
41
35
  :docfile: test.adoc
42
36
  :novalid:
43
37
  :no-isobib:
44
38
  INPUT
39
+ output = <<~OUTPUT
45
40
  #{@blank_hdr}
46
41
  <sections/>
47
42
  </iec-standard>
48
43
  OUTPUT
44
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
45
+ .to be_equivalent_to xmlpp(output)
49
46
  expect(File.exist?("test.pdf")).to be true
50
47
  expect(File.exist?("test.html")).to be true
51
48
  expect(File.exist?("test.doc")).to be true
@@ -53,7 +50,7 @@ RSpec.describe Asciidoctor::Iec do
53
50
  end
54
51
 
55
52
  it "processes default metadata" do
56
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
53
+ input = <<~INPUT
57
54
  = Document title
58
55
  Author
59
56
  :docfile: test.adoc
@@ -102,235 +99,245 @@ RSpec.describe Asciidoctor::Iec do
102
99
  :interest-to-committees: TC 6121, SC 12
103
100
  :obsoletes: ABC; DEF
104
101
  INPUT
105
- <?xml version="1.0" encoding="UTF-8"?>
106
- <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
107
- <bibdata type="standard">
108
- <title language="en" format="text/plain" type="main">Introduction — Main Title — Title — Title Part</title>
109
- <title language="en" format="text/plain" type="title-intro">Introduction</title>
110
- <title language="en" format="text/plain" type="title-main">Main Title — Title</title>
111
- <title language="en" format="text/plain" type="title-part">Title Part</title>
112
- <title language="fr" format="text/plain" type="main">Introduction Française — Titre Principal — Part du Titre</title>
113
- <title language="fr" format="text/plain" type="title-intro">Introduction Française</title>
114
- <title language="fr" format="text/plain" type="title-main">Titre Principal</title>
115
- <title language="fr" format="text/plain" type="title-part">Part du Titre</title>
116
- <docidentifier type="ISO">IEC/3NWIP 1000-1 ED 2</docidentifier>
117
- <docnumber>1000</docnumber>
118
- <contributor>
119
- <role type="author"/>
120
- <organization>
121
- <name>International Electrotechnical Commission</name>
122
- <abbreviation>IEC</abbreviation>
123
- </organization>
124
- </contributor>
125
- <contributor>
126
- <role type="publisher"/>
127
- <organization>
128
- <name>International Electrotechnical Commission</name>
129
- <abbreviation>IEC</abbreviation>
130
- </organization>
131
- </contributor>
132
- <edition>2</edition>
133
- <version>
134
- <revision-date>2000-01-01</revision-date>
135
- <draft>0.3.4</draft>
136
- </version>
137
- <language>en</language>
138
- <script>Latn</script>
139
- <status>
140
- <stage abbreviation="NWIP">10</stage>
141
- <substage abbreviation="??">20</substage>
142
- <iteration>3</iteration>
143
- </status>
144
- <copyright>
145
- <from>#{Date.today.year}</from>
146
- <owner>
147
- <organization>
148
- <name>International Electrotechnical Commission</name>
149
- <abbreviation>IEC</abbreviation>
150
- </organization>
151
- </owner>
152
- </copyright>
153
- <relation type='obsoletes'>
154
- <bibitem>
155
- <title>--</title>
156
- <docidentifier>ABC</docidentifier>
157
- </bibitem>
158
- </relation>
159
- <relation type='obsoletes'>
160
- <bibitem>
161
- <title>--</title>
162
- <docidentifier>DEF</docidentifier>
163
- </bibitem>
164
- </relation>
165
- <ext>
166
- <doctype>article</doctype>
167
- <horizontal>false</horizontal>
168
- <editorialgroup>
169
- <technical-committee number="1" type="A">TC</technical-committee>
170
- <technical-committee number="11" type="A1">TC1</technical-committee>
171
- <subcommittee number="2" type="B">SC</subcommittee>
172
- <subcommittee number="21" type="B1">SC1</subcommittee>
173
- <workgroup number="3" type="C">WG</workgroup>
174
- <workgroup number="31" type="C1">WG1</workgroup>
175
- <secretariat>SECRETARIAT</secretariat>
176
- </editorialgroup>
177
- <ics>
178
- <code>1</code>
179
- </ics>
180
- <ics>
181
- <code>2</code>
182
- </ics>
183
- <ics>
184
- <code>3</code>
185
- </ics>
186
- <structuredidentifier>
187
- <project-number part="1">IEC 1000</project-number>
188
- </structuredidentifier>
189
- <stagename>New work item proposal</stagename>
190
- <accessibility-color-inside>true</accessibility-color-inside>
191
- <price-code>XC</price-code>
192
- <cen-processing>true</cen-processing>
193
- <secretary>Fred Nerk</secretary>
194
- <interest-to-committees>TC 6121, SC 12</interest-to-committees>
195
- </ext>
196
- </bibdata>
197
- <boilerplate>
198
- <copyright-statement>
199
- <clause>
200
- <p id='_'>
201
- <strong>Copyright © #{Time.now.year} International Electrotechnical Commission, IEC.</strong>
202
- All rights reserved. It is permitted to download this electronic
203
- file, to make a copy and to print out the content for the sole purpose
204
- of preparing National Committee positions. You may not copy or
205
- “mirror” the file or printed version of the document, or any part of
206
- it, for any other purpose without permission in writing from IEC.
207
- </p>
208
- </clause>
209
- </copyright-statement>
210
- <legal-statement>
211
- <clause>
212
- <ol id='_'>
213
- <li>
214
- <p id='_'>
215
- The International Electrotechnical Commission (IEC) is a worldwide
216
- organization for standardization comprising all national
217
- electrotechnical committees (IEC National Committees). The object
218
- of IEC is to promote international co-operation on all questions
219
- concerning standardization in the electrical and electronic
220
- fields. To this end and in addition to other activities, IEC
221
- publishes International Standards, Technical Specifications,
222
- Technical Reports, Publicly Available Specifications (PAS) and
223
- Guides (hereafter referred to as “IEC Publication(s)”). Their
224
- preparation is entrusted to technical committees; any IEC National
225
- Committee interested in the subject dealt with may participate in
226
- this preparatory work. International, governmental and
227
- non-governmental organizations liaising with the IEC also
228
- participate in this preparation. IEC collaborates closely with the
229
- International Organization for Standardization (ISO) in accordance
230
- with conditions determined by agreement between the two
231
- organizations.
232
- </p>
233
- </li>
234
- <li>
235
- <p id='_'>
236
- The formal decisions or agreements of IEC on technical matters
237
- express, as nearly as possible, an international consensus of
238
- opinion on the relevant subjects since each technical committee
239
- has representation from all interested IEC National Committees.
240
- </p>
241
- </li>
242
- <li>
243
- <p id='_'>
244
- IEC Publications have the form of recommendations for
245
- international use and are accepted by IEC National Committees in
246
- that sense. While all reasonable efforts are made to ensure that
247
- the technical content of IEC Publications is accurate, IEC cannot
248
- be held responsible for the way in which they are used or for any
249
- misinterpretation by any end user.
250
- </p>
251
- </li>
252
- <li>
253
- <p id='_'>
254
- In order to promote international uniformity, IEC National
255
- Committees undertake to apply IEC Publications transparently to
256
- the maximum extent possible in their national and regional
257
- publications. Any divergence between any IEC Publication and the
258
- corresponding national or regional publication shall be clearly
259
- indicated in the latter.
260
- </p>
261
- </li>
262
- <li>
263
- <p id='_'>
264
- IEC itself does not provide any attestation of conformity.
265
- Independent certification bodies provide conformity assessment
266
- services and, in some areas, access to IEC marks of conformity.
267
- IEC is not responsible for any services carried out by independent
268
- certification bodies.
269
- </p>
270
- </li>
271
- <li>
272
- <p id='_'>All users should ensure that they have the latest edition of this publication.</p>
273
- </li>
274
- <li>
275
- <p id='_'>
276
- No liability shall attach to IEC or its directors, employees,
277
- servants or agents including individual experts and members of its
278
- technical committees and IEC National Committees for any personal
279
- injury, property damage or other damage of any nature whatsoever,
280
- whether direct or indirect, or for costs (including legal fees)
281
- and expenses arising out of the publication, use of, or reliance
282
- upon, this IEC Publication or any other IEC Publications.
283
- </p>
284
- </li>
285
- <li>
286
- <p id='_'>
287
- Attention is drawn to the Normative references cited in this
288
- publication. Use of the referenced publications is indispensable
289
- for the correct application of this publication.
290
- </p>
291
- </li>
292
- <li>
293
- <p id='_'>
294
- Attention is drawn to the possibility that some of the elements of
295
- this IEC Publication may be the subject of patent rights. IEC
296
- shall not be held responsible for identifying any or all such
297
- patent rights.
298
- </p>
299
- </li>
300
- </ol>
301
- </clause>
302
- </legal-statement>
303
- <license-statement>
304
- <clause>
305
- <p id='_'>
306
- This document is still under study and subject to change. It should
307
- not be used for reference purposes.
308
- </p>
309
- <p id='_'>
310
- Recipients of this document are invited to submit, with their
311
- comments, notification of any relevant patent rights of which they are
312
- aware and to provide supporting documentation.
313
- </p>
314
- </clause>
315
- </license-statement>
316
- <feedback-statement>
317
- <clause id='boilerplate-cenelec-attention'>
318
- <title>Attention IEC-CENELEC parallel voting</title>
319
- <p id='_'>
320
- The attention of IEC National Committees, members of CENELEC, is drawn
321
- to the fact that this (NWIP) is submitted for parallel voting.
322
- </p>
323
- <p id='_'>The CENELEC members are invited to vote through the CENELEC voting system.</p>
324
- </clause>
325
- </feedback-statement>
326
- </boilerplate>
327
- <sections/>
328
- </iec-standard>
102
+ output = <<~OUTPUT
103
+ <?xml version="1.0" encoding="UTF-8"?>
104
+ <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
105
+ <bibdata type='standard'>
106
+ <title language='en' format='text/plain' type='main'>
107
+ Introduction&#8201;&#8212;&#8201;Main
108
+ Title&#8201;&#8212;&#8201;Title&#8201;&#8212;&#8201;Title Part
109
+ </title>
110
+ <title language='en' format='text/plain' type='title-intro'>Introduction</title>
111
+ <title language='en' format='text/plain' type='title-main'>Main Title&#8201;&#8212;&#8201;Title</title>
112
+ <title language='en' format='text/plain' type='title-part'>Title Part</title>
113
+ <title language='fr' format='text/plain' type='main'>
114
+ Introduction Fran&#231;aise&#8201;&#8212;&#8201;Titre
115
+ Principal&#8201;&#8212;&#8201;Part du Titre
116
+ </title>
117
+ <title language='fr' format='text/plain' type='title-intro'>Introduction Fran&#231;aise</title>
118
+ <title language='fr' format='text/plain' type='title-main'>Titre Principal</title>
119
+ <title language='fr' format='text/plain' type='title-part'>Part du Titre</title>
120
+ <docidentifier type='ISO'>IEC/3NWIP 1000-1 ED 2</docidentifier>
121
+ <docnumber>1000</docnumber>
122
+ <contributor>
123
+ <role type='author'/>
124
+ <organization>
125
+ <name>International Electrotechnical Commission</name>
126
+ <abbreviation>IEC</abbreviation>
127
+ </organization>
128
+ </contributor>
129
+ <contributor>
130
+ <role type='publisher'/>
131
+ <organization>
132
+ <name>International Electrotechnical Commission</name>
133
+ <abbreviation>IEC</abbreviation>
134
+ </organization>
135
+ </contributor>
136
+ <edition>2</edition>
137
+ <version>
138
+ <revision-date>2000-01-01</revision-date>
139
+ <draft>0.3.4</draft>
140
+ </version>
141
+ <language>en</language>
142
+ <script>Latn</script>
143
+ <status>
144
+ <stage abbreviation='NWIP'>10</stage>
145
+ <substage abbreviation='??'>20</substage>
146
+ <iteration>3</iteration>
147
+ </status>
148
+ <copyright>
149
+ <from>#{Date.today.year}</from>
150
+ <owner>
151
+ <organization>
152
+ <name>International Electrotechnical Commission</name>
153
+ <abbreviation>IEC</abbreviation>
154
+ </organization>
155
+ </owner>
156
+ </copyright>
157
+ <relation type='obsoletes'>
158
+ <bibitem>
159
+ <title>--</title>
160
+ <docidentifier>ABC</docidentifier>
161
+ </bibitem>
162
+ </relation>
163
+ <relation type='obsoletes'>
164
+ <bibitem>
165
+ <title>--</title>
166
+ <docidentifier>DEF</docidentifier>
167
+ </bibitem>
168
+ </relation>
169
+ <ext>
170
+ <doctype>article</doctype>
171
+ <horizontal>false</horizontal>
172
+ <editorialgroup>
173
+ <technical-committee number='1' type='A'>TC</technical-committee>
174
+ <technical-committee number='11' type='A1'>TC1</technical-committee>
175
+ <subcommittee number='2' type='B'>SC</subcommittee>
176
+ <subcommittee number='21' type='B1'>SC1</subcommittee>
177
+ <workgroup number='3' type='C'>WG</workgroup>
178
+ <workgroup number='31' type='C1'>WG1</workgroup>
179
+ <secretariat>SECRETARIAT</secretariat>
180
+ </editorialgroup>
181
+ <ics>
182
+ <code>1</code>
183
+ </ics>
184
+ <ics>
185
+ <code>2</code>
186
+ </ics>
187
+ <ics>
188
+ <code>3</code>
189
+ </ics>
190
+ <structuredidentifier>
191
+ <project-number part='1'>IEC 1000</project-number>
192
+ </structuredidentifier>
193
+ <stagename>New work item proposal</stagename>
194
+ <accessibility-color-inside>true</accessibility-color-inside>
195
+ <price-code>XC</price-code>
196
+ <cen-processing>true</cen-processing>
197
+ <secretary>Fred Nerk</secretary>
198
+ <interest-to-committees>TC 6121, SC 12</interest-to-committees>
199
+ </ext>
200
+ </bibdata>
201
+ <boilerplate>
202
+ <copyright-statement>
203
+ <clause>
204
+ <p id='_'>
205
+ <strong>Copyright &#169; #{Date.today.year} International Electrotechnical Commission, IEC.</strong>
206
+ All rights reserved. It is permitted to download this electronic
207
+ file, to make a copy and to print out the content for the sole purpose
208
+ of preparing National Committee positions. You may not copy or
209
+ &#8220;mirror&#8221; the file or printed version of the document, or
210
+ any part of it, for any other purpose without permission in writing
211
+ from IEC.
212
+ </p>
213
+ </clause>
214
+ </copyright-statement>
215
+ <legal-statement>
216
+ <clause>
217
+ <ol id='_'>
218
+ <li>
219
+ <p id='_'>
220
+ The International Electrotechnical Commission (IEC) is a worldwide
221
+ organization for standardization comprising all national
222
+ electrotechnical committees (IEC National Committees). The object
223
+ of IEC is to promote international co-operation on all questions
224
+ concerning standardization in the electrical and electronic
225
+ fields. To this end and in addition to other activities, IEC
226
+ publishes International Standards, Technical Specifications,
227
+ Technical Reports, Publicly Available Specifications (PAS) and
228
+ Guides (hereafter referred to as &#8220;IEC
229
+ Publication(s)&#8221;). Their preparation is entrusted to
230
+ technical committees; any IEC National Committee interested in the
231
+ subject dealt with may participate in this preparatory work.
232
+ International, governmental and non-governmental organizations
233
+ liaising with the IEC also participate in this preparation. IEC
234
+ collaborates closely with the International Organization for
235
+ Standardization (ISO) in accordance with conditions determined by
236
+ agreement between the two organizations.
237
+ </p>
238
+ </li>
239
+ <li>
240
+ <p id='_'>
241
+ The formal decisions or agreements of IEC on technical matters
242
+ express, as nearly as possible, an international consensus of
243
+ opinion on the relevant subjects since each technical committee
244
+ has representation from all interested IEC National Committees.
245
+ </p>
246
+ </li>
247
+ <li>
248
+ <p id='_'>
249
+ IEC Publications have the form of recommendations for
250
+ international use and are accepted by IEC National Committees in
251
+ that sense. While all reasonable efforts are made to ensure that
252
+ the technical content of IEC Publications is accurate, IEC cannot
253
+ be held responsible for the way in which they are used or for any
254
+ misinterpretation by any end user.
255
+ </p>
256
+ </li>
257
+ <li>
258
+ <p id='_'>
259
+ In order to promote international uniformity, IEC National
260
+ Committees undertake to apply IEC Publications transparently to
261
+ the maximum extent possible in their national and regional
262
+ publications. Any divergence between any IEC Publication and the
263
+ corresponding national or regional publication shall be clearly
264
+ indicated in the latter.
265
+ </p>
266
+ </li>
267
+ <li>
268
+ <p id='_'>
269
+ IEC itself does not provide any attestation of conformity.
270
+ Independent certification bodies provide conformity assessment
271
+ services and, in some areas, access to IEC marks of conformity.
272
+ IEC is not responsible for any services carried out by independent
273
+ certification bodies.
274
+ </p>
275
+ </li>
276
+ <li>
277
+ <p id='_'>All users should ensure that they have the latest edition of this publication.</p>
278
+ </li>
279
+ <li>
280
+ <p id='_'>
281
+ No liability shall attach to IEC or its directors, employees,
282
+ servants or agents including individual experts and members of its
283
+ technical committees and IEC National Committees for any personal
284
+ injury, property damage or other damage of any nature whatsoever,
285
+ whether direct or indirect, or for costs (including legal fees)
286
+ and expenses arising out of the publication, use of, or reliance
287
+ upon, this IEC Publication or any other IEC Publications.
288
+ </p>
289
+ </li>
290
+ <li>
291
+ <p id='_'>
292
+ Attention is drawn to the Normative references cited in this
293
+ publication. Use of the referenced publications is indispensable
294
+ for the correct application of this publication.
295
+ </p>
296
+ </li>
297
+ <li>
298
+ <p id='_'>
299
+ Attention is drawn to the possibility that some of the elements of
300
+ this IEC Publication may be the subject of patent rights. IEC
301
+ shall not be held responsible for identifying any or all such
302
+ patent rights.
303
+ </p>
304
+ </li>
305
+ </ol>
306
+ </clause>
307
+ </legal-statement>
308
+ <license-statement>
309
+ <clause>
310
+ <p id='_'>
311
+ This document is still under study and subject to change. It should
312
+ not be used for reference purposes. until published as such.
313
+ </p>
314
+ <p id='_'>
315
+ Recipients of this document are invited to submit, with their
316
+ comments, notification of any relevant patent rights of which they are
317
+ aware and to provide supporting documentation.
318
+ </p>
319
+ </clause>
320
+ </license-statement>
321
+ <feedback-statement>
322
+ <clause id='boilerplate-cenelec-attention'>
323
+ <title>Attention IEC-CENELEC parallel voting</title>
324
+ <p id='_'>
325
+ The attention of IEC National Committees, members of CENELEC, is drawn
326
+ to the fact that this (NWIP) is submitted for parallel voting.
327
+ </p>
328
+ <p id='_'>The CENELEC members are invited to vote through the CENELEC voting system.</p>
329
+ </clause>
330
+ </feedback-statement>
331
+ </boilerplate>
332
+ <sections> </sections>
333
+ </iec-standard>
329
334
  OUTPUT
335
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
336
+ .to be_equivalent_to xmlpp(output)
330
337
  end
331
338
 
332
339
  it "processes complex metadata" do
333
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
340
+ input = <<~INPUT
334
341
  = Document title
335
342
  Author
336
343
  :docfile: test.adoc
@@ -349,105 +356,344 @@ RSpec.describe Asciidoctor::Iec do
349
356
  :function: emc
350
357
  :horizontal: true
351
358
  INPUT
352
- <?xml version="1.0" encoding="UTF-8"?>
353
- <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
354
- <bibdata type="standard">
355
- <docidentifier type="ISO">ISO/IEC/IETF/2CDTS 1000-1-1 ED 1</docidentifier>
356
- <docidentifier type="iso-tc">2000</docidentifier>
357
- <docnumber>1000</docnumber>
358
- <contributor>
359
- <role type="author"/>
360
- <organization>
361
- <name>International Electrotechnical Commission</name>
362
- <abbreviation>IEC</abbreviation>
363
- </organization>
364
- </contributor>
365
- <contributor>
366
- <role type="author"/>
367
- <organization>
368
- <name>IETF</name>
369
- </organization>
370
- </contributor>
371
- <contributor>
372
- <role type="author"/>
373
- <organization>
374
- <name>International Organization for Standardization</name>
375
- <abbreviation>ISO</abbreviation>
376
- </organization>
377
- </contributor>
378
- <contributor>
379
- <role type="publisher"/>
380
- <organization>
381
- <name>International Electrotechnical Commission</name>
382
- <abbreviation>IEC</abbreviation>
383
- </organization>
384
- </contributor>
385
- <contributor>
386
- <role type="publisher"/>
387
- <organization>
388
- <name>IETF</name>
389
- </organization>
390
- </contributor>
391
- <contributor>
392
- <role type="publisher"/>
393
- <organization>
394
- <name>International Organization for Standardization</name>
395
- <abbreviation>ISO</abbreviation>
396
- </organization>
397
- </contributor>
398
- <language>el</language>
399
- <script>Grek</script>
400
- <status>
401
- <stage abbreviation="CD">30</stage>
402
- <substage abbreviation="A22CD">99</substage>
403
- <iteration>2</iteration>
404
- </status>
405
- <copyright>
406
- <from>2001</from>
407
- <owner>
408
- <organization>
409
- <name>International Electrotechnical Commission</name>
410
- <abbreviation>IEC</abbreviation>
411
- </organization>
412
- </owner>
413
- </copyright>
414
- <copyright>
415
- <from>2001</from>
416
- <owner>
417
- <organization>
418
- <name>IETF</name>
419
- </organization>
420
- </owner>
421
- </copyright>
422
- <copyright>
423
- <from>2001</from>
424
- <owner>
425
- <organization>
426
- <name>International Organization for Standardization</name>
427
- <abbreviation>ISO</abbreviation>
428
- </organization>
429
- </owner>
430
- </copyright>
431
- <ext>
432
- <doctype>technical-specification</doctype>
433
- <horizontal>true</horizontal>
434
- <function>emc</function>
435
- <editorialgroup>
436
- <technical-committee/>
437
- <subcommittee/>
438
- <workgroup/>
439
- </editorialgroup>
440
- <structuredidentifier>
441
- <project-number part="1" subpart="1">ISO/IEC/IETF 1000</project-number>
442
- </structuredidentifier>
443
- <stagename>Committee draft</stagename>
444
- </ext>
445
- </bibdata>
446
- <boilerplate>
359
+ output = <<~OUTPUT
360
+ <?xml version="1.0" encoding="UTF-8"?>
361
+ <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
362
+ <bibdata type='standard'>
363
+ <docidentifier type='ISO'>ISO/IEC/IETF/2CDTS 1000-1-1 ED 1</docidentifier>
364
+ <docidentifier type='iso-tc'>2000</docidentifier>
365
+ <docnumber>1000</docnumber>
366
+ <contributor>
367
+ <role type='author'/>
368
+ <organization>
369
+ <name>International Electrotechnical Commission</name>
370
+ <abbreviation>IEC</abbreviation>
371
+ </organization>
372
+ </contributor>
373
+ <contributor>
374
+ <role type='author'/>
375
+ <organization>
376
+ <name>IETF</name>
377
+ </organization>
378
+ </contributor>
379
+ <contributor>
380
+ <role type='author'/>
381
+ <organization>
382
+ <name>International Organization for Standardization</name>
383
+ <abbreviation>ISO</abbreviation>
384
+ </organization>
385
+ </contributor>
386
+ <contributor>
387
+ <role type='publisher'/>
388
+ <organization>
389
+ <name>International Electrotechnical Commission</name>
390
+ <abbreviation>IEC</abbreviation>
391
+ </organization>
392
+ </contributor>
393
+ <contributor>
394
+ <role type='publisher'/>
395
+ <organization>
396
+ <name>IETF</name>
397
+ </organization>
398
+ </contributor>
399
+ <contributor>
400
+ <role type='publisher'/>
401
+ <organization>
402
+ <name>International Organization for Standardization</name>
403
+ <abbreviation>ISO</abbreviation>
404
+ </organization>
405
+ </contributor>
406
+ <language>el</language>
407
+ <script>Grek</script>
408
+ <status>
409
+ <stage abbreviation='CD'>30</stage>
410
+ <substage abbreviation='A22CD'>99</substage>
411
+ <iteration>2</iteration>
412
+ </status>
413
+ <copyright>
414
+ <from>2001</from>
415
+ <owner>
416
+ <organization>
417
+ <name>International Electrotechnical Commission</name>
418
+ <abbreviation>IEC</abbreviation>
419
+ </organization>
420
+ </owner>
421
+ </copyright>
422
+ <copyright>
423
+ <from>2001</from>
424
+ <owner>
425
+ <organization>
426
+ <name>IETF</name>
427
+ </organization>
428
+ </owner>
429
+ </copyright>
430
+ <copyright>
431
+ <from>2001</from>
432
+ <owner>
433
+ <organization>
434
+ <name>International Organization for Standardization</name>
435
+ <abbreviation>ISO</abbreviation>
436
+ </organization>
437
+ </owner>
438
+ </copyright>
439
+ <ext>
440
+ <doctype>technical-specification</doctype>
441
+ <horizontal>true</horizontal>
442
+ <function>emc</function>
443
+ <editorialgroup>
444
+ <technical-committee/>
445
+ <subcommittee/>
446
+ <workgroup/>
447
+ </editorialgroup>
448
+ <structuredidentifier>
449
+ <project-number part='1' subpart='1'>ISO/IEC/IETF 1000</project-number>
450
+ </structuredidentifier>
451
+ <stagename>Committee draft</stagename>
452
+ </ext>
453
+ </bibdata>
454
+ <boilerplate>
455
+ <copyright-statement>
456
+ <clause>
457
+ <p id='_'>
458
+ <strong>Copyright &#169; 2001 International Electrotechnical Commission, IEC.</strong>
459
+ All rights reserved. It is permitted to download this electronic
460
+ file, to make a copy and to print out the content for the sole purpose
461
+ of preparing National Committee positions. You may not copy or
462
+ &#8220;mirror&#8221; the file or printed version of the document, or
463
+ any part of it, for any other purpose without permission in writing
464
+ from IEC.
465
+ </p>
466
+ </clause>
467
+ </copyright-statement>
468
+ <legal-statement>
469
+ <clause>
470
+ <ol id='_'>
471
+ <li>
472
+ <p id='_'>
473
+ The International Electrotechnical Commission (IEC) is a worldwide
474
+ organization for standardization comprising all national
475
+ electrotechnical committees (IEC National Committees). The object
476
+ of IEC is to promote international co-operation on all questions
477
+ concerning standardization in the electrical and electronic
478
+ fields. To this end and in addition to other activities, IEC
479
+ publishes International Standards, Technical Specifications,
480
+ Technical Reports, Publicly Available Specifications (PAS) and
481
+ Guides (hereafter referred to as &#8220;IEC
482
+ Publication(s)&#8221;). Their preparation is entrusted to
483
+ technical committees; any IEC National Committee interested in the
484
+ subject dealt with may participate in this preparatory work.
485
+ International, governmental and non-governmental organizations
486
+ liaising with the IEC also participate in this preparation. IEC
487
+ collaborates closely with the International Organization for
488
+ Standardization (ISO) in accordance with conditions determined by
489
+ agreement between the two organizations.
490
+ </p>
491
+ </li>
492
+ <li>
493
+ <p id='_'>
494
+ The formal decisions or agreements of IEC on technical matters
495
+ express, as nearly as possible, an international consensus of
496
+ opinion on the relevant subjects since each technical committee
497
+ has representation from all interested IEC National Committees.
498
+ </p>
499
+ </li>
500
+ <li>
501
+ <p id='_'>
502
+ IEC Publications have the form of recommendations for
503
+ international use and are accepted by IEC National Committees in
504
+ that sense. While all reasonable efforts are made to ensure that
505
+ the technical content of IEC Publications is accurate, IEC cannot
506
+ be held responsible for the way in which they are used or for any
507
+ misinterpretation by any end user.
508
+ </p>
509
+ </li>
510
+ <li>
511
+ <p id='_'>
512
+ In order to promote international uniformity, IEC National
513
+ Committees undertake to apply IEC Publications transparently to
514
+ the maximum extent possible in their national and regional
515
+ publications. Any divergence between any IEC Publication and the
516
+ corresponding national or regional publication shall be clearly
517
+ indicated in the latter.
518
+ </p>
519
+ </li>
520
+ <li>
521
+ <p id='_'>
522
+ IEC itself does not provide any attestation of conformity.
523
+ Independent certification bodies provide conformity assessment
524
+ services and, in some areas, access to IEC marks of conformity.
525
+ IEC is not responsible for any services carried out by independent
526
+ certification bodies.
527
+ </p>
528
+ </li>
529
+ <li>
530
+ <p id='_'>All users should ensure that they have the latest edition of this publication.</p>
531
+ </li>
532
+ <li>
533
+ <p id='_'>
534
+ No liability shall attach to IEC or its directors, employees,
535
+ servants or agents including individual experts and members of its
536
+ technical committees and IEC National Committees for any personal
537
+ injury, property damage or other damage of any nature whatsoever,
538
+ whether direct or indirect, or for costs (including legal fees)
539
+ and expenses arising out of the publication, use of, or reliance
540
+ upon, this IEC Publication or any other IEC Publications.
541
+ </p>
542
+ </li>
543
+ <li>
544
+ <p id='_'>
545
+ Attention is drawn to the Normative references cited in this
546
+ publication. Use of the referenced publications is indispensable
547
+ for the correct application of this publication.
548
+ </p>
549
+ </li>
550
+ <li>
551
+ <p id='_'>
552
+ Attention is drawn to the possibility that some of the elements of
553
+ this IEC Publication may be the subject of patent rights. IEC
554
+ shall not be held responsible for identifying any or all such
555
+ patent rights.
556
+ </p>
557
+ </li>
558
+ </ol>
559
+ </clause>
560
+ </legal-statement>
561
+ <license-statement>
562
+ <clause>
563
+ <p id='_'>
564
+ This document is still under study and subject to change. It should
565
+ not be used for reference purposes. until published as such.
566
+ </p>
567
+ <p id='_'>
568
+ Recipients of this document are invited to submit, with their
569
+ comments, notification of any relevant patent rights of which they are
570
+ aware and to provide supporting documentation.
571
+ </p>
572
+ </clause>
573
+ </license-statement>
574
+ <feedback-statement>
575
+ <clause id='boilerplate-cenelec-attention'>
576
+ <title>Attention IEC-CENELEC parallel voting</title>
577
+ <p id='_'>
578
+ The attention of IEC National Committees, members of CENELEC, is drawn
579
+ to the fact that this Committee Draft (CD) is submitted for parallel
580
+ voting.
581
+ </p>
582
+ <p id='_'>The CENELEC members are invited to vote through the CENELEC voting system.</p>
583
+ </clause>
584
+ </feedback-statement>
585
+ </boilerplate>
586
+ <sections> </sections>
587
+ </iec-standard>
588
+ OUTPUT
589
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
590
+ .to be_equivalent_to xmlpp(output)
591
+ end
592
+
593
+ it "processes boilerplate in English" do
594
+ doc = strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS))
595
+ = Document title
596
+ Author
597
+ :docfile: test.adoc
598
+ :nodoc:
599
+ :novalid:
600
+ :no-isobib:
601
+ :docnumber: 1000
602
+ :partnumber: 1-1
603
+ :tc-docnumber: 2000
604
+ :language: en
605
+ :script: Latn
606
+ :publisher: IEC,IETF,ISO
607
+ :copyright-year: 2001
608
+ INPUT
609
+ expect(doc).to include "including individual experts"
610
+ expect(doc).not_to include "y compris ses experts particuliers"
611
+ end
612
+
613
+ it "processes boilerplate in French" do
614
+ doc = strip_guid(Asciidoctor.convert(<<~"INPUT", *OPTIONS))
615
+ = Document title
616
+ Author
617
+ :docfile: test.adoc
618
+ :nodoc:
619
+ :novalid:
620
+ :no-isobib:
621
+ :docnumber: 1000
622
+ :partnumber: 1-1
623
+ :tc-docnumber: 2000
624
+ :language: fr
625
+ :script: Latn
626
+ :publisher: IEC,IETF,ISO
627
+ :copyright-year: 2001
628
+ INPUT
629
+ expect(doc).not_to include "including individual experts"
630
+ expect(doc).to include "y compris ses experts particuliers"
631
+ end
632
+
633
+ it "defaults substage" do
634
+ input = <<~INPUT
635
+ = Document title
636
+ Author
637
+ :docfile: test.adoc
638
+ :nodoc:
639
+ :novalid:
640
+ :no-isobib:
641
+ :docnumber: 1000
642
+ :docstage: 50
643
+ INPUT
644
+ output = <<~OUTPUT
645
+ <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
646
+ <bibdata type="standard">
647
+ <docidentifier type="ISO">IEC/FDIS 1000 ED 1</docidentifier>
648
+ <docnumber>1000</docnumber>
649
+ <contributor>
650
+ <role type="author"/>
651
+ <organization>
652
+ <name>International Electrotechnical Commission</name>
653
+ <abbreviation>IEC</abbreviation>
654
+ </organization>
655
+ </contributor>
656
+ <contributor>
657
+ <role type="publisher"/>
658
+ <organization>
659
+ <name>International Electrotechnical Commission</name>
660
+ <abbreviation>IEC</abbreviation>
661
+ </organization>
662
+ </contributor>
663
+ <language>en</language>
664
+ <script>Latn</script>
665
+ <status>
666
+ <stage abbreviation="FDIS">50</stage>
667
+ <substage abbreviation="RFDIS">00</substage>
668
+ </status>
669
+ <copyright>
670
+ <from>#{Date.today.year}</from>
671
+ <owner>
672
+ <organization>
673
+ <name>International Electrotechnical Commission</name>
674
+ <abbreviation>IEC</abbreviation>
675
+ </organization>
676
+ </owner>
677
+ </copyright>
678
+ <ext>
679
+ <doctype>article</doctype>
680
+ <horizontal>false</horizontal>
681
+ <editorialgroup>
682
+ <technical-committee/>
683
+ <subcommittee/>
684
+ <workgroup/>
685
+ </editorialgroup>
686
+ <structuredidentifier>
687
+ <project-number>IEC 1000</project-number>
688
+ </structuredidentifier>
689
+ <stagename>Final draft international standard</stagename>
690
+ </ext>
691
+ </bibdata>
692
+ <boilerplate>
447
693
  <copyright-statement>
448
694
  <clause>
449
695
  <p id='_'>
450
- <strong>Copyright © 2001 International Electrotechnical Commission, IEC.</strong>
696
+ <strong>Copyright © #{Time.now.year} International Electrotechnical Commission, IEC.</strong>
451
697
  All rights reserved. It is permitted to download this electronic
452
698
  file, to make a copy and to print out the content for the sole purpose
453
699
  of preparing National Committee positions. You may not copy or
@@ -552,8 +798,15 @@ RSpec.describe Asciidoctor::Iec do
552
798
  <license-statement>
553
799
  <clause>
554
800
  <p id='_'>
555
- This document is still under study and subject to change. It should
556
- not be used for reference purposes.
801
+ This document is a draft distributed for approval. It may not be
802
+ referred to as an International Standard until published as such.
803
+ </p>
804
+ <p id='_'>
805
+ In addition to their evaluation as being acceptable for industrial,
806
+ technological, commercial and user purposes, Final Draft International
807
+ Standards may on occasion have to be considered in the light of their
808
+ potential to become standards to which reference may be made in
809
+ national regulations.
557
810
  </p>
558
811
  <p id='_'>
559
812
  Recipients of this document are invited to submit, with their
@@ -567,261 +820,22 @@ RSpec.describe Asciidoctor::Iec do
567
820
  <title>Attention IEC-CENELEC parallel voting</title>
568
821
  <p id='_'>
569
822
  The attention of IEC National Committees, members of CENELEC, is drawn
570
- to the fact that this Committee Draft (CD) is submitted for parallel
571
- voting.
823
+ to the fact that this Final Draft International Standard (FDIS) is
824
+ submitted for parallel voting.
572
825
  </p>
573
826
  <p id='_'>The CENELEC members are invited to vote through the CENELEC voting system.</p>
574
827
  </clause>
575
828
  </feedback-statement>
576
829
  </boilerplate>
577
- <sections/>
578
- </iec-standard>
579
- OUTPUT
580
- end
581
-
582
- it "processes boilerplate in English" do
583
- doc = strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true))
584
- = Document title
585
- Author
586
- :docfile: test.adoc
587
- :nodoc:
588
- :novalid:
589
- :no-isobib:
590
- :docnumber: 1000
591
- :partnumber: 1-1
592
- :tc-docnumber: 2000
593
- :language: en
594
- :script: Latn
595
- :publisher: IEC,IETF,ISO
596
- :copyright-year: 2001
597
- INPUT
598
- expect(doc).to include "including individual experts"
599
- expect(doc).not_to include "y compris ses experts particuliers"
600
- end
601
-
602
- it "processes boilerplate in French" do
603
- doc = strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true))
604
- = Document title
605
- Author
606
- :docfile: test.adoc
607
- :nodoc:
608
- :novalid:
609
- :no-isobib:
610
- :docnumber: 1000
611
- :partnumber: 1-1
612
- :tc-docnumber: 2000
613
- :language: fr
614
- :script: Latn
615
- :publisher: IEC,IETF,ISO
616
- :copyright-year: 2001
617
- INPUT
618
- expect(doc).not_to include "including individual experts"
619
- expect(doc).to include "y compris ses experts particuliers"
620
- end
621
-
622
- it "defaults substage" do
623
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
624
- = Document title
625
- Author
626
- :docfile: test.adoc
627
- :nodoc:
628
- :novalid:
629
- :no-isobib:
630
- :docnumber: 1000
631
- :docstage: 50
632
- INPUT
633
- <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
634
- <bibdata type="standard">
635
- <docidentifier type="ISO">IEC/FDIS 1000 ED 1</docidentifier>
636
- <docnumber>1000</docnumber>
637
- <contributor>
638
- <role type="author"/>
639
- <organization>
640
- <name>International Electrotechnical Commission</name>
641
- <abbreviation>IEC</abbreviation>
642
- </organization>
643
- </contributor>
644
- <contributor>
645
- <role type="publisher"/>
646
- <organization>
647
- <name>International Electrotechnical Commission</name>
648
- <abbreviation>IEC</abbreviation>
649
- </organization>
650
- </contributor>
651
- <language>en</language>
652
- <script>Latn</script>
653
- <status>
654
- <stage abbreviation="FDIS">50</stage>
655
- <substage abbreviation="RFDIS">00</substage>
656
- </status>
657
- <copyright>
658
- <from>#{Date.today.year}</from>
659
- <owner>
660
- <organization>
661
- <name>International Electrotechnical Commission</name>
662
- <abbreviation>IEC</abbreviation>
663
- </organization>
664
- </owner>
665
- </copyright>
666
- <ext>
667
- <doctype>article</doctype>
668
- <horizontal>false</horizontal>
669
- <editorialgroup>
670
- <technical-committee/>
671
- <subcommittee/>
672
- <workgroup/>
673
- </editorialgroup>
674
- <structuredidentifier>
675
- <project-number>IEC 1000</project-number>
676
- </structuredidentifier>
677
- <stagename>Final draft international standard</stagename>
678
- </ext>
679
- </bibdata>
680
- <boilerplate>
681
- <copyright-statement>
682
- <clause>
683
- <p id='_'>
684
- <strong>Copyright © #{Time.now.year} International Electrotechnical Commission, IEC.</strong>
685
- All rights reserved. It is permitted to download this electronic
686
- file, to make a copy and to print out the content for the sole purpose
687
- of preparing National Committee positions. You may not copy or
688
- “mirror” the file or printed version of the document, or any part of
689
- it, for any other purpose without permission in writing from IEC.
690
- </p>
691
- </clause>
692
- </copyright-statement>
693
- <legal-statement>
694
- <clause>
695
- <ol id='_'>
696
- <li>
697
- <p id='_'>
698
- The International Electrotechnical Commission (IEC) is a worldwide
699
- organization for standardization comprising all national
700
- electrotechnical committees (IEC National Committees). The object
701
- of IEC is to promote international co-operation on all questions
702
- concerning standardization in the electrical and electronic
703
- fields. To this end and in addition to other activities, IEC
704
- publishes International Standards, Technical Specifications,
705
- Technical Reports, Publicly Available Specifications (PAS) and
706
- Guides (hereafter referred to as “IEC Publication(s)”). Their
707
- preparation is entrusted to technical committees; any IEC National
708
- Committee interested in the subject dealt with may participate in
709
- this preparatory work. International, governmental and
710
- non-governmental organizations liaising with the IEC also
711
- participate in this preparation. IEC collaborates closely with the
712
- International Organization for Standardization (ISO) in accordance
713
- with conditions determined by agreement between the two
714
- organizations.
715
- </p>
716
- </li>
717
- <li>
718
- <p id='_'>
719
- The formal decisions or agreements of IEC on technical matters
720
- express, as nearly as possible, an international consensus of
721
- opinion on the relevant subjects since each technical committee
722
- has representation from all interested IEC National Committees.
723
- </p>
724
- </li>
725
- <li>
726
- <p id='_'>
727
- IEC Publications have the form of recommendations for
728
- international use and are accepted by IEC National Committees in
729
- that sense. While all reasonable efforts are made to ensure that
730
- the technical content of IEC Publications is accurate, IEC cannot
731
- be held responsible for the way in which they are used or for any
732
- misinterpretation by any end user.
733
- </p>
734
- </li>
735
- <li>
736
- <p id='_'>
737
- In order to promote international uniformity, IEC National
738
- Committees undertake to apply IEC Publications transparently to
739
- the maximum extent possible in their national and regional
740
- publications. Any divergence between any IEC Publication and the
741
- corresponding national or regional publication shall be clearly
742
- indicated in the latter.
743
- </p>
744
- </li>
745
- <li>
746
- <p id='_'>
747
- IEC itself does not provide any attestation of conformity.
748
- Independent certification bodies provide conformity assessment
749
- services and, in some areas, access to IEC marks of conformity.
750
- IEC is not responsible for any services carried out by independent
751
- certification bodies.
752
- </p>
753
- </li>
754
- <li>
755
- <p id='_'>All users should ensure that they have the latest edition of this publication.</p>
756
- </li>
757
- <li>
758
- <p id='_'>
759
- No liability shall attach to IEC or its directors, employees,
760
- servants or agents including individual experts and members of its
761
- technical committees and IEC National Committees for any personal
762
- injury, property damage or other damage of any nature whatsoever,
763
- whether direct or indirect, or for costs (including legal fees)
764
- and expenses arising out of the publication, use of, or reliance
765
- upon, this IEC Publication or any other IEC Publications.
766
- </p>
767
- </li>
768
- <li>
769
- <p id='_'>
770
- Attention is drawn to the Normative references cited in this
771
- publication. Use of the referenced publications is indispensable
772
- for the correct application of this publication.
773
- </p>
774
- </li>
775
- <li>
776
- <p id='_'>
777
- Attention is drawn to the possibility that some of the elements of
778
- this IEC Publication may be the subject of patent rights. IEC
779
- shall not be held responsible for identifying any or all such
780
- patent rights.
781
- </p>
782
- </li>
783
- </ol>
784
- </clause>
785
- </legal-statement>
786
- <license-statement>
787
- <clause>
788
- <p id='_'>
789
- This document is a draft distributed for approval. It may not be
790
- referred to as an International Standard until published as such.
791
- </p>
792
- <p id='_'>
793
- In addition to their evaluation as being acceptable for industrial,
794
- technological, commercial and user purposes, Final Draft International
795
- Standards may on occasion have to be considered in the light of their
796
- potential to become standards to which reference may be made in
797
- national regulations.
798
- </p>
799
- <p id='_'>
800
- Recipients of this document are invited to submit, with their
801
- comments, notification of any relevant patent rights of which they are
802
- aware and to provide supporting documentation.
803
- </p>
804
- </clause>
805
- </license-statement>
806
- <feedback-statement>
807
- <clause id='boilerplate-cenelec-attention'>
808
- <title>Attention IEC-CENELEC parallel voting</title>
809
- <p id='_'>
810
- The attention of IEC National Committees, members of CENELEC, is drawn
811
- to the fact that this Final Draft International Standard (FDIS) is
812
- submitted for parallel voting.
813
- </p>
814
- <p id='_'>The CENELEC members are invited to vote through the CENELEC voting system.</p>
815
- </clause>
816
- </feedback-statement>
817
- </boilerplate>
818
- <sections/>
819
- </iec-standard>
830
+ <sections/>
831
+ </iec-standard>
820
832
  OUTPUT
833
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
834
+ .to be_equivalent_to xmlpp(output)
821
835
  end
822
836
 
823
837
  it "defaults substage for stage 60" do
824
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
838
+ input = <<~INPUT
825
839
  = Document title
826
840
  Author
827
841
  :docfile: test.adoc
@@ -831,61 +845,64 @@ RSpec.describe Asciidoctor::Iec do
831
845
  :docnumber: 1000
832
846
  :docstage: 60
833
847
  INPUT
834
- <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
835
- <bibdata type="standard">
836
- <docidentifier type="ISO">IEC 1000 ED 1</docidentifier>
837
- <docnumber>1000</docnumber>
838
- <contributor>
839
- <role type="author"/>
840
- <organization>
841
- <name>International Electrotechnical Commission</name>
842
- <abbreviation>IEC</abbreviation>
843
- </organization>
844
- </contributor>
845
- <contributor>
846
- <role type="publisher"/>
847
- <organization>
848
- <name>International Electrotechnical Commission</name>
849
- <abbreviation>IEC</abbreviation>
850
- </organization>
851
- </contributor>
852
- <language>en</language>
853
- <script>Latn</script>
854
- <status>
855
- <stage abbreviation="PPUB">60</stage>
856
- <substage abbreviation="PPUB">60</substage>
857
- </status>
858
- <copyright>
859
- <from>#{Date.today.year}</from>
860
- <owner>
861
- <organization>
862
- <name>International Electrotechnical Commission</name>
863
- <abbreviation>IEC</abbreviation>
864
- </organization>
865
- </owner>
866
- </copyright>
867
- <ext>
868
- <doctype>article</doctype>
869
- <horizontal>false</horizontal>
870
- <editorialgroup>
871
- <technical-committee/>
872
- <subcommittee/>
873
- <workgroup/>
874
- </editorialgroup>
875
- <structuredidentifier>
876
- <project-number>IEC 1000</project-number>
877
- </structuredidentifier>
878
- <stagename>International standard</stagename>
879
- </ext>
880
- </bibdata>
881
- #{boilerplate(Nokogiri::XML(BLANK_HDR + '</iec-standard>'))}
882
- <sections/>
883
- </iec-standard>
848
+ output = <<~OUTPUT
849
+ <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
850
+ <bibdata type="standard">
851
+ <docidentifier type="ISO">IEC 1000 ED 1</docidentifier>
852
+ <docnumber>1000</docnumber>
853
+ <contributor>
854
+ <role type="author"/>
855
+ <organization>
856
+ <name>International Electrotechnical Commission</name>
857
+ <abbreviation>IEC</abbreviation>
858
+ </organization>
859
+ </contributor>
860
+ <contributor>
861
+ <role type="publisher"/>
862
+ <organization>
863
+ <name>International Electrotechnical Commission</name>
864
+ <abbreviation>IEC</abbreviation>
865
+ </organization>
866
+ </contributor>
867
+ <language>en</language>
868
+ <script>Latn</script>
869
+ <status>
870
+ <stage abbreviation="PPUB">60</stage>
871
+ <substage abbreviation="PPUB">60</substage>
872
+ </status>
873
+ <copyright>
874
+ <from>#{Date.today.year}</from>
875
+ <owner>
876
+ <organization>
877
+ <name>International Electrotechnical Commission</name>
878
+ <abbreviation>IEC</abbreviation>
879
+ </organization>
880
+ </owner>
881
+ </copyright>
882
+ <ext>
883
+ <doctype>article</doctype>
884
+ <horizontal>false</horizontal>
885
+ <editorialgroup>
886
+ <technical-committee/>
887
+ <subcommittee/>
888
+ <workgroup/>
889
+ </editorialgroup>
890
+ <structuredidentifier>
891
+ <project-number>IEC 1000</project-number>
892
+ </structuredidentifier>
893
+ <stagename>International standard</stagename>
894
+ </ext>
895
+ </bibdata>
896
+ #{boilerplate(Nokogiri::XML(BLANK_HDR + '</iec-standard>'))}
897
+ <sections/>
898
+ </iec-standard>
884
899
  OUTPUT
900
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
901
+ .to be_equivalent_to xmlpp(output)
885
902
  end
886
903
 
887
904
  it "populates metadata for PRF" do
888
- expect(xmlpp(strip_guid(Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)))).to be_equivalent_to xmlpp(<<~"OUTPUT")
905
+ input = <<~INPUT
889
906
  = Document title
890
907
  Author
891
908
  :docfile: test.adoc
@@ -896,62 +913,65 @@ RSpec.describe Asciidoctor::Iec do
896
913
  :docstage: 60
897
914
  :docsubstage: 00
898
915
  INPUT
899
- <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
900
- <bibdata type="standard">
901
- <docidentifier type="ISO">IEC 1000 ED 1</docidentifier>
902
- <docnumber>1000</docnumber>
903
- <contributor>
904
- <role type="author"/>
905
- <organization>
906
- <name>International Electrotechnical Commission</name>
907
- <abbreviation>IEC</abbreviation>
908
- </organization>
909
- </contributor>
910
- <contributor>
911
- <role type="publisher"/>
912
- <organization>
913
- <name>International Electrotechnical Commission</name>
914
- <abbreviation>IEC</abbreviation>
915
- </organization>
916
- </contributor>
917
- <language>en</language>
918
- <script>Latn</script>
919
- <status>
920
- <stage abbreviation="PPUB">60</stage>
921
- <substage abbreviation="BPUB">00</substage>
922
- </status>
923
- <copyright>
924
- <from>#{Date.today.year}</from>
925
- <owner>
926
- <organization>
927
- <name>International Electrotechnical Commission</name>
928
- <abbreviation>IEC</abbreviation>
929
- </organization>
930
- </owner>
931
- </copyright>
932
- <ext>
933
- <doctype>article</doctype>
934
- <horizontal>false</horizontal>
935
- <editorialgroup>
936
- <technical-committee/>
937
- <subcommittee/>
938
- <workgroup/>
939
- </editorialgroup>
940
- <structuredidentifier>
941
- <project-number>IEC 1000</project-number>
942
- </structuredidentifier>
943
- <stagename>International standard</stagename>
944
- </ext>
945
- </bibdata>
946
- #{boilerplate(Nokogiri::XML(BLANK_HDR + '</iec-standard>'))}
947
- <sections/>
948
- </iec-standard>
916
+ output = <<~OUTPUT
917
+ <iec-standard xmlns="https://www.metanorma.org/ns/iec" type="semantic" version="#{Metanorma::Iec::VERSION}">
918
+ <bibdata type="standard">
919
+ <docidentifier type="ISO">IEC 1000 ED 1</docidentifier>
920
+ <docnumber>1000</docnumber>
921
+ <contributor>
922
+ <role type="author"/>
923
+ <organization>
924
+ <name>International Electrotechnical Commission</name>
925
+ <abbreviation>IEC</abbreviation>
926
+ </organization>
927
+ </contributor>
928
+ <contributor>
929
+ <role type="publisher"/>
930
+ <organization>
931
+ <name>International Electrotechnical Commission</name>
932
+ <abbreviation>IEC</abbreviation>
933
+ </organization>
934
+ </contributor>
935
+ <language>en</language>
936
+ <script>Latn</script>
937
+ <status>
938
+ <stage abbreviation="PPUB">60</stage>
939
+ <substage abbreviation="BPUB">00</substage>
940
+ </status>
941
+ <copyright>
942
+ <from>#{Date.today.year}</from>
943
+ <owner>
944
+ <organization>
945
+ <name>International Electrotechnical Commission</name>
946
+ <abbreviation>IEC</abbreviation>
947
+ </organization>
948
+ </owner>
949
+ </copyright>
950
+ <ext>
951
+ <doctype>article</doctype>
952
+ <horizontal>false</horizontal>
953
+ <editorialgroup>
954
+ <technical-committee/>
955
+ <subcommittee/>
956
+ <workgroup/>
957
+ </editorialgroup>
958
+ <structuredidentifier>
959
+ <project-number>IEC 1000</project-number>
960
+ </structuredidentifier>
961
+ <stagename>International standard</stagename>
962
+ </ext>
963
+ </bibdata>
964
+ #{boilerplate(Nokogiri::XML(BLANK_HDR + '</iec-standard>'))}
965
+ <sections/>
966
+ </iec-standard>
949
967
  OUTPUT
968
+ expect(xmlpp(strip_guid(Asciidoctor.convert(input, *OPTIONS))))
969
+ .to be_equivalent_to xmlpp(output)
950
970
  end
951
971
 
952
972
  it "reads scripts into blank HTML document" do
953
973
  FileUtils.rm_f "test.html"
954
- Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)
974
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
955
975
  = Document title
956
976
  Author
957
977
  :docfile: test.adoc
@@ -965,7 +985,7 @@ RSpec.describe Asciidoctor::Iec do
965
985
 
966
986
  it "uses default fonts" do
967
987
  FileUtils.rm_f "test.html"
968
- Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)
988
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
969
989
  = Document title
970
990
  Author
971
991
  :docfile: test.adoc
@@ -974,14 +994,17 @@ RSpec.describe Asciidoctor::Iec do
974
994
  :no-pdf:
975
995
  INPUT
976
996
  html = File.read("test.html", encoding: "utf-8")
977
- expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
978
- expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "Arial", sans-serif;]m)
979
- expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Arial", sans-serif;]m)
997
+ expect(html)
998
+ .to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
999
+ expect(html)
1000
+ .to match(%r[blockquote[^{]+\{[^{]+font-family: "Arial", sans-serif;]m)
1001
+ expect(html)
1002
+ .to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Arial", sans-serif;]m)
980
1003
  end
981
1004
 
982
1005
  it "uses Chinese fonts" do
983
1006
  FileUtils.rm_f "test.html"
984
- Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)
1007
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
985
1008
  = Document title
986
1009
  Author
987
1010
  :docfile: test.adoc
@@ -991,14 +1014,17 @@ RSpec.describe Asciidoctor::Iec do
991
1014
  :no-pdf:
992
1015
  INPUT
993
1016
  html = File.read("test.html", encoding: "utf-8")
994
- expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
995
- expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: "Source Han Sans", serif;]m)
996
- expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Source Han Sans", sans-serif;]m)
1017
+ expect(html)
1018
+ .to match(%r[\bpre[^{]+\{[^{]+font-family: "Courier New", monospace;]m)
1019
+ expect(html)
1020
+ .to match(%r[blockquote[^{]+\{[^{]+font-family: "Source Han Sans", serif;]m)
1021
+ expect(html)
1022
+ .to match(%r[\.h2Annex[^{]+\{[^{]+font-family: "Source Han Sans", sans-serif;]m)
997
1023
  end
998
1024
 
999
1025
  it "uses specified fonts" do
1000
1026
  FileUtils.rm_f "test.html"
1001
- Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)
1027
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1002
1028
  = Document title
1003
1029
  Author
1004
1030
  :docfile: test.adoc
@@ -1012,14 +1038,15 @@ RSpec.describe Asciidoctor::Iec do
1012
1038
  INPUT
1013
1039
  html = File.read("test.html", encoding: "utf-8")
1014
1040
  expect(html).to match(%r[\bpre[^{]+\{[^{]+font-family: Andale Mono;]m)
1015
- expect(html).to match(%r[blockquote[^{]+\{[^{]+font-family: Zapf Chancery;]m)
1041
+ expect(html)
1042
+ .to match(%r[blockquote[^{]+\{[^{]+font-family: Zapf Chancery;]m)
1016
1043
  expect(html).to match(%r[\.h2Annex[^{]+\{[^{]+font-family: Comic Sans;]m)
1017
1044
  end
1018
1045
 
1019
1046
  it "strips MS-specific CSS" do
1020
1047
  FileUtils.rm_f "test.html"
1021
1048
  FileUtils.rm_f "test.doc"
1022
- Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)
1049
+ Asciidoctor.convert(<<~"INPUT", *OPTIONS)
1023
1050
  = Document title
1024
1051
  Author
1025
1052
  :docfile: test.adoc