metanorma-bipm 2.1.13 → 2.2.0
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 +4 -4
- data/lib/isodoc/bipm/bipm.brochure.xsl +55 -12
- data/lib/isodoc/bipm/bipm.guide.xsl +55 -12
- data/lib/isodoc/bipm/bipm.mise-en-pratique.xsl +55 -12
- data/lib/isodoc/bipm/bipm.rapport.xsl +55 -12
- data/lib/isodoc/bipm/index.rb +29 -18
- data/lib/isodoc/bipm/jcgm.standard.xsl +55 -12
- data/lib/isodoc/bipm/presentation_xml_convert.rb +8 -9
- data/lib/metanorma/bipm/basicdoc.rng +3 -0
- data/lib/metanorma/bipm/biblio-standoc.rng +1 -1
- data/lib/metanorma/bipm/isodoc.rng +1 -0
- data/lib/metanorma/bipm/version.rb +1 -1
- data/metanorma-bipm.gemspec +2 -2
- metadata +7 -7
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 5473d53c218ef9be08f8d8664f388c27684eca2af7bc86e4c501d9d922d50f64
|
4
|
+
data.tar.gz: 0dd3d6d95f9e7975e3f76e00c9b486b5c97a753ce45cd1af450b82cf80ddad5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8e9aeb4d4752a121f6dc00049988937cf6eadb7e3833e5df79d574dcb74fa1bbeff911a33e70f63bcc880cf1cf50f8f3eaf1b3099b494b78f7db299c1a71ade1
|
7
|
+
data.tar.gz: 54655f2d26b574f6e8231cf945505905d733ab08512e109f9e10fa1d96622f0bf8e581099ac8d08fab8d8ddca5dca66740d95603a6b10aa1153a59d4339d3a2a
|
@@ -6492,6 +6492,10 @@
|
|
6492
6492
|
<xsl:variable name="footnote_inline">
|
6493
6493
|
<fo:inline xsl:use-attribute-sets="fn-num-style">
|
6494
6494
|
|
6495
|
+
<xsl:if test="following-sibling::*[1][local-name() = 'fn']">
|
6496
|
+
<xsl:attribute name="padding-right">0.5mm</xsl:attribute>
|
6497
|
+
</xsl:if>
|
6498
|
+
|
6495
6499
|
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
|
6496
6500
|
<xsl:value-of select="$current_fn_number_text"/>
|
6497
6501
|
</fo:basic-link>
|
@@ -7649,6 +7653,23 @@
|
|
7649
7653
|
<xsl:apply-templates/>
|
7650
7654
|
</xsl:template>
|
7651
7655
|
|
7656
|
+
<!-- Don't break standard's numbers -->
|
7657
|
+
<!-- Example : <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
|
7658
|
+
<xsl:template match="*[local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" priority="2">
|
7659
|
+
<xsl:choose>
|
7660
|
+
<xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
|
7661
|
+
<xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
|
7662
|
+
<fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
|
7663
|
+
</xsl:when>
|
7664
|
+
<xsl:otherwise>
|
7665
|
+
<xsl:apply-templates/>
|
7666
|
+
</xsl:otherwise>
|
7667
|
+
</xsl:choose>
|
7668
|
+
</xsl:template>
|
7669
|
+
<xsl:template match="text()[not(ancestor::*[local-name() = 'table']) and preceding-sibling::*[1][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear'] and following-sibling::*[1][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']]" priority="2">
|
7670
|
+
<fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
|
7671
|
+
</xsl:template>
|
7672
|
+
|
7652
7673
|
<!-- ========================= -->
|
7653
7674
|
<!-- END Rich text formatting -->
|
7654
7675
|
<!-- ========================= -->
|
@@ -8044,7 +8065,7 @@
|
|
8044
8065
|
<xsl:choose>
|
8045
8066
|
<xsl:when test="@colspan">
|
8046
8067
|
<xsl:variable name="td">
|
8047
|
-
<xsl:element name="
|
8068
|
+
<xsl:element name="{local-name()}">
|
8048
8069
|
<xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
|
8049
8070
|
<xsl:if test="local-name()='th'">
|
8050
8071
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
@@ -8059,7 +8080,7 @@
|
|
8059
8080
|
</xsl:call-template>
|
8060
8081
|
</xsl:when>
|
8061
8082
|
<xsl:otherwise>
|
8062
|
-
<xsl:element name="
|
8083
|
+
<xsl:element name="{local-name()}">
|
8063
8084
|
<xsl:apply-templates select="@*" mode="simple-table-colspan"/>
|
8064
8085
|
<xsl:if test="local-name()='th'">
|
8065
8086
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
@@ -8126,7 +8147,7 @@
|
|
8126
8147
|
<xsl:variable name="currentRow" select="."/>
|
8127
8148
|
|
8128
8149
|
<xsl:variable name="normalizedTDs">
|
8129
|
-
<xsl:for-each select="xalan:nodeset($previousRow)
|
8150
|
+
<xsl:for-each select="xalan:nodeset($previousRow)//*[self::td or self::th]">
|
8130
8151
|
<xsl:choose>
|
8131
8152
|
<xsl:when test="@rowspan > 1">
|
8132
8153
|
<xsl:copy>
|
@@ -8138,7 +8159,7 @@
|
|
8138
8159
|
</xsl:copy>
|
8139
8160
|
</xsl:when>
|
8140
8161
|
<xsl:otherwise>
|
8141
|
-
<xsl:copy-of select="$currentRow
|
8162
|
+
<xsl:copy-of select="$currentRow/*[self::td or self::th][1 + count(current()/preceding-sibling::*[self::td or self::th][not(@rowspan) or (@rowspan = 1)])]"/>
|
8142
8163
|
</xsl:otherwise>
|
8143
8164
|
</xsl:choose>
|
8144
8165
|
</xsl:for-each>
|
@@ -8853,12 +8874,6 @@
|
|
8853
8874
|
|
8854
8875
|
<fo:block-container margin-left="0mm">
|
8855
8876
|
|
8856
|
-
<!-- <xsl:if test="$namespace = 'iho'">
|
8857
|
-
<xsl:if test="ancestor::iho:td">
|
8858
|
-
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
8859
|
-
</xsl:if>
|
8860
|
-
</xsl:if> -->
|
8861
|
-
|
8862
8877
|
<fo:block>
|
8863
8878
|
|
8864
8879
|
<xsl:if test="@parent-type = 'quote'">
|
@@ -9385,6 +9400,31 @@
|
|
9385
9400
|
<xsl:apply-templates mode="svg_update"/>
|
9386
9401
|
</xsl:copy>
|
9387
9402
|
</xsl:template>
|
9403
|
+
|
9404
|
+
<!-- regex for 'display: inline-block;' -->
|
9405
|
+
<xsl:variable name="regex_svg_style_notsupported">display(\s|\h)*:(\s|\h)*inline-block(\s|\h)*;</xsl:variable>
|
9406
|
+
<xsl:template match="*[local-name() = 'svg']//*[local-name() = 'style']/text()" mode="svg_update">
|
9407
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), $regex_svg_style_notsupported, '')"/>
|
9408
|
+
</xsl:template>
|
9409
|
+
|
9410
|
+
<!-- replace
|
9411
|
+
stroke="rgba(r, g, b, alpha)" to
|
9412
|
+
stroke="rgb(r,g,b)" stroke-opacity="alpha", and
|
9413
|
+
fill="rgba(r, g, b, alpha)" to
|
9414
|
+
fill="rgb(r,g,b)" fill-opacity="alpha" -->
|
9415
|
+
<xsl:template match="@*[local-name() = 'stroke' or local-name() = 'fill'][starts-with(normalize-space(.), 'rgba')]" mode="svg_update">
|
9416
|
+
<xsl:variable name="components_">
|
9417
|
+
<xsl:call-template name="split">
|
9418
|
+
<xsl:with-param name="pText" select="substring-before(substring-after(., '('), ')')"/>
|
9419
|
+
<xsl:with-param name="sep" select="','"/>
|
9420
|
+
</xsl:call-template>
|
9421
|
+
</xsl:variable>
|
9422
|
+
<xsl:variable name="components" select="xalan:nodeset($components_)"/>
|
9423
|
+
<xsl:variable name="att_name" select="local-name()"/>
|
9424
|
+
<xsl:attribute name="{$att_name}"><xsl:value-of select="concat('rgb(', $components/item[1], ',', $components/item[2], ',', $components/item[3], ')')"/></xsl:attribute>
|
9425
|
+
<xsl:attribute name="{$att_name}-opacity"><xsl:value-of select="$components/item[4]"/></xsl:attribute>
|
9426
|
+
</xsl:template>
|
9427
|
+
|
9388
9428
|
<!-- ============== -->
|
9389
9429
|
<!-- END: svg_update -->
|
9390
9430
|
<!-- ============== -->
|
@@ -12343,7 +12383,9 @@
|
|
12343
12383
|
<!-- Update xml -->
|
12344
12384
|
<!-- ===================================== -->
|
12345
12385
|
<!-- =========================================================================== -->
|
12346
|
-
<!-- STEP1:
|
12386
|
+
<!-- STEP1: -->
|
12387
|
+
<!-- - Re-order elements in 'preface', 'sections' based on @displayorder -->
|
12388
|
+
<!-- - Ignore 'span' without style -->
|
12347
12389
|
<!-- =========================================================================== -->
|
12348
12390
|
<xsl:template match="@*|node()" mode="update_xml_step1">
|
12349
12391
|
<xsl:copy>
|
@@ -12426,7 +12468,8 @@
|
|
12426
12468
|
</xsl:copy>
|
12427
12469
|
</xsl:template>
|
12428
12470
|
|
12429
|
-
|
12471
|
+
<!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
|
12472
|
+
<xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" mode="update_xml_step1" priority="2">
|
12430
12473
|
<xsl:copy>
|
12431
12474
|
<xsl:copy-of select="@*"/>
|
12432
12475
|
<xsl:apply-templates mode="update_xml_step1"/>
|
@@ -6492,6 +6492,10 @@
|
|
6492
6492
|
<xsl:variable name="footnote_inline">
|
6493
6493
|
<fo:inline xsl:use-attribute-sets="fn-num-style">
|
6494
6494
|
|
6495
|
+
<xsl:if test="following-sibling::*[1][local-name() = 'fn']">
|
6496
|
+
<xsl:attribute name="padding-right">0.5mm</xsl:attribute>
|
6497
|
+
</xsl:if>
|
6498
|
+
|
6495
6499
|
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
|
6496
6500
|
<xsl:value-of select="$current_fn_number_text"/>
|
6497
6501
|
</fo:basic-link>
|
@@ -7649,6 +7653,23 @@
|
|
7649
7653
|
<xsl:apply-templates/>
|
7650
7654
|
</xsl:template>
|
7651
7655
|
|
7656
|
+
<!-- Don't break standard's numbers -->
|
7657
|
+
<!-- Example : <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
|
7658
|
+
<xsl:template match="*[local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" priority="2">
|
7659
|
+
<xsl:choose>
|
7660
|
+
<xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
|
7661
|
+
<xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
|
7662
|
+
<fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
|
7663
|
+
</xsl:when>
|
7664
|
+
<xsl:otherwise>
|
7665
|
+
<xsl:apply-templates/>
|
7666
|
+
</xsl:otherwise>
|
7667
|
+
</xsl:choose>
|
7668
|
+
</xsl:template>
|
7669
|
+
<xsl:template match="text()[not(ancestor::*[local-name() = 'table']) and preceding-sibling::*[1][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear'] and following-sibling::*[1][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']]" priority="2">
|
7670
|
+
<fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
|
7671
|
+
</xsl:template>
|
7672
|
+
|
7652
7673
|
<!-- ========================= -->
|
7653
7674
|
<!-- END Rich text formatting -->
|
7654
7675
|
<!-- ========================= -->
|
@@ -8044,7 +8065,7 @@
|
|
8044
8065
|
<xsl:choose>
|
8045
8066
|
<xsl:when test="@colspan">
|
8046
8067
|
<xsl:variable name="td">
|
8047
|
-
<xsl:element name="
|
8068
|
+
<xsl:element name="{local-name()}">
|
8048
8069
|
<xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
|
8049
8070
|
<xsl:if test="local-name()='th'">
|
8050
8071
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
@@ -8059,7 +8080,7 @@
|
|
8059
8080
|
</xsl:call-template>
|
8060
8081
|
</xsl:when>
|
8061
8082
|
<xsl:otherwise>
|
8062
|
-
<xsl:element name="
|
8083
|
+
<xsl:element name="{local-name()}">
|
8063
8084
|
<xsl:apply-templates select="@*" mode="simple-table-colspan"/>
|
8064
8085
|
<xsl:if test="local-name()='th'">
|
8065
8086
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
@@ -8126,7 +8147,7 @@
|
|
8126
8147
|
<xsl:variable name="currentRow" select="."/>
|
8127
8148
|
|
8128
8149
|
<xsl:variable name="normalizedTDs">
|
8129
|
-
<xsl:for-each select="xalan:nodeset($previousRow)
|
8150
|
+
<xsl:for-each select="xalan:nodeset($previousRow)//*[self::td or self::th]">
|
8130
8151
|
<xsl:choose>
|
8131
8152
|
<xsl:when test="@rowspan > 1">
|
8132
8153
|
<xsl:copy>
|
@@ -8138,7 +8159,7 @@
|
|
8138
8159
|
</xsl:copy>
|
8139
8160
|
</xsl:when>
|
8140
8161
|
<xsl:otherwise>
|
8141
|
-
<xsl:copy-of select="$currentRow
|
8162
|
+
<xsl:copy-of select="$currentRow/*[self::td or self::th][1 + count(current()/preceding-sibling::*[self::td or self::th][not(@rowspan) or (@rowspan = 1)])]"/>
|
8142
8163
|
</xsl:otherwise>
|
8143
8164
|
</xsl:choose>
|
8144
8165
|
</xsl:for-each>
|
@@ -8853,12 +8874,6 @@
|
|
8853
8874
|
|
8854
8875
|
<fo:block-container margin-left="0mm">
|
8855
8876
|
|
8856
|
-
<!-- <xsl:if test="$namespace = 'iho'">
|
8857
|
-
<xsl:if test="ancestor::iho:td">
|
8858
|
-
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
8859
|
-
</xsl:if>
|
8860
|
-
</xsl:if> -->
|
8861
|
-
|
8862
8877
|
<fo:block>
|
8863
8878
|
|
8864
8879
|
<xsl:if test="@parent-type = 'quote'">
|
@@ -9385,6 +9400,31 @@
|
|
9385
9400
|
<xsl:apply-templates mode="svg_update"/>
|
9386
9401
|
</xsl:copy>
|
9387
9402
|
</xsl:template>
|
9403
|
+
|
9404
|
+
<!-- regex for 'display: inline-block;' -->
|
9405
|
+
<xsl:variable name="regex_svg_style_notsupported">display(\s|\h)*:(\s|\h)*inline-block(\s|\h)*;</xsl:variable>
|
9406
|
+
<xsl:template match="*[local-name() = 'svg']//*[local-name() = 'style']/text()" mode="svg_update">
|
9407
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), $regex_svg_style_notsupported, '')"/>
|
9408
|
+
</xsl:template>
|
9409
|
+
|
9410
|
+
<!-- replace
|
9411
|
+
stroke="rgba(r, g, b, alpha)" to
|
9412
|
+
stroke="rgb(r,g,b)" stroke-opacity="alpha", and
|
9413
|
+
fill="rgba(r, g, b, alpha)" to
|
9414
|
+
fill="rgb(r,g,b)" fill-opacity="alpha" -->
|
9415
|
+
<xsl:template match="@*[local-name() = 'stroke' or local-name() = 'fill'][starts-with(normalize-space(.), 'rgba')]" mode="svg_update">
|
9416
|
+
<xsl:variable name="components_">
|
9417
|
+
<xsl:call-template name="split">
|
9418
|
+
<xsl:with-param name="pText" select="substring-before(substring-after(., '('), ')')"/>
|
9419
|
+
<xsl:with-param name="sep" select="','"/>
|
9420
|
+
</xsl:call-template>
|
9421
|
+
</xsl:variable>
|
9422
|
+
<xsl:variable name="components" select="xalan:nodeset($components_)"/>
|
9423
|
+
<xsl:variable name="att_name" select="local-name()"/>
|
9424
|
+
<xsl:attribute name="{$att_name}"><xsl:value-of select="concat('rgb(', $components/item[1], ',', $components/item[2], ',', $components/item[3], ')')"/></xsl:attribute>
|
9425
|
+
<xsl:attribute name="{$att_name}-opacity"><xsl:value-of select="$components/item[4]"/></xsl:attribute>
|
9426
|
+
</xsl:template>
|
9427
|
+
|
9388
9428
|
<!-- ============== -->
|
9389
9429
|
<!-- END: svg_update -->
|
9390
9430
|
<!-- ============== -->
|
@@ -12343,7 +12383,9 @@
|
|
12343
12383
|
<!-- Update xml -->
|
12344
12384
|
<!-- ===================================== -->
|
12345
12385
|
<!-- =========================================================================== -->
|
12346
|
-
<!-- STEP1:
|
12386
|
+
<!-- STEP1: -->
|
12387
|
+
<!-- - Re-order elements in 'preface', 'sections' based on @displayorder -->
|
12388
|
+
<!-- - Ignore 'span' without style -->
|
12347
12389
|
<!-- =========================================================================== -->
|
12348
12390
|
<xsl:template match="@*|node()" mode="update_xml_step1">
|
12349
12391
|
<xsl:copy>
|
@@ -12426,7 +12468,8 @@
|
|
12426
12468
|
</xsl:copy>
|
12427
12469
|
</xsl:template>
|
12428
12470
|
|
12429
|
-
|
12471
|
+
<!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
|
12472
|
+
<xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" mode="update_xml_step1" priority="2">
|
12430
12473
|
<xsl:copy>
|
12431
12474
|
<xsl:copy-of select="@*"/>
|
12432
12475
|
<xsl:apply-templates mode="update_xml_step1"/>
|
@@ -6492,6 +6492,10 @@
|
|
6492
6492
|
<xsl:variable name="footnote_inline">
|
6493
6493
|
<fo:inline xsl:use-attribute-sets="fn-num-style">
|
6494
6494
|
|
6495
|
+
<xsl:if test="following-sibling::*[1][local-name() = 'fn']">
|
6496
|
+
<xsl:attribute name="padding-right">0.5mm</xsl:attribute>
|
6497
|
+
</xsl:if>
|
6498
|
+
|
6495
6499
|
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
|
6496
6500
|
<xsl:value-of select="$current_fn_number_text"/>
|
6497
6501
|
</fo:basic-link>
|
@@ -7649,6 +7653,23 @@
|
|
7649
7653
|
<xsl:apply-templates/>
|
7650
7654
|
</xsl:template>
|
7651
7655
|
|
7656
|
+
<!-- Don't break standard's numbers -->
|
7657
|
+
<!-- Example : <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
|
7658
|
+
<xsl:template match="*[local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" priority="2">
|
7659
|
+
<xsl:choose>
|
7660
|
+
<xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
|
7661
|
+
<xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
|
7662
|
+
<fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
|
7663
|
+
</xsl:when>
|
7664
|
+
<xsl:otherwise>
|
7665
|
+
<xsl:apply-templates/>
|
7666
|
+
</xsl:otherwise>
|
7667
|
+
</xsl:choose>
|
7668
|
+
</xsl:template>
|
7669
|
+
<xsl:template match="text()[not(ancestor::*[local-name() = 'table']) and preceding-sibling::*[1][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear'] and following-sibling::*[1][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']]" priority="2">
|
7670
|
+
<fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
|
7671
|
+
</xsl:template>
|
7672
|
+
|
7652
7673
|
<!-- ========================= -->
|
7653
7674
|
<!-- END Rich text formatting -->
|
7654
7675
|
<!-- ========================= -->
|
@@ -8044,7 +8065,7 @@
|
|
8044
8065
|
<xsl:choose>
|
8045
8066
|
<xsl:when test="@colspan">
|
8046
8067
|
<xsl:variable name="td">
|
8047
|
-
<xsl:element name="
|
8068
|
+
<xsl:element name="{local-name()}">
|
8048
8069
|
<xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
|
8049
8070
|
<xsl:if test="local-name()='th'">
|
8050
8071
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
@@ -8059,7 +8080,7 @@
|
|
8059
8080
|
</xsl:call-template>
|
8060
8081
|
</xsl:when>
|
8061
8082
|
<xsl:otherwise>
|
8062
|
-
<xsl:element name="
|
8083
|
+
<xsl:element name="{local-name()}">
|
8063
8084
|
<xsl:apply-templates select="@*" mode="simple-table-colspan"/>
|
8064
8085
|
<xsl:if test="local-name()='th'">
|
8065
8086
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
@@ -8126,7 +8147,7 @@
|
|
8126
8147
|
<xsl:variable name="currentRow" select="."/>
|
8127
8148
|
|
8128
8149
|
<xsl:variable name="normalizedTDs">
|
8129
|
-
<xsl:for-each select="xalan:nodeset($previousRow)
|
8150
|
+
<xsl:for-each select="xalan:nodeset($previousRow)//*[self::td or self::th]">
|
8130
8151
|
<xsl:choose>
|
8131
8152
|
<xsl:when test="@rowspan > 1">
|
8132
8153
|
<xsl:copy>
|
@@ -8138,7 +8159,7 @@
|
|
8138
8159
|
</xsl:copy>
|
8139
8160
|
</xsl:when>
|
8140
8161
|
<xsl:otherwise>
|
8141
|
-
<xsl:copy-of select="$currentRow
|
8162
|
+
<xsl:copy-of select="$currentRow/*[self::td or self::th][1 + count(current()/preceding-sibling::*[self::td or self::th][not(@rowspan) or (@rowspan = 1)])]"/>
|
8142
8163
|
</xsl:otherwise>
|
8143
8164
|
</xsl:choose>
|
8144
8165
|
</xsl:for-each>
|
@@ -8853,12 +8874,6 @@
|
|
8853
8874
|
|
8854
8875
|
<fo:block-container margin-left="0mm">
|
8855
8876
|
|
8856
|
-
<!-- <xsl:if test="$namespace = 'iho'">
|
8857
|
-
<xsl:if test="ancestor::iho:td">
|
8858
|
-
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
8859
|
-
</xsl:if>
|
8860
|
-
</xsl:if> -->
|
8861
|
-
|
8862
8877
|
<fo:block>
|
8863
8878
|
|
8864
8879
|
<xsl:if test="@parent-type = 'quote'">
|
@@ -9385,6 +9400,31 @@
|
|
9385
9400
|
<xsl:apply-templates mode="svg_update"/>
|
9386
9401
|
</xsl:copy>
|
9387
9402
|
</xsl:template>
|
9403
|
+
|
9404
|
+
<!-- regex for 'display: inline-block;' -->
|
9405
|
+
<xsl:variable name="regex_svg_style_notsupported">display(\s|\h)*:(\s|\h)*inline-block(\s|\h)*;</xsl:variable>
|
9406
|
+
<xsl:template match="*[local-name() = 'svg']//*[local-name() = 'style']/text()" mode="svg_update">
|
9407
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), $regex_svg_style_notsupported, '')"/>
|
9408
|
+
</xsl:template>
|
9409
|
+
|
9410
|
+
<!-- replace
|
9411
|
+
stroke="rgba(r, g, b, alpha)" to
|
9412
|
+
stroke="rgb(r,g,b)" stroke-opacity="alpha", and
|
9413
|
+
fill="rgba(r, g, b, alpha)" to
|
9414
|
+
fill="rgb(r,g,b)" fill-opacity="alpha" -->
|
9415
|
+
<xsl:template match="@*[local-name() = 'stroke' or local-name() = 'fill'][starts-with(normalize-space(.), 'rgba')]" mode="svg_update">
|
9416
|
+
<xsl:variable name="components_">
|
9417
|
+
<xsl:call-template name="split">
|
9418
|
+
<xsl:with-param name="pText" select="substring-before(substring-after(., '('), ')')"/>
|
9419
|
+
<xsl:with-param name="sep" select="','"/>
|
9420
|
+
</xsl:call-template>
|
9421
|
+
</xsl:variable>
|
9422
|
+
<xsl:variable name="components" select="xalan:nodeset($components_)"/>
|
9423
|
+
<xsl:variable name="att_name" select="local-name()"/>
|
9424
|
+
<xsl:attribute name="{$att_name}"><xsl:value-of select="concat('rgb(', $components/item[1], ',', $components/item[2], ',', $components/item[3], ')')"/></xsl:attribute>
|
9425
|
+
<xsl:attribute name="{$att_name}-opacity"><xsl:value-of select="$components/item[4]"/></xsl:attribute>
|
9426
|
+
</xsl:template>
|
9427
|
+
|
9388
9428
|
<!-- ============== -->
|
9389
9429
|
<!-- END: svg_update -->
|
9390
9430
|
<!-- ============== -->
|
@@ -12343,7 +12383,9 @@
|
|
12343
12383
|
<!-- Update xml -->
|
12344
12384
|
<!-- ===================================== -->
|
12345
12385
|
<!-- =========================================================================== -->
|
12346
|
-
<!-- STEP1:
|
12386
|
+
<!-- STEP1: -->
|
12387
|
+
<!-- - Re-order elements in 'preface', 'sections' based on @displayorder -->
|
12388
|
+
<!-- - Ignore 'span' without style -->
|
12347
12389
|
<!-- =========================================================================== -->
|
12348
12390
|
<xsl:template match="@*|node()" mode="update_xml_step1">
|
12349
12391
|
<xsl:copy>
|
@@ -12426,7 +12468,8 @@
|
|
12426
12468
|
</xsl:copy>
|
12427
12469
|
</xsl:template>
|
12428
12470
|
|
12429
|
-
|
12471
|
+
<!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
|
12472
|
+
<xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" mode="update_xml_step1" priority="2">
|
12430
12473
|
<xsl:copy>
|
12431
12474
|
<xsl:copy-of select="@*"/>
|
12432
12475
|
<xsl:apply-templates mode="update_xml_step1"/>
|
@@ -6492,6 +6492,10 @@
|
|
6492
6492
|
<xsl:variable name="footnote_inline">
|
6493
6493
|
<fo:inline xsl:use-attribute-sets="fn-num-style">
|
6494
6494
|
|
6495
|
+
<xsl:if test="following-sibling::*[1][local-name() = 'fn']">
|
6496
|
+
<xsl:attribute name="padding-right">0.5mm</xsl:attribute>
|
6497
|
+
</xsl:if>
|
6498
|
+
|
6495
6499
|
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
|
6496
6500
|
<xsl:value-of select="$current_fn_number_text"/>
|
6497
6501
|
</fo:basic-link>
|
@@ -7649,6 +7653,23 @@
|
|
7649
7653
|
<xsl:apply-templates/>
|
7650
7654
|
</xsl:template>
|
7651
7655
|
|
7656
|
+
<!-- Don't break standard's numbers -->
|
7657
|
+
<!-- Example : <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
|
7658
|
+
<xsl:template match="*[local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" priority="2">
|
7659
|
+
<xsl:choose>
|
7660
|
+
<xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
|
7661
|
+
<xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
|
7662
|
+
<fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
|
7663
|
+
</xsl:when>
|
7664
|
+
<xsl:otherwise>
|
7665
|
+
<xsl:apply-templates/>
|
7666
|
+
</xsl:otherwise>
|
7667
|
+
</xsl:choose>
|
7668
|
+
</xsl:template>
|
7669
|
+
<xsl:template match="text()[not(ancestor::*[local-name() = 'table']) and preceding-sibling::*[1][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear'] and following-sibling::*[1][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']]" priority="2">
|
7670
|
+
<fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
|
7671
|
+
</xsl:template>
|
7672
|
+
|
7652
7673
|
<!-- ========================= -->
|
7653
7674
|
<!-- END Rich text formatting -->
|
7654
7675
|
<!-- ========================= -->
|
@@ -8044,7 +8065,7 @@
|
|
8044
8065
|
<xsl:choose>
|
8045
8066
|
<xsl:when test="@colspan">
|
8046
8067
|
<xsl:variable name="td">
|
8047
|
-
<xsl:element name="
|
8068
|
+
<xsl:element name="{local-name()}">
|
8048
8069
|
<xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
|
8049
8070
|
<xsl:if test="local-name()='th'">
|
8050
8071
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
@@ -8059,7 +8080,7 @@
|
|
8059
8080
|
</xsl:call-template>
|
8060
8081
|
</xsl:when>
|
8061
8082
|
<xsl:otherwise>
|
8062
|
-
<xsl:element name="
|
8083
|
+
<xsl:element name="{local-name()}">
|
8063
8084
|
<xsl:apply-templates select="@*" mode="simple-table-colspan"/>
|
8064
8085
|
<xsl:if test="local-name()='th'">
|
8065
8086
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
@@ -8126,7 +8147,7 @@
|
|
8126
8147
|
<xsl:variable name="currentRow" select="."/>
|
8127
8148
|
|
8128
8149
|
<xsl:variable name="normalizedTDs">
|
8129
|
-
<xsl:for-each select="xalan:nodeset($previousRow)
|
8150
|
+
<xsl:for-each select="xalan:nodeset($previousRow)//*[self::td or self::th]">
|
8130
8151
|
<xsl:choose>
|
8131
8152
|
<xsl:when test="@rowspan > 1">
|
8132
8153
|
<xsl:copy>
|
@@ -8138,7 +8159,7 @@
|
|
8138
8159
|
</xsl:copy>
|
8139
8160
|
</xsl:when>
|
8140
8161
|
<xsl:otherwise>
|
8141
|
-
<xsl:copy-of select="$currentRow
|
8162
|
+
<xsl:copy-of select="$currentRow/*[self::td or self::th][1 + count(current()/preceding-sibling::*[self::td or self::th][not(@rowspan) or (@rowspan = 1)])]"/>
|
8142
8163
|
</xsl:otherwise>
|
8143
8164
|
</xsl:choose>
|
8144
8165
|
</xsl:for-each>
|
@@ -8853,12 +8874,6 @@
|
|
8853
8874
|
|
8854
8875
|
<fo:block-container margin-left="0mm">
|
8855
8876
|
|
8856
|
-
<!-- <xsl:if test="$namespace = 'iho'">
|
8857
|
-
<xsl:if test="ancestor::iho:td">
|
8858
|
-
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
8859
|
-
</xsl:if>
|
8860
|
-
</xsl:if> -->
|
8861
|
-
|
8862
8877
|
<fo:block>
|
8863
8878
|
|
8864
8879
|
<xsl:if test="@parent-type = 'quote'">
|
@@ -9385,6 +9400,31 @@
|
|
9385
9400
|
<xsl:apply-templates mode="svg_update"/>
|
9386
9401
|
</xsl:copy>
|
9387
9402
|
</xsl:template>
|
9403
|
+
|
9404
|
+
<!-- regex for 'display: inline-block;' -->
|
9405
|
+
<xsl:variable name="regex_svg_style_notsupported">display(\s|\h)*:(\s|\h)*inline-block(\s|\h)*;</xsl:variable>
|
9406
|
+
<xsl:template match="*[local-name() = 'svg']//*[local-name() = 'style']/text()" mode="svg_update">
|
9407
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), $regex_svg_style_notsupported, '')"/>
|
9408
|
+
</xsl:template>
|
9409
|
+
|
9410
|
+
<!-- replace
|
9411
|
+
stroke="rgba(r, g, b, alpha)" to
|
9412
|
+
stroke="rgb(r,g,b)" stroke-opacity="alpha", and
|
9413
|
+
fill="rgba(r, g, b, alpha)" to
|
9414
|
+
fill="rgb(r,g,b)" fill-opacity="alpha" -->
|
9415
|
+
<xsl:template match="@*[local-name() = 'stroke' or local-name() = 'fill'][starts-with(normalize-space(.), 'rgba')]" mode="svg_update">
|
9416
|
+
<xsl:variable name="components_">
|
9417
|
+
<xsl:call-template name="split">
|
9418
|
+
<xsl:with-param name="pText" select="substring-before(substring-after(., '('), ')')"/>
|
9419
|
+
<xsl:with-param name="sep" select="','"/>
|
9420
|
+
</xsl:call-template>
|
9421
|
+
</xsl:variable>
|
9422
|
+
<xsl:variable name="components" select="xalan:nodeset($components_)"/>
|
9423
|
+
<xsl:variable name="att_name" select="local-name()"/>
|
9424
|
+
<xsl:attribute name="{$att_name}"><xsl:value-of select="concat('rgb(', $components/item[1], ',', $components/item[2], ',', $components/item[3], ')')"/></xsl:attribute>
|
9425
|
+
<xsl:attribute name="{$att_name}-opacity"><xsl:value-of select="$components/item[4]"/></xsl:attribute>
|
9426
|
+
</xsl:template>
|
9427
|
+
|
9388
9428
|
<!-- ============== -->
|
9389
9429
|
<!-- END: svg_update -->
|
9390
9430
|
<!-- ============== -->
|
@@ -12343,7 +12383,9 @@
|
|
12343
12383
|
<!-- Update xml -->
|
12344
12384
|
<!-- ===================================== -->
|
12345
12385
|
<!-- =========================================================================== -->
|
12346
|
-
<!-- STEP1:
|
12386
|
+
<!-- STEP1: -->
|
12387
|
+
<!-- - Re-order elements in 'preface', 'sections' based on @displayorder -->
|
12388
|
+
<!-- - Ignore 'span' without style -->
|
12347
12389
|
<!-- =========================================================================== -->
|
12348
12390
|
<xsl:template match="@*|node()" mode="update_xml_step1">
|
12349
12391
|
<xsl:copy>
|
@@ -12426,7 +12468,8 @@
|
|
12426
12468
|
</xsl:copy>
|
12427
12469
|
</xsl:template>
|
12428
12470
|
|
12429
|
-
|
12471
|
+
<!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
|
12472
|
+
<xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" mode="update_xml_step1" priority="2">
|
12430
12473
|
<xsl:copy>
|
12431
12474
|
<xsl:copy-of select="@*"/>
|
12432
12475
|
<xsl:apply-templates mode="update_xml_step1"/>
|
data/lib/isodoc/bipm/index.rb
CHANGED
@@ -14,12 +14,12 @@ module IsoDoc
|
|
14
14
|
return
|
15
15
|
end
|
16
16
|
i = docxml.at(ns("//indexsect")) ||
|
17
|
-
docxml.root.add_child("<indexsect #{add_id}><title>#{@i18n.index}"\
|
17
|
+
docxml.root.add_child("<indexsect #{add_id}><title>#{@i18n.index}" \
|
18
18
|
"</title></indexsect>").first
|
19
19
|
index = sort_indexterms(
|
20
20
|
docxml.xpath(ns("//index")),
|
21
21
|
docxml.xpath(ns("//index-xref[@also = 'false']")),
|
22
|
-
docxml.xpath(ns("//index-xref[@also = 'true']"))
|
22
|
+
docxml.xpath(ns("//index-xref[@also = 'true']")),
|
23
23
|
)
|
24
24
|
index1(docxml, i, index)
|
25
25
|
end
|
@@ -27,7 +27,9 @@ module IsoDoc
|
|
27
27
|
def index1(docxml, i, index)
|
28
28
|
index.keys.sort.each do |k|
|
29
29
|
c = i.add_child "<clause #{add_id}><title>#{k}</title><ul></ul></clause>"
|
30
|
-
words = index[k].keys.each_with_object({})
|
30
|
+
words = index[k].keys.each_with_object({}) do |w, v|
|
31
|
+
v[sortable(w).downcase] = w
|
32
|
+
end
|
31
33
|
words.keys.localize(@lang.to_sym).sort.to_a.each do |w|
|
32
34
|
c.first.at(ns("./ul")).add_child index_entries(words, index[k], w)
|
33
35
|
end
|
@@ -64,12 +66,13 @@ module IsoDoc
|
|
64
66
|
ret = index_entries_head(words[secondary],
|
65
67
|
index.dig(words[secondary], nil),
|
66
68
|
index_entries_opt)
|
67
|
-
words3 = index[words[secondary]]&.keys&.reject
|
69
|
+
words3 = index[words[secondary]]&.keys&.reject(&:nil?)
|
68
70
|
&.each_with_object({}) { |w, v| v[w.downcase] = w }
|
69
71
|
unless words3.empty?
|
70
72
|
ret += "<ul>"
|
71
73
|
words3.keys.localize(@lang.to_sym).sort.to_a.each do |w|
|
72
|
-
ret += (index_entries_head(words3[w],
|
74
|
+
ret += (index_entries_head(words3[w],
|
75
|
+
index[words[secondary]][words3[w]], index_entries_opt) + "</li>")
|
73
76
|
end
|
74
77
|
ret += "</ul>"
|
75
78
|
end
|
@@ -79,10 +82,18 @@ module IsoDoc
|
|
79
82
|
def index_entries_head(head, entries, opt)
|
80
83
|
ret = "<li>#{head}"
|
81
84
|
xref = entries&.dig(:xref)&.join(", ")
|
82
|
-
see_sort = entries&.dig(:see)&.each_with_object({})
|
83
|
-
|
84
|
-
|
85
|
-
|
85
|
+
see_sort = entries&.dig(:see)&.each_with_object({}) do |w, v|
|
86
|
+
v[sortable(w).downcase] = w
|
87
|
+
end
|
88
|
+
see = see_sort&.keys&.localize(@lang.to_sym)&.sort&.to_a&.map do |k|
|
89
|
+
see_sort[k]
|
90
|
+
end&.join(", ")
|
91
|
+
also_sort = entries&.dig(:also)&.each_with_object({}) do |w, v|
|
92
|
+
v[sortable(w).downcase] = w
|
93
|
+
end
|
94
|
+
also = also_sort&.keys&.localize(@lang.to_sym)&.sort&.to_a&.map do |k|
|
95
|
+
also_sort[k]
|
96
|
+
end&.join(", ")
|
86
97
|
ret += "#{opt[:xref_lbl]} #{xref}" if xref
|
87
98
|
ret += "#{opt[:see_lbl]} #{see}" if see
|
88
99
|
ret += "#{opt[:also_lbl]} #{also}" if also
|
@@ -107,16 +118,16 @@ module IsoDoc
|
|
107
118
|
end
|
108
119
|
end
|
109
120
|
|
110
|
-
def extract_indexsee(
|
111
|
-
terms.each_with_object(
|
112
|
-
term = t
|
113
|
-
term2 = t
|
114
|
-
term3 = t
|
121
|
+
def extract_indexsee(idx, terms, label)
|
122
|
+
terms.each_with_object(idx) do |t, v|
|
123
|
+
term = to_xml(t.at(ns("./primary"))&.children)
|
124
|
+
term2 = to_xml(t.at(ns("./secondary"))&.children)
|
125
|
+
term3 = to_xml(t.at(ns("./tertiary"))&.children)
|
115
126
|
v[term] ||= {}
|
116
127
|
v[term][term2] ||= {}
|
117
128
|
v[term][term2][term3] ||= {}
|
118
129
|
v[term][term2][term3][label] ||= []
|
119
|
-
v[term][term2][term3][label] << t
|
130
|
+
v[term][term2][term3][label] << to_xml(t.at(ns("./target"))&.children)
|
120
131
|
t.remove
|
121
132
|
end
|
122
133
|
end
|
@@ -129,9 +140,9 @@ module IsoDoc
|
|
129
140
|
# attributes are decoded into UTF-8, elements in extract_indexsee are still in entities
|
130
141
|
def extract_indexterms(terms)
|
131
142
|
terms.each_with_object({}) do |t, v|
|
132
|
-
term = t
|
133
|
-
term2 = t
|
134
|
-
term3 = t
|
143
|
+
term = to_xml(t.at(ns("./primary"))&.children)
|
144
|
+
term2 = to_xml(t.at(ns("./secondary"))&.children)
|
145
|
+
term3 = to_xml(t.at(ns("./tertiary"))&.children)
|
135
146
|
index2bookmark(t)
|
136
147
|
v[term] ||= {}
|
137
148
|
v[term][term2] ||= {}
|
@@ -4371,6 +4371,10 @@
|
|
4371
4371
|
<xsl:variable name="footnote_inline">
|
4372
4372
|
<fo:inline xsl:use-attribute-sets="fn-num-style">
|
4373
4373
|
|
4374
|
+
<xsl:if test="following-sibling::*[1][local-name() = 'fn']">
|
4375
|
+
<xsl:attribute name="padding-right">0.5mm</xsl:attribute>
|
4376
|
+
</xsl:if>
|
4377
|
+
|
4374
4378
|
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
|
4375
4379
|
<xsl:value-of select="$current_fn_number_text"/>
|
4376
4380
|
</fo:basic-link>
|
@@ -5541,6 +5545,23 @@
|
|
5541
5545
|
<xsl:apply-templates/>
|
5542
5546
|
</xsl:template>
|
5543
5547
|
|
5548
|
+
<!-- Don't break standard's numbers -->
|
5549
|
+
<!-- Example : <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
|
5550
|
+
<xsl:template match="*[local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" priority="2">
|
5551
|
+
<xsl:choose>
|
5552
|
+
<xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
|
5553
|
+
<xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
|
5554
|
+
<fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
|
5555
|
+
</xsl:when>
|
5556
|
+
<xsl:otherwise>
|
5557
|
+
<xsl:apply-templates/>
|
5558
|
+
</xsl:otherwise>
|
5559
|
+
</xsl:choose>
|
5560
|
+
</xsl:template>
|
5561
|
+
<xsl:template match="text()[not(ancestor::*[local-name() = 'table']) and preceding-sibling::*[1][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear'] and following-sibling::*[1][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']]" priority="2">
|
5562
|
+
<fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
|
5563
|
+
</xsl:template>
|
5564
|
+
|
5544
5565
|
<!-- ========================= -->
|
5545
5566
|
<!-- END Rich text formatting -->
|
5546
5567
|
<!-- ========================= -->
|
@@ -5936,7 +5957,7 @@
|
|
5936
5957
|
<xsl:choose>
|
5937
5958
|
<xsl:when test="@colspan">
|
5938
5959
|
<xsl:variable name="td">
|
5939
|
-
<xsl:element name="
|
5960
|
+
<xsl:element name="{local-name()}">
|
5940
5961
|
<xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
|
5941
5962
|
<xsl:if test="local-name()='th'">
|
5942
5963
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
@@ -5951,7 +5972,7 @@
|
|
5951
5972
|
</xsl:call-template>
|
5952
5973
|
</xsl:when>
|
5953
5974
|
<xsl:otherwise>
|
5954
|
-
<xsl:element name="
|
5975
|
+
<xsl:element name="{local-name()}">
|
5955
5976
|
<xsl:apply-templates select="@*" mode="simple-table-colspan"/>
|
5956
5977
|
<xsl:if test="local-name()='th'">
|
5957
5978
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
@@ -6018,7 +6039,7 @@
|
|
6018
6039
|
<xsl:variable name="currentRow" select="."/>
|
6019
6040
|
|
6020
6041
|
<xsl:variable name="normalizedTDs">
|
6021
|
-
<xsl:for-each select="xalan:nodeset($previousRow)
|
6042
|
+
<xsl:for-each select="xalan:nodeset($previousRow)//*[self::td or self::th]">
|
6022
6043
|
<xsl:choose>
|
6023
6044
|
<xsl:when test="@rowspan > 1">
|
6024
6045
|
<xsl:copy>
|
@@ -6030,7 +6051,7 @@
|
|
6030
6051
|
</xsl:copy>
|
6031
6052
|
</xsl:when>
|
6032
6053
|
<xsl:otherwise>
|
6033
|
-
<xsl:copy-of select="$currentRow
|
6054
|
+
<xsl:copy-of select="$currentRow/*[self::td or self::th][1 + count(current()/preceding-sibling::*[self::td or self::th][not(@rowspan) or (@rowspan = 1)])]"/>
|
6034
6055
|
</xsl:otherwise>
|
6035
6056
|
</xsl:choose>
|
6036
6057
|
</xsl:for-each>
|
@@ -6707,12 +6728,6 @@
|
|
6707
6728
|
|
6708
6729
|
<fo:block-container margin-left="0mm">
|
6709
6730
|
|
6710
|
-
<!-- <xsl:if test="$namespace = 'iho'">
|
6711
|
-
<xsl:if test="ancestor::iho:td">
|
6712
|
-
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
6713
|
-
</xsl:if>
|
6714
|
-
</xsl:if> -->
|
6715
|
-
|
6716
6731
|
<fo:block>
|
6717
6732
|
|
6718
6733
|
<fo:inline xsl:use-attribute-sets="note-name-style">
|
@@ -7216,6 +7231,31 @@
|
|
7216
7231
|
<xsl:apply-templates mode="svg_update"/>
|
7217
7232
|
</xsl:copy>
|
7218
7233
|
</xsl:template>
|
7234
|
+
|
7235
|
+
<!-- regex for 'display: inline-block;' -->
|
7236
|
+
<xsl:variable name="regex_svg_style_notsupported">display(\s|\h)*:(\s|\h)*inline-block(\s|\h)*;</xsl:variable>
|
7237
|
+
<xsl:template match="*[local-name() = 'svg']//*[local-name() = 'style']/text()" mode="svg_update">
|
7238
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), $regex_svg_style_notsupported, '')"/>
|
7239
|
+
</xsl:template>
|
7240
|
+
|
7241
|
+
<!-- replace
|
7242
|
+
stroke="rgba(r, g, b, alpha)" to
|
7243
|
+
stroke="rgb(r,g,b)" stroke-opacity="alpha", and
|
7244
|
+
fill="rgba(r, g, b, alpha)" to
|
7245
|
+
fill="rgb(r,g,b)" fill-opacity="alpha" -->
|
7246
|
+
<xsl:template match="@*[local-name() = 'stroke' or local-name() = 'fill'][starts-with(normalize-space(.), 'rgba')]" mode="svg_update">
|
7247
|
+
<xsl:variable name="components_">
|
7248
|
+
<xsl:call-template name="split">
|
7249
|
+
<xsl:with-param name="pText" select="substring-before(substring-after(., '('), ')')"/>
|
7250
|
+
<xsl:with-param name="sep" select="','"/>
|
7251
|
+
</xsl:call-template>
|
7252
|
+
</xsl:variable>
|
7253
|
+
<xsl:variable name="components" select="xalan:nodeset($components_)"/>
|
7254
|
+
<xsl:variable name="att_name" select="local-name()"/>
|
7255
|
+
<xsl:attribute name="{$att_name}"><xsl:value-of select="concat('rgb(', $components/item[1], ',', $components/item[2], ',', $components/item[3], ')')"/></xsl:attribute>
|
7256
|
+
<xsl:attribute name="{$att_name}-opacity"><xsl:value-of select="$components/item[4]"/></xsl:attribute>
|
7257
|
+
</xsl:template>
|
7258
|
+
|
7219
7259
|
<!-- ============== -->
|
7220
7260
|
<!-- END: svg_update -->
|
7221
7261
|
<!-- ============== -->
|
@@ -10163,7 +10203,9 @@
|
|
10163
10203
|
<!-- Update xml -->
|
10164
10204
|
<!-- ===================================== -->
|
10165
10205
|
<!-- =========================================================================== -->
|
10166
|
-
<!-- STEP1:
|
10206
|
+
<!-- STEP1: -->
|
10207
|
+
<!-- - Re-order elements in 'preface', 'sections' based on @displayorder -->
|
10208
|
+
<!-- - Ignore 'span' without style -->
|
10167
10209
|
<!-- =========================================================================== -->
|
10168
10210
|
<xsl:template match="@*|node()" mode="update_xml_step1">
|
10169
10211
|
<xsl:copy>
|
@@ -10246,7 +10288,8 @@
|
|
10246
10288
|
</xsl:copy>
|
10247
10289
|
</xsl:template>
|
10248
10290
|
|
10249
|
-
|
10291
|
+
<!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
|
10292
|
+
<xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" mode="update_xml_step1" priority="2">
|
10250
10293
|
<xsl:copy>
|
10251
10294
|
<xsl:copy-of select="@*"/>
|
10252
10295
|
<xsl:apply-templates mode="update_xml_step1"/>
|
@@ -9,7 +9,7 @@ module IsoDoc
|
|
9
9
|
module BIPM
|
10
10
|
class PresentationXMLConvert < IsoDoc::Generic::PresentationXMLConvert
|
11
11
|
def convert1(docxml, filename, dir)
|
12
|
-
@jcgm = docxml&.at(ns("//bibdata/ext/editorialgroup/committee/"\
|
12
|
+
@jcgm = docxml&.at(ns("//bibdata/ext/editorialgroup/committee/" \
|
13
13
|
"@acronym"))&.value == "JCGM"
|
14
14
|
@iso = IsoDoc::Iso::PresentationXMLConvert
|
15
15
|
.new({ language: @lang, script: @script })
|
@@ -18,9 +18,8 @@ module IsoDoc
|
|
18
18
|
super
|
19
19
|
end
|
20
20
|
|
21
|
-
def eref_localities1(
|
22
|
-
@jcgm and return @iso.eref_localities1(
|
23
|
-
node, lang)
|
21
|
+
def eref_localities1(opt)
|
22
|
+
@jcgm and return @iso.eref_localities1(opt)
|
24
23
|
super
|
25
24
|
end
|
26
25
|
|
@@ -46,7 +45,7 @@ module IsoDoc
|
|
46
45
|
|
47
46
|
lbl = @xrefs.anchor(elem["id"], :label)
|
48
47
|
t = elem.at(ns("./title")) and
|
49
|
-
t.children = "<strong>#{t.children
|
48
|
+
t.children = "<strong>#{to_xml(t.children)}</strong>"
|
50
49
|
prefix_name(elem, ".<tab/>", lbl, "title")
|
51
50
|
end
|
52
51
|
|
@@ -118,7 +117,7 @@ module IsoDoc
|
|
118
117
|
end
|
119
118
|
|
120
119
|
def bibdata_titles(bibdata)
|
121
|
-
return unless app = bibdata.at(ns("//bibdata/ext/"\
|
120
|
+
return unless app = bibdata.at(ns("//bibdata/ext/" \
|
122
121
|
"structuredidentifier/part"))
|
123
122
|
|
124
123
|
bibdata.xpath(ns("//bibdata/title[@type = 'part']")).each do |t|
|
@@ -126,7 +125,7 @@ module IsoDoc
|
|
126
125
|
t["type"] = "part-with-numbering"
|
127
126
|
part = t["language"] == "en" ? "Part" : "Partie"
|
128
127
|
# not looking up in YAML
|
129
|
-
t.children = l10n("#{part} #{app.text}: #{t.children
|
128
|
+
t.children = l10n("#{part} #{app.text}: #{to_xml(t.children)}",
|
130
129
|
t["language"])
|
131
130
|
end
|
132
131
|
end
|
@@ -204,9 +203,9 @@ module IsoDoc
|
|
204
203
|
|
205
204
|
def termsource1(elem)
|
206
205
|
while elem&.next_element&.name == "termsource"
|
207
|
-
elem << "; #{elem.next_element.remove.children
|
206
|
+
elem << "; #{to_xml(elem.next_element.remove.children)}"
|
208
207
|
end
|
209
|
-
elem.children = l10n("[#{@i18n.source} #{elem.children.
|
208
|
+
elem.children = l10n("[#{@i18n.source} #{to_xml(elem.children).strip}]")
|
210
209
|
end
|
211
210
|
|
212
211
|
include Init
|
data/metanorma-bipm.gemspec
CHANGED
@@ -27,8 +27,8 @@ Gem::Specification.new do |spec|
|
|
27
27
|
spec.require_paths = ["lib"]
|
28
28
|
spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
|
29
29
|
|
30
|
-
spec.add_dependency "metanorma-generic", "~> 2.
|
31
|
-
spec.add_dependency "metanorma-iso", "~> 2.
|
30
|
+
spec.add_dependency "metanorma-generic", "~> 2.3.0"
|
31
|
+
spec.add_dependency "metanorma-iso", "~> 2.3.0"
|
32
32
|
|
33
33
|
spec.add_development_dependency "debug"
|
34
34
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-bipm
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.
|
4
|
+
version: 2.2.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ribose Inc.
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: metanorma-generic
|
@@ -16,28 +16,28 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: 2.3.0
|
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: 2.
|
26
|
+
version: 2.3.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: metanorma-iso
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: 2.
|
33
|
+
version: 2.3.0
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: 2.
|
40
|
+
version: 2.3.0
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: debug
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -297,7 +297,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
297
297
|
- !ruby/object:Gem::Version
|
298
298
|
version: '0'
|
299
299
|
requirements: []
|
300
|
-
rubygems_version: 3.3.
|
300
|
+
rubygems_version: 3.3.26
|
301
301
|
signing_key:
|
302
302
|
specification_version: 4
|
303
303
|
summary: metanorma-bipm lets you write BIPM standards in Metanorma.
|