metanorma-iec 1.3.5 → 1.3.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +1 -1
- data/lib/asciidoctor/iec/isodoc.rng +18 -1
- data/lib/isodoc/iec/iec.international-standard.xsl +306 -46
- data/lib/metanorma/iec/version.rb +1 -1
- data/metanorma-iec.gemspec +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8efe031009d849297cc1ca141ddd5c859f36e132411caca46580c4fe86a04169
|
4
|
+
data.tar.gz: 46c36ffcc548f144d63b88408c69f0237e7f069322ce2b2f3933eed2ad96c4ab
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59f27b9c0b09b4810f917ceb37284ac86643282210d8b85f7e6461ef31092d74a430cdbeef211a1759dfe013b27605a88850c54ced016d0ea0ea35f06f674653
|
7
|
+
data.tar.gz: 2d91c48a9f9dc1e8166af7c79816c98745a4b575de0d791d6728fd4ef17907f58fb198923a71bd58a1cb41d575abd835a13b21fcad5946c7e47aac3f4f72b78f
|
data/.github/workflows/rake.yml
CHANGED
@@ -955,7 +955,24 @@
|
|
955
955
|
<define name="concept">
|
956
956
|
<element name="concept">
|
957
957
|
<optional>
|
958
|
-
<
|
958
|
+
<element name="refterm">
|
959
|
+
<zeroOrMore>
|
960
|
+
<choice>
|
961
|
+
<ref name="PureTextElement"/>
|
962
|
+
<ref name="stem"/>
|
963
|
+
</choice>
|
964
|
+
</zeroOrMore>
|
965
|
+
</element>
|
966
|
+
</optional>
|
967
|
+
<optional>
|
968
|
+
<element name="renderterm">
|
969
|
+
<zeroOrMore>
|
970
|
+
<choice>
|
971
|
+
<ref name="PureTextElement"/>
|
972
|
+
<ref name="stem"/>
|
973
|
+
</choice>
|
974
|
+
</zeroOrMore>
|
975
|
+
</element>
|
959
976
|
</optional>
|
960
977
|
<choice>
|
961
978
|
<ref name="eref"/>
|
@@ -20,8 +20,12 @@
|
|
20
20
|
|
21
21
|
|
22
22
|
<xsl:variable name="debug">false</xsl:variable>
|
23
|
-
<xsl:variable name="pageWidth" select="
|
24
|
-
<xsl:variable name="pageHeight" select="
|
23
|
+
<xsl:variable name="pageWidth" select="210"/>
|
24
|
+
<xsl:variable name="pageHeight" select="297"/>
|
25
|
+
<xsl:variable name="marginLeftRight1" select="25"/>
|
26
|
+
<xsl:variable name="marginLeftRight2" select="25"/>
|
27
|
+
<xsl:variable name="marginTop" select="31"/>
|
28
|
+
<xsl:variable name="marginBottom" select="15"/>
|
25
29
|
|
26
30
|
<xsl:variable name="copyrightText" select="concat('© ', //iec:iec-standard/iec:bibdata/iec:copyright/iec:owner/iec:organization/iec:abbreviation, ':', //iec:iec-standard/iec:bibdata/iec:copyright/iec:from)"/>
|
27
31
|
<!-- <xsl:variable name="lang-1st-letter" select="concat('(', translate(substring(iec:iec-standard/iec:bibdata/iec:language,1,1),$lower, $upper), ')')"/> -->
|
@@ -160,14 +164,14 @@
|
|
160
164
|
<fo:root font-family="Arial, Times New Roman, STIX Two Math, Source Han Sans" font-size="10pt" xml:lang="{$lang}">
|
161
165
|
<fo:layout-master-set>
|
162
166
|
<!-- cover pages -->
|
163
|
-
<fo:simple-page-master master-name="cover" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
167
|
+
<fo:simple-page-master master-name="cover" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
164
168
|
<fo:region-body margin-top="17.5mm" margin-bottom="12.5mm" margin-left="18mm" margin-right="20.5mm"/>
|
165
169
|
<fo:region-before region-name="header" extent="17.5mm"/>
|
166
170
|
<fo:region-after region-name="footer" extent="12.5mm" precedence="true"/>
|
167
171
|
<fo:region-start region-name="left-region" extent="18mm"/>
|
168
172
|
<fo:region-end region-name="right-region" extent="20.5mm"/>
|
169
173
|
</fo:simple-page-master>
|
170
|
-
<fo:simple-page-master master-name="cover_2nd" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
174
|
+
<fo:simple-page-master master-name="cover_2nd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
171
175
|
<fo:region-body margin-top="17.5mm" margin-bottom="12.5mm" margin-left="25mm" margin-right="25mm" column-count="2" column-gap="5mm"/>
|
172
176
|
<fo:region-before region-name="header" extent="17.5mm"/>
|
173
177
|
<fo:region-after region-name="footer" extent="12.5mm" precedence="true"/>
|
@@ -175,7 +179,7 @@
|
|
175
179
|
<fo:region-end region-name="right-region" extent="25mm"/>
|
176
180
|
</fo:simple-page-master>
|
177
181
|
|
178
|
-
<fo:simple-page-master master-name="cover-FDIS" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
182
|
+
<fo:simple-page-master master-name="cover-FDIS" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
179
183
|
<fo:region-body margin-top="17.5mm" margin-bottom="29mm" margin-left="18mm" margin-right="19mm"/>
|
180
184
|
<fo:region-before region-name="header" extent="17.5mm"/>
|
181
185
|
<fo:region-after region-name="footer-FDIS" extent="29mm"/>
|
@@ -184,20 +188,20 @@
|
|
184
188
|
</fo:simple-page-master>
|
185
189
|
|
186
190
|
<!-- odd pages -->
|
187
|
-
<fo:simple-page-master master-name="odd" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
188
|
-
<fo:region-body margin-top="
|
189
|
-
<fo:region-before region-name="header-odd" extent="
|
190
|
-
<fo:region-after region-name="footer" extent="
|
191
|
-
<fo:region-start region-name="left-region" extent="
|
192
|
-
<fo:region-end region-name="right-region" extent="
|
191
|
+
<fo:simple-page-master master-name="odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
192
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
|
193
|
+
<fo:region-before region-name="header-odd" extent="{$marginTop}mm"/>
|
194
|
+
<fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
|
195
|
+
<fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
|
196
|
+
<fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
|
193
197
|
</fo:simple-page-master>
|
194
198
|
<!-- even pages -->
|
195
|
-
<fo:simple-page-master master-name="even" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
196
|
-
<fo:region-body margin-top="
|
197
|
-
<fo:region-before region-name="header-even" extent="
|
198
|
-
<fo:region-after region-name="footer" extent="
|
199
|
-
<fo:region-start region-name="left-region" extent="
|
200
|
-
<fo:region-end region-name="right-region" extent="
|
199
|
+
<fo:simple-page-master master-name="even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
200
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
|
201
|
+
<fo:region-before region-name="header-even" extent="{$marginTop}mm"/>
|
202
|
+
<fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
|
203
|
+
<fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
|
204
|
+
<fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
|
201
205
|
</fo:simple-page-master>
|
202
206
|
<fo:page-sequence-master master-name="document">
|
203
207
|
<fo:repeatable-page-master-alternatives>
|
@@ -206,11 +210,11 @@
|
|
206
210
|
</fo:repeatable-page-master-alternatives>
|
207
211
|
</fo:page-sequence-master>
|
208
212
|
|
209
|
-
<fo:simple-page-master master-name="blank-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
213
|
+
<fo:simple-page-master master-name="blank-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
210
214
|
<fo:region-body margin-top="107mm" margin-bottom="0mm" margin-left="18mm" margin-right="0mm"/>
|
211
215
|
</fo:simple-page-master>
|
212
216
|
|
213
|
-
<fo:simple-page-master master-name="last-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
217
|
+
<fo:simple-page-master master-name="last-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
214
218
|
<fo:region-body margin-top="107mm" margin-bottom="0mm" margin-left="18mm" margin-right="0mm" background-color="rgb(236, 236, 236)"/>
|
215
219
|
<fo:region-before region-name="header" extent="107mm"/>
|
216
220
|
<fo:region-start region-name="left-region" extent="18mm"/>
|
@@ -2804,6 +2808,7 @@
|
|
2804
2808
|
|
2805
2809
|
|
2806
2810
|
|
2811
|
+
|
2807
2812
|
</xsl:attribute-set><xsl:attribute-set name="note-style">
|
2808
2813
|
|
2809
2814
|
|
@@ -3026,14 +3031,15 @@
|
|
3026
3031
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
|
3027
3032
|
|
3028
3033
|
<!-- Normative references -->
|
3029
|
-
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
|
3034
|
+
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]" mode="contents"/>
|
3030
3035
|
<!-- Terms and definitions -->
|
3031
3036
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]" mode="contents"/>
|
3032
3037
|
<!-- Another main sections -->
|
3033
3038
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]" mode="contents"/>
|
3034
3039
|
<xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
|
3035
3040
|
<!-- Bibliography -->
|
3036
|
-
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
|
3041
|
+
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
|
3042
|
+
|
3037
3043
|
</xsl:template><xsl:template name="processPrefaceSectionsDefault">
|
3038
3044
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
|
3039
3045
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
|
@@ -3842,6 +3848,7 @@
|
|
3842
3848
|
|
3843
3849
|
|
3844
3850
|
|
3851
|
+
|
3845
3852
|
<xsl:if test="ancestor::*[local-name() = 'tfoot']">
|
3846
3853
|
<xsl:attribute name="border">solid black 0</xsl:attribute>
|
3847
3854
|
</xsl:if>
|
@@ -3894,6 +3901,7 @@
|
|
3894
3901
|
|
3895
3902
|
|
3896
3903
|
|
3904
|
+
|
3897
3905
|
<fo:inline padding-right="2mm">
|
3898
3906
|
|
3899
3907
|
|
@@ -3936,6 +3944,7 @@
|
|
3936
3944
|
|
3937
3945
|
|
3938
3946
|
|
3947
|
+
|
3939
3948
|
<xsl:attribute name="baseline-shift">30%</xsl:attribute>
|
3940
3949
|
<xsl:attribute name="font-size">70%</xsl:attribute>
|
3941
3950
|
|
@@ -4090,6 +4099,8 @@
|
|
4090
4099
|
<!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
|
4091
4100
|
<fo:inline font-size="80%" keep-with-previous.within-line="always">
|
4092
4101
|
|
4102
|
+
|
4103
|
+
|
4093
4104
|
<xsl:if test="ancestor::*[local-name()='td']">
|
4094
4105
|
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
4095
4106
|
<!-- <xsl:attribute name="alignment-baseline">hanging</xsl:attribute> -->
|
@@ -4102,6 +4113,7 @@
|
|
4102
4113
|
|
4103
4114
|
|
4104
4115
|
|
4116
|
+
|
4105
4117
|
<fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
4106
4118
|
|
4107
4119
|
|
@@ -5025,6 +5037,7 @@
|
|
5025
5037
|
</xsl:if>
|
5026
5038
|
|
5027
5039
|
|
5040
|
+
|
5028
5041
|
<xsl:choose>
|
5029
5042
|
<xsl:when test="$target_text = ''">
|
5030
5043
|
<xsl:apply-templates/>
|
@@ -5375,6 +5388,234 @@
|
|
5375
5388
|
<xsl:param name="height"/>
|
5376
5389
|
<line xmlns="http://www.w3.org/2000/svg" x1="0" y1="0" x2="{$width}" y2="{$height}" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
|
5377
5390
|
<line xmlns="http://www.w3.org/2000/svg" x1="0" y1="{$height}" x2="{$width}" y2="0" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
|
5391
|
+
</xsl:template><xsl:variable name="figure_name_height">14</xsl:variable><xsl:variable name="width_effective" select="$pageWidth - $marginLeftRight1 - $marginLeftRight2"/><xsl:variable name="height_effective" select="$pageHeight - $marginTop - $marginBottom - $figure_name_height"/><xsl:variable name="image_dpi" select="96"/><xsl:variable name="width_effective_px" select="$width_effective div 25.4 * $image_dpi"/><xsl:variable name="height_effective_px" select="$height_effective div 25.4 * $image_dpi"/><xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image']) and *[local-name() = 'svg']]/*[local-name() = 'name']/*[local-name() = 'bookmark']" priority="2"/><xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image'])]/*[local-name() = 'svg']" priority="2" name="image_svg">
|
5392
|
+
<xsl:param name="name"/>
|
5393
|
+
|
5394
|
+
<xsl:variable name="svg_content">
|
5395
|
+
<xsl:apply-templates select="." mode="svg_update"/>
|
5396
|
+
</xsl:variable>
|
5397
|
+
|
5398
|
+
<xsl:variable name="alt-text">
|
5399
|
+
<xsl:choose>
|
5400
|
+
<xsl:when test="normalize-space(../*[local-name() = 'name']) != ''">
|
5401
|
+
<xsl:value-of select="../*[local-name() = 'name']"/>
|
5402
|
+
</xsl:when>
|
5403
|
+
<xsl:when test="normalize-space($name) != ''">
|
5404
|
+
<xsl:value-of select="$name"/>
|
5405
|
+
</xsl:when>
|
5406
|
+
<xsl:otherwise>Figure</xsl:otherwise>
|
5407
|
+
</xsl:choose>
|
5408
|
+
</xsl:variable>
|
5409
|
+
|
5410
|
+
<xsl:choose>
|
5411
|
+
<xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
|
5412
|
+
<fo:block>
|
5413
|
+
<xsl:variable name="width" select="@width"/>
|
5414
|
+
<xsl:variable name="height" select="@height"/>
|
5415
|
+
|
5416
|
+
<xsl:variable name="scale_x">
|
5417
|
+
<xsl:choose>
|
5418
|
+
<xsl:when test="$width > $width_effective_px">
|
5419
|
+
<xsl:value-of select="$width_effective_px div $width"/>
|
5420
|
+
</xsl:when>
|
5421
|
+
<xsl:otherwise>1</xsl:otherwise>
|
5422
|
+
</xsl:choose>
|
5423
|
+
</xsl:variable>
|
5424
|
+
|
5425
|
+
<xsl:variable name="scale_y">
|
5426
|
+
<xsl:choose>
|
5427
|
+
<xsl:when test="$height * $scale_x > $height_effective_px">
|
5428
|
+
<xsl:value-of select="$height_effective_px div ($height * $scale_x)"/>
|
5429
|
+
</xsl:when>
|
5430
|
+
<xsl:otherwise>1</xsl:otherwise>
|
5431
|
+
</xsl:choose>
|
5432
|
+
</xsl:variable>
|
5433
|
+
|
5434
|
+
<xsl:variable name="scale">
|
5435
|
+
<xsl:choose>
|
5436
|
+
<xsl:when test="$scale_y != 1">
|
5437
|
+
<xsl:value-of select="$scale_x * $scale_y"/>
|
5438
|
+
</xsl:when>
|
5439
|
+
<xsl:otherwise>
|
5440
|
+
<xsl:value-of select="$scale_x"/>
|
5441
|
+
</xsl:otherwise>
|
5442
|
+
</xsl:choose>
|
5443
|
+
</xsl:variable>
|
5444
|
+
|
5445
|
+
<xsl:variable name="width_scale" select="round($width * $scale)"/>
|
5446
|
+
<xsl:variable name="height_scale" select="round($height * $scale)"/>
|
5447
|
+
|
5448
|
+
<fo:table table-layout="fixed" width="100%">
|
5449
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
5450
|
+
<fo:table-column column-width="{$width_scale}px"/>
|
5451
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
5452
|
+
<fo:table-body>
|
5453
|
+
<fo:table-row>
|
5454
|
+
<fo:table-cell column-number="2">
|
5455
|
+
<fo:block>
|
5456
|
+
<fo:block-container width="{$width_scale}px" height="{$height_scale}px">
|
5457
|
+
<xsl:if test="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
5458
|
+
<fo:block line-height="0" font-size="0">
|
5459
|
+
<xsl:for-each select="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
5460
|
+
<xsl:call-template name="bookmark"/>
|
5461
|
+
</xsl:for-each>
|
5462
|
+
</fo:block>
|
5463
|
+
</xsl:if>
|
5464
|
+
<fo:block text-depth="0" line-height="0" font-size="0">
|
5465
|
+
|
5466
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
5467
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
5468
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
5469
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
5470
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
5471
|
+
|
5472
|
+
<xsl:apply-templates select="xalan:nodeset($svg_content)" mode="svg_remove_a"/>
|
5473
|
+
</fo:instream-foreign-object>
|
5474
|
+
</fo:block>
|
5475
|
+
|
5476
|
+
<xsl:apply-templates select=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]" mode="svg_imagemap_links">
|
5477
|
+
<xsl:with-param name="scale" select="$scale"/>
|
5478
|
+
</xsl:apply-templates>
|
5479
|
+
</fo:block-container>
|
5480
|
+
</fo:block>
|
5481
|
+
</fo:table-cell>
|
5482
|
+
</fo:table-row>
|
5483
|
+
</fo:table-body>
|
5484
|
+
</fo:table>
|
5485
|
+
</fo:block>
|
5486
|
+
|
5487
|
+
</xsl:when>
|
5488
|
+
<xsl:otherwise>
|
5489
|
+
<fo:block xsl:use-attribute-sets="image-style">
|
5490
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
5491
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
5492
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
5493
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
5494
|
+
<!-- effective height 297 - 27.4 - 13 = 256.6 -->
|
5495
|
+
<!-- effective width 210 - 12.5 - 25 = 172.5 -->
|
5496
|
+
<!-- effective height / width = 1.48, 1.4 - with title -->
|
5497
|
+
<xsl:if test="@height > (@width * 1.4)"> <!-- for images with big height -->
|
5498
|
+
<xsl:variable name="width" select="((@width * 1.4) div @height) * 100"/>
|
5499
|
+
<xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
|
5500
|
+
</xsl:if>
|
5501
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
5502
|
+
<xsl:copy-of select="$svg_content"/>
|
5503
|
+
</fo:instream-foreign-object>
|
5504
|
+
</fo:block>
|
5505
|
+
</xsl:otherwise>
|
5506
|
+
</xsl:choose>
|
5507
|
+
</xsl:template><xsl:template match="@*|node()" mode="svg_update">
|
5508
|
+
<xsl:copy>
|
5509
|
+
<xsl:apply-templates select="@*|node()" mode="svg_update"/>
|
5510
|
+
</xsl:copy>
|
5511
|
+
</xsl:template><xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
|
5512
|
+
<xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
|
5513
|
+
<xsl:value-of select="."/>
|
5514
|
+
</xsl:attribute>
|
5515
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
|
5516
|
+
<xsl:variable name="svg_content" select="document(@src)"/>
|
5517
|
+
<xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
|
5518
|
+
<xsl:for-each select="xalan:nodeset($svg_content)/node()">
|
5519
|
+
<xsl:call-template name="image_svg">
|
5520
|
+
<xsl:with-param name="name" select="$name"/>
|
5521
|
+
</xsl:call-template>
|
5522
|
+
</xsl:for-each>
|
5523
|
+
</xsl:template><xsl:template match="@*|node()" mode="svg_remove_a">
|
5524
|
+
<xsl:copy>
|
5525
|
+
<xsl:apply-templates select="@*|node()" mode="svg_remove_a"/>
|
5526
|
+
</xsl:copy>
|
5527
|
+
</xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_remove_a">
|
5528
|
+
<xsl:apply-templates mode="svg_remove_a"/>
|
5529
|
+
</xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_imagemap_links">
|
5530
|
+
<xsl:param name="scale"/>
|
5531
|
+
<xsl:variable name="dest">
|
5532
|
+
<xsl:choose>
|
5533
|
+
<xsl:when test="starts-with(@href, '#')">
|
5534
|
+
<xsl:value-of select="substring-after(@href, '#')"/>
|
5535
|
+
</xsl:when>
|
5536
|
+
<xsl:otherwise>
|
5537
|
+
<xsl:value-of select="@href"/>
|
5538
|
+
</xsl:otherwise>
|
5539
|
+
</xsl:choose>
|
5540
|
+
</xsl:variable>
|
5541
|
+
<xsl:for-each select="./*[local-name() = 'rect']">
|
5542
|
+
<xsl:call-template name="insertSVGMapLink">
|
5543
|
+
<xsl:with-param name="left" select="floor(@x * $scale)"/>
|
5544
|
+
<xsl:with-param name="top" select="floor(@y * $scale)"/>
|
5545
|
+
<xsl:with-param name="width" select="floor(@width * $scale)"/>
|
5546
|
+
<xsl:with-param name="height" select="floor(@height * $scale)"/>
|
5547
|
+
<xsl:with-param name="dest" select="$dest"/>
|
5548
|
+
</xsl:call-template>
|
5549
|
+
</xsl:for-each>
|
5550
|
+
|
5551
|
+
<xsl:for-each select="./*[local-name() = 'polygon']">
|
5552
|
+
<xsl:variable name="points">
|
5553
|
+
<xsl:call-template name="split">
|
5554
|
+
<xsl:with-param name="pText" select="@points"/>
|
5555
|
+
</xsl:call-template>
|
5556
|
+
</xsl:variable>
|
5557
|
+
<xsl:variable name="x_coords">
|
5558
|
+
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 1]">
|
5559
|
+
<xsl:sort select="." data-type="number"/>
|
5560
|
+
<x><xsl:value-of select="."/></x>
|
5561
|
+
</xsl:for-each>
|
5562
|
+
</xsl:variable>
|
5563
|
+
<xsl:variable name="y_coords">
|
5564
|
+
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 0]">
|
5565
|
+
<xsl:sort select="." data-type="number"/>
|
5566
|
+
<y><xsl:value-of select="."/></y>
|
5567
|
+
</xsl:for-each>
|
5568
|
+
</xsl:variable>
|
5569
|
+
<xsl:variable name="x" select="xalan:nodeset($x_coords)//x[1]"/>
|
5570
|
+
<xsl:variable name="y" select="xalan:nodeset($y_coords)//y[1]"/>
|
5571
|
+
<xsl:variable name="width" select="xalan:nodeset($x_coords)//x[last()] - $x"/>
|
5572
|
+
<xsl:variable name="height" select="xalan:nodeset($y_coords)//y[last()] - $y"/>
|
5573
|
+
<xsl:call-template name="insertSVGMapLink">
|
5574
|
+
<xsl:with-param name="left" select="floor($x * $scale)"/>
|
5575
|
+
<xsl:with-param name="top" select="floor($y * $scale)"/>
|
5576
|
+
<xsl:with-param name="width" select="floor($width * $scale)"/>
|
5577
|
+
<xsl:with-param name="height" select="floor($height * $scale)"/>
|
5578
|
+
<xsl:with-param name="dest" select="$dest"/>
|
5579
|
+
</xsl:call-template>
|
5580
|
+
</xsl:for-each>
|
5581
|
+
|
5582
|
+
<xsl:for-each select="./*[local-name() = 'circle']">
|
5583
|
+
<xsl:call-template name="insertSVGMapLink">
|
5584
|
+
<xsl:with-param name="left" select="floor((@cx - @r) * $scale)"/>
|
5585
|
+
<xsl:with-param name="top" select="floor((@cy - @r) * $scale)"/>
|
5586
|
+
<xsl:with-param name="width" select="floor(@r * 2 * $scale)"/>
|
5587
|
+
<xsl:with-param name="height" select="floor(@r * 2 * $scale)"/>
|
5588
|
+
<xsl:with-param name="dest" select="$dest"/>
|
5589
|
+
</xsl:call-template>
|
5590
|
+
</xsl:for-each>
|
5591
|
+
<xsl:for-each select="./*[local-name() = 'ellipse']">
|
5592
|
+
<xsl:call-template name="insertSVGMapLink">
|
5593
|
+
<xsl:with-param name="left" select="floor((@cx - @rx) * $scale)"/>
|
5594
|
+
<xsl:with-param name="top" select="floor((@cy - @ry) * $scale)"/>
|
5595
|
+
<xsl:with-param name="width" select="floor(@rx * 2 * $scale)"/>
|
5596
|
+
<xsl:with-param name="height" select="floor(@ry * 2 * $scale)"/>
|
5597
|
+
<xsl:with-param name="dest" select="$dest"/>
|
5598
|
+
</xsl:call-template>
|
5599
|
+
</xsl:for-each>
|
5600
|
+
</xsl:template><xsl:template name="insertSVGMapLink">
|
5601
|
+
<xsl:param name="left"/>
|
5602
|
+
<xsl:param name="top"/>
|
5603
|
+
<xsl:param name="width"/>
|
5604
|
+
<xsl:param name="height"/>
|
5605
|
+
<xsl:param name="dest"/>
|
5606
|
+
<fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
|
5607
|
+
<fo:block font-size="1pt">
|
5608
|
+
<fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
|
5609
|
+
<fo:inline-container inline-progression-dimension="100%">
|
5610
|
+
<fo:block-container height="{$height - 1}px" width="100%">
|
5611
|
+
<!-- DEBUG <xsl:if test="local-name()='polygon'">
|
5612
|
+
<xsl:attribute name="background-color">magenta</xsl:attribute>
|
5613
|
+
</xsl:if> -->
|
5614
|
+
<fo:block> </fo:block></fo:block-container>
|
5615
|
+
</fo:inline-container>
|
5616
|
+
</fo:basic-link>
|
5617
|
+
</fo:block>
|
5618
|
+
</fo:block-container>
|
5378
5619
|
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><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="contents">
|
5379
5620
|
<xsl:apply-templates mode="contents"/>
|
5380
5621
|
<xsl:text> </xsl:text>
|
@@ -5403,28 +5644,39 @@
|
|
5403
5644
|
<xsl:when test="count(xalan:nodeset($contents)/doc) > 1">
|
5404
5645
|
<xsl:for-each select="xalan:nodeset($contents)/doc">
|
5405
5646
|
<fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
|
5647
|
+
<xsl:if test="@bundle = 'true'">
|
5648
|
+
<xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
|
5649
|
+
</xsl:if>
|
5406
5650
|
<fo:bookmark-title>
|
5407
|
-
<xsl:variable name="bookmark-title_">
|
5408
|
-
<xsl:call-template name="getLangVersion">
|
5409
|
-
<xsl:with-param name="lang" select="@lang"/>
|
5410
|
-
<xsl:with-param name="doctype" select="@doctype"/>
|
5411
|
-
<xsl:with-param name="title" select="@title-part"/>
|
5412
|
-
</xsl:call-template>
|
5413
|
-
</xsl:variable>
|
5414
5651
|
<xsl:choose>
|
5415
|
-
<xsl:when test="normalize-space(
|
5416
|
-
<xsl:
|
5417
|
-
|
5418
|
-
|
5652
|
+
<xsl:when test="not(normalize-space(@bundle) = 'true')"> <!-- 'bundle' means several different documents (not language versions) in one xml -->
|
5653
|
+
<xsl:variable name="bookmark-title_">
|
5654
|
+
<xsl:call-template name="getLangVersion">
|
5655
|
+
<xsl:with-param name="lang" select="@lang"/>
|
5656
|
+
<xsl:with-param name="doctype" select="@doctype"/>
|
5657
|
+
<xsl:with-param name="title" select="@title-part"/>
|
5658
|
+
</xsl:call-template>
|
5659
|
+
</xsl:variable>
|
5419
5660
|
<xsl:choose>
|
5420
|
-
<xsl:when test="
|
5421
|
-
|
5422
|
-
|
5423
|
-
<xsl:otherwise
|
5661
|
+
<xsl:when test="normalize-space($bookmark-title_) != ''">
|
5662
|
+
<xsl:value-of select="normalize-space($bookmark-title_)"/>
|
5663
|
+
</xsl:when>
|
5664
|
+
<xsl:otherwise>
|
5665
|
+
<xsl:choose>
|
5666
|
+
<xsl:when test="@lang = 'en'">English</xsl:when>
|
5667
|
+
<xsl:when test="@lang = 'fr'">Français</xsl:when>
|
5668
|
+
<xsl:when test="@lang = 'de'">Deutsche</xsl:when>
|
5669
|
+
<xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
|
5670
|
+
</xsl:choose>
|
5671
|
+
</xsl:otherwise>
|
5424
5672
|
</xsl:choose>
|
5673
|
+
</xsl:when>
|
5674
|
+
<xsl:otherwise>
|
5675
|
+
<xsl:value-of select="@title-part"/>
|
5425
5676
|
</xsl:otherwise>
|
5426
5677
|
</xsl:choose>
|
5427
5678
|
</fo:bookmark-title>
|
5679
|
+
|
5428
5680
|
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
5429
5681
|
|
5430
5682
|
<xsl:call-template name="insertFigureBookmarks">
|
@@ -5523,16 +5775,23 @@
|
|
5523
5775
|
<xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
|
5524
5776
|
</xsl:choose>
|
5525
5777
|
</xsl:template><xsl:template match="item" mode="bookmark">
|
5526
|
-
<
|
5527
|
-
|
5528
|
-
|
5529
|
-
|
5530
|
-
<xsl:
|
5531
|
-
|
5532
|
-
|
5533
|
-
|
5534
|
-
|
5535
|
-
|
5778
|
+
<xsl:choose>
|
5779
|
+
<xsl:when test="@id != ''">
|
5780
|
+
<fo:bookmark internal-destination="{@id}" starting-state="hide">
|
5781
|
+
<fo:bookmark-title>
|
5782
|
+
<xsl:if test="@section != ''">
|
5783
|
+
<xsl:value-of select="@section"/>
|
5784
|
+
<xsl:text> </xsl:text>
|
5785
|
+
</xsl:if>
|
5786
|
+
<xsl:value-of select="normalize-space(title)"/>
|
5787
|
+
</fo:bookmark-title>
|
5788
|
+
<xsl:apply-templates mode="bookmark"/>
|
5789
|
+
</fo:bookmark>
|
5790
|
+
</xsl:when>
|
5791
|
+
<xsl:otherwise>
|
5792
|
+
<xsl:apply-templates mode="bookmark"/>
|
5793
|
+
</xsl:otherwise>
|
5794
|
+
</xsl:choose>
|
5536
5795
|
</xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
|
5537
5796
|
<xsl:if test="normalize-space() != ''">
|
5538
5797
|
<fo:block xsl:use-attribute-sets="figure-name-style">
|
@@ -6093,6 +6352,7 @@
|
|
6093
6352
|
</xsl:if>
|
6094
6353
|
|
6095
6354
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
6355
|
+
|
6096
6356
|
<xsl:if test="normalize-space(@citeas) = ''">
|
6097
6357
|
<xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
|
6098
6358
|
</xsl:if>
|
data/metanorma-iec.gemspec
CHANGED
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.test_files = `git ls-files -- {spec}/*`.split("\n")
|
28
28
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.5.0")
|
29
29
|
|
30
|
-
spec.add_dependency "metanorma-iso", "~> 1.8.
|
30
|
+
spec.add_dependency "metanorma-iso", "~> 1.8.6"
|
31
31
|
spec.add_dependency "ruby-jing"
|
32
32
|
|
33
33
|
spec.add_development_dependency "byebug"
|
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.3.
|
4
|
+
version: 1.3.6
|
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-
|
11
|
+
date: 2021-07-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-iso
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 1.8.
|
19
|
+
version: 1.8.6
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
24
|
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 1.8.
|
26
|
+
version: 1.8.6
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: ruby-jing
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|