metanorma-iec 1.2.13 → 1.2.14

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: da6ad61eab0892f2e07d9b8d873eee4316295b203cfb72c2633e044756a9e9a7
4
- data.tar.gz: 53ab2f3431293cded98808c721ccc3031430cf550f51ec41e4e1ae8586194140
3
+ metadata.gz: 725593d432b4bdf162ce9becf5bc50c28e8229fbb53f3c0a55c9c1e707d22035
4
+ data.tar.gz: 1c800a5db3bec0431e04a79dbe404824e5d61194fba0be755bbeca5d6080ecd7
5
5
  SHA512:
6
- metadata.gz: dc20a397df9f1578b979898aeccaba321733ef2d0c316a7b7e28215ea8015ff1d5e3791b730928dd6c5a564c5d635bf61be0b47cff4808906532430474fd0b4a
7
- data.tar.gz: 0b0a5b94455b97132e7837d640c73cddb5b12f81a6dd2240610284c0866c4e0eb93dc87fd41f29ac2d4877e9a843206593aa49da02277b5a42830f2eb4f51b1c
6
+ metadata.gz: 200972ebddea38cfd18c561f1a3272032a16c1e86435a7706991ed8db21206957dbec96e237ec4cb53eee5695b7fde06cf09369fb3d9365dc984897b213b2531
7
+ data.tar.gz: 9d42cf2e4c263e83e10ff53d965b88a4bb88bca7869cf768c08119b02a6aec5b9824f77c70d578c9fca06373857b1c24762e18ab07068fd10a5e87d3c6b63073
data/.rubocop.yml CHANGED
@@ -4,7 +4,3 @@
4
4
 
5
5
  inherit_from:
6
6
  - https://raw.githubusercontent.com/riboseinc/oss-guides/master/ci/rubocop.yml
7
- AllCops:
8
- TargetRubyVersion: 2.3
9
- Rails:
10
- Enabled: true
@@ -812,6 +812,8 @@
812
812
  <ref name="requirement"/>
813
813
  <ref name="recommendation"/>
814
814
  <ref name="permission"/>
815
+ <ref name="imagemap"/>
816
+ <ref name="svgmap"/>
815
817
  </choice>
816
818
  </define>
817
819
  <define name="bibliography">
@@ -1635,4 +1637,65 @@
1635
1637
  <text/>
1636
1638
  </element>
1637
1639
  </define>
1640
+ <define name="imagemap">
1641
+ <element name="imagemap">
1642
+ <ref name="figure"/>
1643
+ <zeroOrMore>
1644
+ <element name="area">
1645
+ <attribute name="type">
1646
+ <choice>
1647
+ <value>rect</value>
1648
+ <value>circle</value>
1649
+ <value>ellipse</value>
1650
+ <value>poly</value>
1651
+ </choice>
1652
+ </attribute>
1653
+ <choice>
1654
+ <ref name="xref"/>
1655
+ <ref name="hyperlink"/>
1656
+ <ref name="eref"/>
1657
+ </choice>
1658
+ <oneOrMore>
1659
+ <element name="coords">
1660
+ <attribute name="x">
1661
+ <data type="float"/>
1662
+ </attribute>
1663
+ <attribute name="y">
1664
+ <data type="float"/>
1665
+ </attribute>
1666
+ </element>
1667
+ </oneOrMore>
1668
+ <optional>
1669
+ <element name="radius">
1670
+ <attribute name="x">
1671
+ <data type="float"/>
1672
+ </attribute>
1673
+ <optional>
1674
+ <attribute name="y">
1675
+ <data type="float"/>
1676
+ </attribute>
1677
+ </optional>
1678
+ </element>
1679
+ </optional>
1680
+ </element>
1681
+ </zeroOrMore>
1682
+ </element>
1683
+ </define>
1684
+ <define name="svgmap">
1685
+ <element name="svgmap">
1686
+ <ref name="figure"/>
1687
+ <zeroOrMore>
1688
+ <element name="target">
1689
+ <attribute name="href">
1690
+ <data type="anyURI"/>
1691
+ </attribute>
1692
+ <choice>
1693
+ <ref name="xref"/>
1694
+ <ref name="hyperlink"/>
1695
+ <ref name="eref"/>
1696
+ </choice>
1697
+ </element>
1698
+ </zeroOrMore>
1699
+ </element>
1700
+ </define>
1638
1701
  </grammar>
