metanorma-cc 1.5.1 → 1.5.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b777189df0dcda0fc49be5e385efb30eba5cc182f5cd0461adf8bd5d05c2ed78
4
- data.tar.gz: 698ee6cae298e5f62b5685f91f3e98065d1eddf60ef2c7c5ca0a839677219774
3
+ metadata.gz: 13bb4442419db1277c5d11c20f3cf73e55b27543745751ae067be33c84e30ac1
4
+ data.tar.gz: cd78dfa7fc1e9df9bcf610d818c815a01cd2586b3fe46cf65a6a5b6099f486a9
5
5
  SHA512:
6
- metadata.gz: d7f991613a144f45a42794374726472da11a6471b221cb99fa23f11cd07098620b33473c3f464bfce4950fcf52c90cb4034f15c7fd91c12d095bb7b00ab79869
7
- data.tar.gz: 5d842773cad0f757cd80074a8a8cbf4620d634066ced880298f2d1e73198c96fc7b3f0d86b8eafb0eebd5f787d1b14d6a39d802d3482b23ffe8a5379bfd0d04f
6
+ metadata.gz: 8dd90a97cb1c104006ed3380cb60b708a70404e16d37be00a94f3393214cf95403dca3815d92aec2f14d845bbcbf0205801f529727b7eefa56e97df917fe0f68
7
+ data.tar.gz: d93fb0ef39b670cc63d44999dc84168e827677ca37c8bdb8a0ccbc1d9d4af87c2347cd538dbe900cfeee5e52f6a66c82de326bfe7019de19f83dac9a21cbde48
@@ -33,7 +33,7 @@ module Asciidoctor
33
33
 
34
34
  def prefix_id(node)
35
35
  prefix = "CC"
36
- typesuffix = ::Metanorma::CC::DOCSUFFIX[node.attr("doctype")] || ""
36
+ typesuffix = ::Metanorma::CC::DOCSUFFIX[doctype(node)] || ""
37
37
  prefix += "/#{typesuffix}" unless typesuffix.empty?
38
38
  status = ::Metanorma::CC::DOCSTATUS[node.attr("status")] || ""
39
39
  prefix += "/#{status}" unless status.empty?
@@ -50,11 +50,14 @@ module Asciidoctor
50
50
  xml.docnumber node.attr("docnumber")
51
51
  end
52
52
 
53
+ @log_doctype = false
54
+
53
55
  def doctype(node)
54
- d = node.attr("doctype")
55
- unless ::Metanorma::CC::DOCSUFFIX.keys.include?(d)
56
+ d = super
57
+ unless ::Metanorma::CC::DOCSUFFIX.keys.include?(d) && !@log_doctype
56
58
  @log.add("Document Attributes", nil,
57
59
  "#{d} is not a legal document type: reverting to 'standard'")
60
+ @log_doctype = true
58
61
  d = "standard"
59
62
  end
60
63
  d
@@ -42,8 +42,11 @@
42
42
  </define>
43
43
  <define name="xref">
44
44
  <element name="xref">
45
+ <!-- attribute target { xsd:IDREF }, -->
45
46
  <attribute name="target">
46
- <data type="IDREF"/>
47
+ <data type="string">
48
+ <param name="pattern">\i\c*|\c+#\c+</param>
49
+ </data>
47
50
  </attribute>
48
51
  <optional>
49
52
  <attribute name="type">
@@ -2081,14 +2081,36 @@
2081
2081
  <fo:table-cell>
2082
2082
  <fo:block>
2083
2083
 
2084
-
2084
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2085
+ <xsl:if test="local-name(*[1]) != 'stem'">
2086
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2087
+ </xsl:if>
2088
+ </xsl:if> -->
2085
2089
 
2086
2090
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2087
2091
 
2088
2092
  </fo:block>
2089
2093
  </fo:table-cell>
2090
2094
  </fo:table-row>