@@ -2997,201 +2997,235 @@
2997
2997
  <xsl:call-template name="add-zero-spaces-java"/>
2998
2998
  </xsl:template><xsl:template match="*[local-name()='table']" name="table">
2999
2999
 
3000
- <xsl:variable name="simple-table">
3001
- <xsl:call-template name="getSimpleTable"/>
3002
- </xsl:variable>
3000
+ <xsl:variable name="table">
3003
3001
 
3004
-
3005
-
3006
-
3007
-
3008
- <!-- <xsl:if test="$namespace = 'bipm'">
3009
- <fo:block>&#xA0;</fo:block>
3010
- </xsl:if> -->
3011
-
3012
- <!-- $namespace = 'iso' or -->
3013
-
3014
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3015
-
3016
-
3017
-
3018
- <xsl:call-template name="fn_name_display"/>
3002
+ <xsl:variable name="simple-table">
3003
+ <xsl:call-template name="getSimpleTable"/>
3004
+ </xsl:variable>
3019
3005
 
3020
3006
 
3021
-
3022
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
3023
-
3024
- <!-- <xsl:variable name="cols-count">
3025
- <xsl:choose>
3026
- <xsl:when test="*[local-name()='thead']">
3027
- <xsl:call-template name="calculate-columns-numbers">
3028
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
3029
- </xsl:call-template>
3030
- </xsl:when>
3031
- <xsl:otherwise>
3032
- <xsl:call-template name="calculate-columns-numbers">
3033
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
3034
- </xsl:call-template>
3035
- </xsl:otherwise>
3036
- </xsl:choose>
3037
- </xsl:variable> -->
3038
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
3039
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
3040
-
3041
-
3042
-
3043
- <xsl:variable name="colwidths">
3044
- <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
3045
- <xsl:call-template name="calculate-column-widths">
3046
- <xsl:with-param name="cols-count" select="$cols-count"/>
3047
- <xsl:with-param name="table" select="$simple-table"/>
3048
- </xsl:call-template>
3049
- </xsl:if>
3050
- </xsl:variable>
3051
- <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
3052
-
3053
- <!-- <xsl:variable name="colwidths2">
3054
- <xsl:call-template name="calculate-column-widths">
3055
- <xsl:with-param name="cols-count" select="$cols-count"/>
3056
- </xsl:call-template>
3057
- </xsl:variable> -->
3058
-
3059
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
3060
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
3061
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
3062
-
3063
- <xsl:variable name="margin-left">
3064
- <xsl:choose>
3065
- <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
3066
- <xsl:otherwise>0</xsl:otherwise>
3067
- </xsl:choose>
3068
- </xsl:variable>
3069
-
3070
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
3071
3007
 
3072
3008
 
3073
3009
 
3074
- <xsl:attribute name="font-size">8pt</xsl:attribute>
3075
- <xsl:attribute name="space-after">12pt</xsl:attribute>
3076
- <xsl:if test="ancestor::*[local-name() = 'preface']">
3077
- <xsl:attribute name="space-after">16pt</xsl:attribute>
3078
- </xsl:if>
3079
-
3080
-
3081
-
3010
+ <!-- <xsl:if test="$namespace = 'bipm'">
3011
+ <fo:block>&#xA0;</fo:block>
3012
+ </xsl:if> -->
3082
3013
 
3014
+ <!-- $namespace = 'iso' or -->
3083
3015
 
3084
-
3016
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3085
3017
 
3018
+
3086
3019
 
3020
+ <xsl:call-template name="fn_name_display"/>
3087
3021
 
3022
+
3088
3023
 
3024
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
3089
3025
 