2091
-
2095
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2096
+ <xsl:if test="local-name(*[1]) = 'stem'">
2097
+ <fo:table-row>
2098
+ <fo:table-cell>
2099
+ <fo:block margin-top="6pt">
2100
+ <xsl:if test="normalize-space($key_iso) = 'true'">
2101
+ <xsl:attribute name="margin-top">0</xsl:attribute>
2102
+ </xsl:if>
2103
+ <xsl:text>&#xA0;</xsl:text>
2104
+ </fo:block>
2105
+ </fo:table-cell>
2106
+ <fo:table-cell>
2107
+ <fo:block>
2108
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2109
+ </fo:block>
2110
+ </fo:table-cell>
2111
+ </fo:table-row>
2112
+ </xsl:if>
2113
+ </xsl:if> -->
2092
2114
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
2093
2115
  <xsl:apply-templates/>
2094
2116
  </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
@@ -2836,22 +2858,30 @@
2836
2858
  </fo:block>
2837
2859
  </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
2838
2860
  <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
2861
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
2862
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2863
+ </xsl:if>
2839
2864
  <fo:block-container margin-left="0mm" margin-right="0mm">
2840
- <fo:table id="{@id}" table-layout="fixed" width="100%" border="0pt solid black">
2865
+ <fo:table id="{@id}" table-layout="fixed" width="100%" border="1pt solid black">
2866
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
2867
+ <xsl:attribute name="border">0.5pt solid black</xsl:attribute>
2868
+ </xsl:if>
2841
2869
  <xsl:variable name="simple-table">
2842
2870
  <xsl:call-template name="getSimpleTable"/>
2843
2871
  </xsl:variable>
2844
2872
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
2845
2873
  <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
2846
- <fo:table-column column-width="35mm"/>
2847
- <fo:table-column column-width="115mm"/>
2874
+ <!-- <fo:table-column column-width="35mm"/>
2875
+ <fo:table-column column-width="115mm"/> -->
2876
+ <fo:table-column column-width="25%"/>
2877
+ <fo:table-column column-width="75%"/>
2848
2878
  </xsl:if>
2849
2879
  <xsl:apply-templates mode="requirement"/>
2850
2880
  </fo:table>
2851
2881
  <!-- fn processing -->
2852
2882
  <xsl:if test=".//*[local-name() = 'fn']">
2853
2883
  <xsl:for-each select="*[local-name() = 'tbody']">
2854
- <fo:block font-size="90%" border-bottom="1.pt solid black">
2884
+ <fo:block font-size="90%" border-bottom="1pt solid black">
2855
2885
  <xsl:call-template name="fn_display"/>
2856
2886
  </fo:block>
2857
2887
  </xsl:for-each>
@@ -2867,17 +2897,20 @@
2867
2897
  <xsl:apply-templates mode="requirement"/>
2868
2898
  </fo:table-body>
2869
2899
  </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
2870
- <fo:table-row>
2900
+ <fo:table-row height="7mm">
2901
+ <xsl:if test="parent::*[local-name()='thead'] and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission'])">
2902
+ <xsl:attribute name="border">1pt solid black</xsl:attribute>
2903
+ </xsl:if>
2871
2904
  <xsl:apply-templates mode="requirement"/>
2872
2905
  </fo:table-row>
2873
2906
  </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
2874
- <fo:table-cell text-align="{@align}">
2907
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm" border="0.5pt solid black">
2875
2908
  <xsl:attribute name="text-align">
2876
2909
  <xsl:choose>
2877
2910
  <xsl:when test="@align">
2878
2911
  <xsl:value-of select="@align"/>
2879
2912
  </xsl:when>
2880
- <xsl:otherwise>center</xsl:otherwise>
2913
+ <xsl:otherwise>left</xsl:otherwise>
2881
2914
  </xsl:choose>
2882
2915
  </xsl:attribute>
2883
2916
  <xsl:if test="@colspan">
@@ -2891,21 +2924,25 @@
2891
2924
  </xsl:attribute>
2892
2925
  </xsl:if>
2893
2926
 
2894
- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
2927
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
2895
2928
  <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2896
2929
  <xsl:attribute name="background-color">rgb(165, 165, 165)</xsl:attribute>