3026
+ <!-- <xsl:variable name="cols-count">
3027
+ <xsl:choose>
3028
+ <xsl:when test="*[local-name()='thead']">
3029
+ <xsl:call-template name="calculate-columns-numbers">
3030
+ <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
3031
+ </xsl:call-template>
3032
+ </xsl:when>
3033
+ <xsl:otherwise>
3034
+ <xsl:call-template name="calculate-columns-numbers">
3035
+ <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
3036
+ </xsl:call-template>
3037
+ </xsl:otherwise>
3038
+ </xsl:choose>
3039
+ </xsl:variable> -->
3040
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
3041
+ <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
3090
3042
 
3091
3043
 
3092
- <xsl:variable name="table_attributes">
3093
- <attribute name="table-layout">fixed</attribute>
3094
- <attribute name="width">
3095
- <xsl:choose>
3096
- <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
3097
- <xsl:otherwise>100%</xsl:otherwise>
3098
- </xsl:choose>
3099
- </attribute>
3100
- <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
3101
- <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
3044
+
3045
+ <xsl:variable name="colwidths">
3046
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
3047
+ <xsl:call-template name="calculate-column-widths">
3048
+ <xsl:with-param name="cols-count" select="$cols-count"/>
3049
+ <xsl:with-param name="table" select="$simple-table"/>
3050
+ </xsl:call-template>
3051
+ </xsl:if>
3052
+ </xsl:variable>
3053
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
3054
+
3055
+ <!-- <xsl:variable name="colwidths2">
3056
+ <xsl:call-template name="calculate-column-widths">
3057
+ <xsl:with-param name="cols-count" select="$cols-count"/>
3058
+ </xsl:call-template>
3059
+ </xsl:variable> -->
3060
+
3061
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/>
3062
+ colwidthsNew=<xsl:copy-of select="$colwidths"/>
3063
+ colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
3064
+
3065
+ <xsl:variable name="margin-left">
3066
+ <xsl:choose>
3067
+ <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
3068
+ <xsl:otherwise>0</xsl:otherwise>
3069
+ </xsl:choose>
3070
+ </xsl:variable>
3071
+
3072
+ <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
3102
3073
 
3103
3074
 
3104
- <attribute name="border">0.5pt solid black</attribute>
3105
3075
 
3076
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
3077
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
3078
+ <xsl:if test="ancestor::*[local-name() = 'preface']">
3079
+ <xsl:attribute name="space-after">16pt</xsl:attribute>
3080
+ </xsl:if>
3081
+
3082
+
3083
+
3106
3084
 
3107
3085
 
3108
-
3109
-
3110
-
3086
+
3111
3087
 
3112
-
3113
3088
 
3114
- </xsl:variable>
3115
-
3116
-
3117
- <fo:table id="{@id}" table-omit-footer-at-break="true">
3118
3089
 
3119
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
3120
- <xsl:attribute name="{@name}">
3121
- <xsl:value-of select="."/>
3122
- </xsl:attribute>
3123
- </xsl:for-each>
3124
3090
 
3125
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
3126
- <xsl:if test="$isNoteOrFnExist = 'true'">
3127
- <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
3128
- </xsl:if>
3129
3091
 
3130
- <xsl:choose>
3131
- <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
3132
- <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
3133
- <fo:table-column column-width="{@width}"/>
3134
- </xsl:for-each>
3135
- </xsl:when>
3136
- <xsl:otherwise>
3137
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
3138
- <xsl:choose>
3139
- <xsl:when test=". = 1 or . = 0">
3140
- <fo:table-column column-width="proportional-column-width(2)"/>
3141
- </xsl:when>
3142
- <xsl:otherwise>
3143
- <fo:table-column column-width="proportional-column-width({.})"/>
3144
- </xsl:otherwise>
3145
- </xsl:choose>
3146
- </xsl:for-each>
3147
- </xsl:otherwise>
3148
- </xsl:choose>
3149
3092
 
3150
- <xsl:choose>
3151
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
3152
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
3153
- </xsl:when>
3154
- <xsl:otherwise>
3155
- <xsl:apply-templates/>
3156
- </xsl:otherwise>
3157
- </xsl:choose>
3093
+ <xsl:variable name="table_width">
3094
+ <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
3095
+ 100%
3096
+
3097
+
3098
+ </xsl:variable>
3099
+
3100
+ <xsl:variable name="table_attributes">
3101
+ <attribute name="table-layout">fixed</attribute>
3102
+ <attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
3103
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
3104
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
3105
+
3106
+
3107
+ <attribute name="border">0.5pt solid black</attribute>
3108
+
3109
+
3110
+
3111
+
3112
+
3113
+
3114
+
3115
+
3116
+
3117
+ </xsl:variable>
3158
3118
 
3159
- </fo:table>
3160
-
3161
- <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
3162
- <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
3163
- <xsl:call-template name="insertTableFooterInSeparateTable">
3164
- <xsl:with-param name="table_attributes" select="$table_attributes"/>
3165
- <xsl:with-param name="colwidths" select="$colwidths"/>
3166
- <xsl:with-param name="colgroup" select="$colgroup"/>
3167
- </xsl:call-template>
3168
- </xsl:for-each>
3169
-
3170
- <!-- insert footer as table -->
3171
- <!-- <fo:table>
3172
- <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
3173
- <xsl:attribute name="{@name}">
3174
- <xsl:value-of select="."/>
3175
- </xsl:attribute>
3176
- </xsl:for-each>
3177
3119
 
3178
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
3120
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
3121
+
3122
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
3123
+ <xsl:attribute name="{@name}">
3124
+ <xsl:value-of select="."/>
3125
+ </xsl:attribute>
3126
+ </xsl:for-each>
3127
+
3128
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
3129
+ <xsl:if test="$isNoteOrFnExist = 'true'">
3130
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
3131
+ </xsl:if>
3132
+
3133
+ <xsl:choose>
3134
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
3135
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
3136
+ <fo:table-column column-width="{@width}"/>
3137
+ </xsl:for-each>
3138
+ </xsl:when>
3139
+ <xsl:otherwise>
3140
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
3141
+ <xsl:choose>
3142
+ <xsl:when test=". = 1 or . = 0">
3143
+ <fo:table-column column-width="proportional-column-width(2)"/>
3144
+ </xsl:when>
3145
+ <xsl:otherwise>
3146
+ <fo:table-column column-width="proportional-column-width({.})"/>
3147
+ </xsl:otherwise>
3148
+ </xsl:choose>
3149
+ </xsl:for-each>
3150
+ </xsl:otherwise>
3151
+ </xsl:choose>
3152
+
3179
3153
  <xsl:choose>
3180
- <xsl:when test=". = 1 or . = 0">
3181
- <fo:table-column column-width="proportional-column-width(2)"/>
3154
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
3155
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
3182
3156
  </xsl:when>
3183
3157
  <xsl:otherwise>
3184
- <fo:table-column column-width="proportional-column-width({.})"/>
3158
+ <xsl:apply-templates/>
3185
3159
  </xsl:otherwise>
3186
3160
  </xsl:choose>
3161
+
3162
+ </fo:table>
3163
+
3164
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
3165
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
3166
+ <xsl:call-template name="insertTableFooterInSeparateTable">
3167
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
3168
+ <xsl:with-param name="colwidths" select="$colwidths"/>
3169
+ <xsl:with-param name="colgroup" select="$colgroup"/>
3170
+ </xsl:call-template>
3187
3171
  </xsl:for-each>
3188
- </fo:table>-->
3189
-
3190
-
3191
-
3192
-
3193
-
3194
- </fo:block-container>
3172
+
3173
+ <!-- insert footer as table -->
3174
+ <!-- <fo:table>
3175
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
3176
+ <xsl:attribute name="{@name}">
3177
+ <xsl:value-of select="."/>
3178
+ </xsl:attribute>
3179
+ </xsl:for-each>
3180
+
3181
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
3182
+ <xsl:choose>
3183
+ <xsl:when test=". = 1 or . = 0">
3184
+ <fo:table-column column-width="proportional-column-width(2)"/>
3185
+ </xsl:when>
3186
+ <xsl:otherwise>
3187
+ <fo:table-column column-width="proportional-column-width({.})"/>
3188
+ </xsl:otherwise>
3189
+ </xsl:choose>
3190
+ </xsl:for-each>
3191
+ </fo:table>-->
3192
+
3193
+
3194
+
3195
+
3196
+
3197
+ </fo:block-container>
3198
+ </xsl:variable>
3199
+
3200
+
3201
+
3202
+ <xsl:choose>
3203
+ <xsl:when test="@width">
3204
+
3205
+ <!-- centered table when table name is centered (see table-name-style) -->
3206
+
3207
+ <fo:table table-layout="fixed" width="100%">
3208
+ <fo:table-column column-width="proportional-column-width(1)"/>
3209
+ <fo:table-column column-width="{@width}"/>
3210
+ <fo:table-column column-width="proportional-column-width(1)"/>
3211
+ <fo:table-body>
3212
+ <fo:table-row>
3213
+ <fo:table-cell column-number="2">
3214
+ <fo:block><xsl:copy-of select="$table"/></fo:block>
3215
+ </fo:table-cell>
3216
+ </fo:table-row>
3217
+ </fo:table-body>
3218
+ </fo:table>
3219
+
3220
+
3221
+
3222
+
3223
+ </xsl:when>
3224
+ <xsl:otherwise>
3225
+ <xsl:copy-of select="$table"/>
3226
+ </xsl:otherwise>
3227
+ </xsl:choose>
3228
+
3195
3229
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
3196
3230
  <xsl:if test="normalize-space() != ''">
3197
3231
  <fo:block xsl:use-attribute-sets="table-name-style">
@@ -4093,7 +4127,7 @@
4093
4127
  <xsl:with-param name="table" select="$html-table"/>
4094
4128
  </xsl:call-template>
4095
4129
  </xsl:variable>
4096
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
4130
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
4097
4131
  <xsl:variable name="maxlength_dt">
4098
4132
  <xsl:call-template name="getMaxLength_dt"/>
4099
4133
  </xsl:variable>
@@ -4122,13 +4156,22 @@
4122
4156
  </xsl:when>
4123
4157
  <xsl:otherwise>
4124
4158
  <xsl:choose>
4159
+ <!-- to set width check most wide chars like `W` -->
4125
4160
  <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 2"> <!-- if dt contains short text like t90, a, etc -->
4126
- <fo:table-column column-width="5%"/>
4127
- <fo:table-column column-width="95%"/>
4161
+ <fo:table-column column-width="7%"/>
4162
+ <fo:table-column column-width="93%"/>
4163
+ </xsl:when>
4164
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like ABC, etc -->
4165
+ <fo:table-column column-width="15%"/>
4166
+ <fo:table-column column-width="85%"/>
4128
4167
  </xsl:when>
4129
- <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like t90, a, etc -->
4130
- <fo:table-column column-width="10%"/>
4131
- <fo:table-column column-width="90%"/>
4168
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 7"> <!-- if dt contains short text like ABCDEF, etc -->
4169
+ <fo:table-column column-width="20%"/>
4170
+ <fo:table-column column-width="80%"/>
4171
+ </xsl:when>
4172
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 10"> <!-- if dt contains short text like ABCDEFEF, etc -->
4173
+ <fo:table-column column-width="25%"/>
4174
+ <fo:table-column column-width="75%"/>
4132
4175
  </xsl:when>
4133
4176
  <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
4134
4177
  <fo:table-column column-width="60%"/>
@@ -4439,6 +4482,10 @@
4439
4482
  <xsl:param name="text" select="."/>
4440
4483
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
4441
4484
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1​')"/>
4485
+ </xsl:template><xsl:template name="add-zero-spaces-link-java">
4486
+ <xsl:param name="text" select="."/>
4487
+ <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
4488
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
4442
4489
  </xsl:template><xsl:template name="add-zero-spaces">
4443
4490
  <xsl:param name="text" select="."/>
4444
4491
  <xsl:variable name="zero-space-after-chars">-</xsl:variable>
@@ -4699,6 +4746,11 @@
4699
4746
  <!-- replace start and end spaces to non-break space -->
4700
4747
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
4701
4748
  </xsl:copy>
4749
+ </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
4750
+ <xsl:copy>
4751
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
4752
+ </xsl:copy>
4753
+ <mathml:mspace width="0.5ex"/>
4702
4754
  </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
4703
4755
  <xsl:variable name="target">
4704
4756
  <xsl:choose>
@@ -4724,7 +4776,10 @@
4724
4776
  <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
4725
4777
  <xsl:choose>
4726
4778
  <xsl:when test="normalize-space(.) = ''">
4727
- <xsl:value-of select="$target"/>
4779
+ <!-- <xsl:value-of select="$target"/> -->
4780
+ <xsl:call-template name="add-zero-spaces-link-java">
4781
+ <xsl:with-param name="text" select="$target"/>
4782
+ </xsl:call-template>
4728
4783
  </xsl:when>
4729
4784
  <xsl:otherwise>
4730
4785
  <xsl:apply-templates/>
@@ -5197,6 +5252,8 @@
5197
5252
  <xsl:copy>
5198
5253
  <xsl:apply-templates mode="contents_item"/>
5199
5254
  </xsl:copy>
5255
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents_item">
5256
+ <xsl:copy-of select="."/>
5200
5257
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
5201
5258
  <xsl:text> </xsl:text>
5202
5259
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
@@ -5603,11 +5660,13 @@
5603
5660
  </xsl:if>
5604
5661
  </xsl:if>
5605
5662
 
5663
+
5606
5664
  <fo:block-container margin-left="0mm">
5607
5665
 
5608
5666
  <fo:block xsl:use-attribute-sets="quote-style">
5609
5667
  <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
5610
- <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
5668
+
5669
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
5611
5670
  </fo:block>
5612
5671
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
5613
5672
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -6019,7 +6078,7 @@
6019
6078
  <xsl:param name="charDelim" select="', '"/>
6020
6079
  <xsl:choose>
6021
6080
  <xsl:when test="$sorting = 'true' or $sorting = 'yes'">
6022
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
6081
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
6023
6082
  <xsl:sort data-type="text" order="ascending"/>
6024
6083
  <xsl:call-template name="insertKeyword">
6025
6084
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
@@ -6028,7 +6087,7 @@
6028
6087
  </xsl:for-each>
6029
6088
  </xsl:when>
6030
6089
  <xsl:otherwise>
6031
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
6090
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
6032
6091
  <xsl:call-template name="insertKeyword">
6033
6092
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
6034
6093
  <xsl:with-param name="charDelim" select="$charDelim"/>
@@ -6045,6 +6104,9 @@
6045
6104
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
6046
6105
  </xsl:choose>
6047
6106
  </xsl:template><xsl:template name="addPDFUAmeta">
6107
+ <xsl:variable name="lang">
6108
+ <xsl:call-template name="getLang"/>
6109
+ </xsl:variable>
6048
6110
  <fo:declarations>
6049
6111
  <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
6050
6112
  <pdf:dictionary type="normal" key="ViewerPreferences">
@@ -6057,13 +6119,16 @@
6057
6119
  <!-- Dublin Core properties go here -->
6058
6120
  <dc:title>
6059
6121
  <xsl:variable name="title">
6060
-
6061
- <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en' and @type = 'main']"/>
6062
-
6063
-
6064
-
6065
-
6066
-
6122
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
6123
+
6124
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
6125
+
6126
+
6127
+
6128
+
6129
+
6130
+
6131
+ </xsl:for-each>
6067
6132
  </xsl:variable>
6068
6133
  <xsl:choose>
6069
6134
  <xsl:when test="normalize-space($title) != ''">
@@ -6075,17 +6140,21 @@
6075
6140
  </xsl:choose>
6076
6141
  </dc:title>
6077
6142
  <dc:creator>
6078
-
6079
-
6080
-
6081
- </dc:creator>
6082
- <dc:description>
6083
- <xsl:variable name="abstract">
6143
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
6144
+
6145
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
6146
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
6147
+ <xsl:if test="position() != last()">; </xsl:if>
6148
+ </xsl:for-each>
6084
6149
 
6085
6150
 
6086
- <xsl:copy-of select="/*/*[local-name() = 'bibliography']/*[local-name() = 'references']/*[local-name() = 'bibitem']/*[local-name() = 'abstract'][@language = 'en']//text()"/>
6087
6151
 
6152
+ </xsl:for-each>
6153
+ </dc:creator>
6154
+ <dc:description>
6155
+ <xsl:variable name="abstract">
6088
6156
 
6157
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
6089
6158
 
6090
6159
 
6091
6160
  </xsl:variable>
@@ -1,6 +1,6 @@
1
1
  module Metanorma
2
2
  module Iec
3
- VERSION = "1.2.13"
3
+ VERSION = "1.2.14"
4
4
  end
5
5
  end
6
6
 
@@ -15,41 +15,42 @@ RSpec.describe Asciidoctor::Iec do
15
15
 
16
16
  it "generates error file" do
17
17
  expect do
18
+ mock_pdf
18
19
  Metanorma::Compile
19
20
  .new
20
- .compile("spec/assets/xref_error.adoc", type: "iec", :"agree-to-terms" => true)
21
+ .compile("spec/assets/xref_error.adoc", type: "iec", no_install_fonts: true)
21
22
  end.to(change { File.exist?("spec/assets/xref_error.err") }
22
23
  .from(false).to(true))
23
24
  end
24
25
  end
25
26
 
26
- it "Warns of illegal doctype" do
27
+ it "Warns of illegal doctype" do
27
28
  FileUtils.rm_f "test.err"
28
29
  Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)
29
- = Document title
30
- Author
31
- :docfile: test.adoc
32
- :nodoc:
33
- :no-isobib:
34
- :doctype: pizza
30
+ = Document title
31
+ Author
32
+ :docfile: test.adoc
33
+ :nodoc:
34
+ :no-isobib:
35
+ :doctype: pizza
35
36
 
36
- text
37
- INPUT
37
+ text
38
+ INPUT
38
39
  expect(File.read("test.err")).to include "pizza is not a recognised document type"
39
- end
40
+ end
40
41
 
41
- it "Warns of illegal function" do
42
+ it "Warns of illegal function" do
42
43
  FileUtils.rm_f "test.err"
43
44
  Asciidoctor.convert(<<~"INPUT", backend: :iec, header_footer: true)
44
- = Document title
45
- Author
46
- :docfile: test.adoc
47
- :nodoc:
48
- :no-isobib:
49
- :function: pizza
45
+ = Document title
46
+ Author
47
+ :docfile: test.adoc
48
+ :nodoc:
49
+ :no-isobib:
50
+ :function: pizza
50
51
 
51
- text
52
- INPUT
52
+ text
53
+ INPUT
53
54
  expect(File.read("test.err")).to include "pizza is not a recognised document function"
54
- end
55
+ end
55
56
  end
data/spec/spec_helper.rb CHANGED
@@ -261,6 +261,12 @@ def stub_fetch_ref(**opts)
261
261
  end.at_least :once
262
262
  end
263
263
 
264
+ def mock_pdf
265
+ allow(::Mn2pdf).to receive(:convert) do |url, output, c, d|
266
+ FileUtils.cp(url.gsub(/"/, ""), output.gsub(/"/, ""))
267
+ end
268
+ end
269
+
264
270
  private
265
271
 
266
272
  def get_xml(search, code, opts)
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: 1.2.13
4
+ version: 1.2.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-25 00:00:00.000000000 Z
11
+ date: 2021-02-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-jing
@@ -307,7 +307,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
307
307
  - !ruby/object:Gem::Version
308
308
  version: '0'
309
309
  requirements: []
310
- rubygems_version: 3.0.3
310
+ rubygems_version: 3.1.4
311
311
  signing_key:
312
312
  specification_version: 4
313
313
  summary: metanorma-iec lets you write IEC standards in AsciiDoc.