2897
2930
  </xsl:if>
2898
2931
  <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommendtest'">
2899
2932
  <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2900
2933
  <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
2901
- </xsl:if>
2934
+ </xsl:if> -->
2902
2935
 
2903
2936
  <fo:block>
2904
2937
  <xsl:apply-templates/>
2905
2938
  </fo:block>
2906
2939
  </fo:table-cell>
2907
2940
  </xsl:template><xsl:template match="*[local-name()='td']" mode="requirement">
2908
- <fo:table-cell text-align="{@align}">
2941
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm" border="0.5pt solid black">
2942
+ <xsl:if test="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
2943
+ <xsl:attribute name="padding">0mm</xsl:attribute>
2944
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
2945
+ </xsl:if>
2909
2946
  <xsl:attribute name="text-align">
2910
2947
  <xsl:choose>
2911
2948
  <xsl:when test="@align">
@@ -2925,24 +2962,25 @@
2925
2962
  </xsl:attribute>
2926
2963
  </xsl:if>
2927
2964
 
2928
- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
2965
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
2929
2966
  <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
2930
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2931
- <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])"> <!-- 2nd line and below -->
2967
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2968
+ <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])">
2932
2969
  <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
2933
2970
  </xsl:if>
2934
- </xsl:if>
2971
+ </xsl:if> -->
2972
+ <!-- 2nd line and below -->
2935
2973
 
2936
2974
  <fo:block>
2937
2975
  <xsl:apply-templates/>
2938
2976
  </fo:block>
2939
2977
  </fo:table-cell>
2940
2978
  </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
2941
- <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="4pt">
2979
+ <fo:block font-size="11pt" font-weight="bold"> <!-- margin-bottom="4pt" text-align="center" -->
2942
2980
  <xsl:apply-templates/>
2943
2981
  </fo:block>
2944
- </xsl:template><xsl:template match="*[local-name() = 'p'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
2945
- <fo:block margin-bottom="10pt">
2982
+ </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
2983
+ <fo:block> <!-- margin-bottom="10pt" -->
2946
2984
  <xsl:apply-templates/>
2947
2985
  </fo:block>
2948
2986
  </xsl:template><xsl:template match="*[local-name() = 'termexample']">
@@ -3280,6 +3318,44 @@
3280
3318
  <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
3281
3319
  <fo:block><xsl:apply-templates/></fo:block>
3282
3320
  </fo:table-cell>
3321
+ </xsl:template><xsl:template name="processBibitem">
3322
+
3323
+ </xsl:template><xsl:template name="processPersonalAuthor">
3324
+ <xsl:choose>
3325
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
3326
+ <author>
3327
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
3328
+ </author>
3329
+ </xsl:when>
3330
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
3331
+ <author>
3332
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
3333
+ <xsl:text> </xsl:text>
3334
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
3335
+ </author>
3336
+ </xsl:when>
3337
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']">
3338
+ <author>
3339
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
3340
+ <xsl:text> </xsl:text>
3341
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
3342
+ </author>
3343
+ </xsl:when>
3344
+ <xsl:otherwise>
3345
+ <xsl:apply-templates/>
3346
+ </xsl:otherwise>
3347
+ </xsl:choose>
3348
+ </xsl:template><xsl:template name="renderDate">
3349
+ <xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
3350
+ <xsl:value-of select="*[local-name() = 'on']"/>
3351
+ </xsl:if>
3352
+ <xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
3353
+ <xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
3354
+ </xsl:if>
3355
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
3356
+ <xsl:value-of select="translate(.,'. ','')"/>
3357
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
3358
+ <xsl:value-of select="substring(.,1,1)"/>
3283
3359
  </xsl:template><xsl:template name="convertDate">
3284
3360
  <xsl:param name="date"/>
3285
3361
  <xsl:param name="format" select="'short'"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module CC
3
- VERSION = "1.5.1"
3
+ VERSION = "1.5.2"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-cc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.5.1
4
+ version: 1.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-08-14 00:00:00.000000000 Z
11
+ date: 2020-08-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc