metanorma-un 0.9.13 → 0.10.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/.gitignore +0 -1
- data/lib/isodoc/un/presentation_xml_convert.rb +1 -1
- data/lib/isodoc/un/un.plenary-attachment.xsl +55 -12
- data/lib/isodoc/un/un.plenary.xsl +55 -12
- data/lib/isodoc/un/un.recommendation.xsl +55 -12
- data/lib/metanorma/un/basicdoc.rng +3 -0
- data/lib/metanorma/un/biblio-standoc.rng +1 -1
- data/lib/metanorma/un/isodoc.rng +1 -0
- data/lib/metanorma/un/version.rb +1 -1
- data/metanorma-un.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c1f88faecab823265a04683e0cb537559854d1305ff1131b1406f5485f8f84cc
|
4
|
+
data.tar.gz: f3296a9d4c51493ac3fdf9272c98fabafc090c7722aa31044ef80d90d98107f1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8acc09d4a9cec681e329578ab3262956ade90bcadd9718be93fa4dfdd3a952d2c509a9655f743419572256edee2372be511fd7eef20c096f9d6dc8aeaf8c1fec
|
7
|
+
data.tar.gz: 7028049467e75c46e9aa2e3b17b625f06c440f13f5a3319596b3ba98d7a429d27e7516559c332d73f4052f98a3deede370860b2e98efab1a22069cbff661d436
|
data/.gitignore
CHANGED
@@ -34,7 +34,7 @@ module IsoDoc
|
|
34
34
|
def annex1(elem)
|
35
35
|
lbl = @xrefs.anchor(elem["id"], :label)
|
36
36
|
if t = elem.at(ns("./title"))
|
37
|
-
t.children = "<strong>#{t.children
|
37
|
+
t.children = "<strong>#{to_xml(t.children)}</strong>"
|
38
38
|
end
|
39
39
|
prefix_name(elem, "<br/>", lbl, "title")
|
40
40
|
end
|
@@ -3320,6 +3320,10 @@
|
|
3320
3320
|
<xsl:variable name="footnote_inline">
|
3321
3321
|
<fo:inline xsl:use-attribute-sets="fn-num-style">
|
3322
3322
|
|
3323
|
+
<xsl:if test="following-sibling::*[1][local-name() = 'fn']">
|
3324
|
+
<xsl:attribute name="padding-right">0.5mm</xsl:attribute>
|
3325
|
+
</xsl:if>
|
3326
|
+
|
3323
3327
|
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
|
3324
3328
|
<xsl:value-of select="$current_fn_number_text"/>
|
3325
3329
|
</fo:basic-link>
|
@@ -4468,6 +4472,23 @@
|
|
4468
4472
|
<xsl:apply-templates/>
|
4469
4473
|
</xsl:template>
|
4470
4474
|
|
4475
|
+
<!-- Don't break standard's numbers -->
|
4476
|
+
<!-- Example : <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
|
4477
|
+
<xsl:template match="*[local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" priority="2">
|
4478
|
+
<xsl:choose>
|
4479
|
+
<xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
|
4480
|
+
<xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
|
4481
|
+
<fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
|
4482
|
+
</xsl:when>
|
4483
|
+
<xsl:otherwise>
|
4484
|
+
<xsl:apply-templates/>
|
4485
|
+
</xsl:otherwise>
|
4486
|
+
</xsl:choose>
|
4487
|
+
</xsl:template>
|
4488
|
+
<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">
|
4489
|
+
<fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
|
4490
|
+
</xsl:template>
|
4491
|
+
|
4471
4492
|
<!-- ========================= -->
|
4472
4493
|
<!-- END Rich text formatting -->
|
4473
4494
|
<!-- ========================= -->
|
@@ -4863,7 +4884,7 @@
|
|
4863
4884
|
<xsl:choose>
|
4864
4885
|
<xsl:when test="@colspan">
|
4865
4886
|
<xsl:variable name="td">
|
4866
|
-
<xsl:element name="
|
4887
|
+
<xsl:element name="{local-name()}">
|
4867
4888
|
<xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
|
4868
4889
|
<xsl:if test="local-name()='th'">
|
4869
4890
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
@@ -4878,7 +4899,7 @@
|
|
4878
4899
|
</xsl:call-template>
|
4879
4900
|
</xsl:when>
|
4880
4901
|
<xsl:otherwise>
|
4881
|
-
<xsl:element name="
|
4902
|
+
<xsl:element name="{local-name()}">
|
4882
4903
|
<xsl:apply-templates select="@*" mode="simple-table-colspan"/>
|
4883
4904
|
<xsl:if test="local-name()='th'">
|
4884
4905
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
@@ -4945,7 +4966,7 @@
|
|
4945
4966
|
<xsl:variable name="currentRow" select="."/>
|
4946
4967
|
|
4947
4968
|
<xsl:variable name="normalizedTDs">
|
4948
|
-
<xsl:for-each select="xalan:nodeset($previousRow)
|
4969
|
+
<xsl:for-each select="xalan:nodeset($previousRow)//*[self::td or self::th]">
|
4949
4970
|
<xsl:choose>
|
4950
4971
|
<xsl:when test="@rowspan > 1">
|
4951
4972
|
<xsl:copy>
|
@@ -4957,7 +4978,7 @@
|
|
4957
4978
|
</xsl:copy>
|
4958
4979
|
</xsl:when>
|
4959
4980
|
<xsl:otherwise>
|
4960
|
-
<xsl:copy-of select="$currentRow
|
4981
|
+
<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)])]"/>
|
4961
4982
|
</xsl:otherwise>
|
4962
4983
|
</xsl:choose>
|
4963
4984
|
</xsl:for-each>
|
@@ -5632,12 +5653,6 @@
|
|
5632
5653
|
|
5633
5654
|
<fo:block-container margin-left="0mm">
|
5634
5655
|
|
5635
|
-
<!-- <xsl:if test="$namespace = 'iho'">
|
5636
|
-
<xsl:if test="ancestor::iho:td">
|
5637
|
-
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
5638
|
-
</xsl:if>
|
5639
|
-
</xsl:if> -->
|
5640
|
-
|
5641
5656
|
<fo:block>
|
5642
5657
|
|
5643
5658
|
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
@@ -6152,6 +6167,31 @@
|
|
6152
6167
|
<xsl:apply-templates mode="svg_update"/>
|
6153
6168
|
</xsl:copy>
|
6154
6169
|
</xsl:template>
|
6170
|
+
|
6171
|
+
<!-- regex for 'display: inline-block;' -->
|
6172
|
+
<xsl:variable name="regex_svg_style_notsupported">display(\s|\h)*:(\s|\h)*inline-block(\s|\h)*;</xsl:variable>
|
6173
|
+
<xsl:template match="*[local-name() = 'svg']//*[local-name() = 'style']/text()" mode="svg_update">
|
6174
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), $regex_svg_style_notsupported, '')"/>
|
6175
|
+
</xsl:template>
|
6176
|
+
|
6177
|
+
<!-- replace
|
6178
|
+
stroke="rgba(r, g, b, alpha)" to
|
6179
|
+
stroke="rgb(r,g,b)" stroke-opacity="alpha", and
|
6180
|
+
fill="rgba(r, g, b, alpha)" to
|
6181
|
+
fill="rgb(r,g,b)" fill-opacity="alpha" -->
|
6182
|
+
<xsl:template match="@*[local-name() = 'stroke' or local-name() = 'fill'][starts-with(normalize-space(.), 'rgba')]" mode="svg_update">
|
6183
|
+
<xsl:variable name="components_">
|
6184
|
+
<xsl:call-template name="split">
|
6185
|
+
<xsl:with-param name="pText" select="substring-before(substring-after(., '('), ')')"/>
|
6186
|
+
<xsl:with-param name="sep" select="','"/>
|
6187
|
+
</xsl:call-template>
|
6188
|
+
</xsl:variable>
|
6189
|
+
<xsl:variable name="components" select="xalan:nodeset($components_)"/>
|
6190
|
+
<xsl:variable name="att_name" select="local-name()"/>
|
6191
|
+
<xsl:attribute name="{$att_name}"><xsl:value-of select="concat('rgb(', $components/item[1], ',', $components/item[2], ',', $components/item[3], ')')"/></xsl:attribute>
|
6192
|
+
<xsl:attribute name="{$att_name}-opacity"><xsl:value-of select="$components/item[4]"/></xsl:attribute>
|
6193
|
+
</xsl:template>
|
6194
|
+
|
6155
6195
|
<!-- ============== -->
|
6156
6196
|
<!-- END: svg_update -->
|
6157
6197
|
<!-- ============== -->
|
@@ -9061,7 +9101,9 @@
|
|
9061
9101
|
<!-- Update xml -->
|
9062
9102
|
<!-- ===================================== -->
|
9063
9103
|
<!-- =========================================================================== -->
|
9064
|
-
<!-- STEP1:
|
9104
|
+
<!-- STEP1: -->
|
9105
|
+
<!-- - Re-order elements in 'preface', 'sections' based on @displayorder -->
|
9106
|
+
<!-- - Ignore 'span' without style -->
|
9065
9107
|
<!-- =========================================================================== -->
|
9066
9108
|
<xsl:template match="@*|node()" mode="update_xml_step1">
|
9067
9109
|
<xsl:copy>
|
@@ -9144,7 +9186,8 @@
|
|
9144
9186
|
</xsl:copy>
|
9145
9187
|
</xsl:template>
|
9146
9188
|
|
9147
|
-
|
9189
|
+
<!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
|
9190
|
+
<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">
|
9148
9191
|
<xsl:copy>
|
9149
9192
|
<xsl:copy-of select="@*"/>
|
9150
9193
|
<xsl:apply-templates mode="update_xml_step1"/>
|
@@ -3320,6 +3320,10 @@
|
|
3320
3320
|
<xsl:variable name="footnote_inline">
|
3321
3321
|
<fo:inline xsl:use-attribute-sets="fn-num-style">
|
3322
3322
|
|
3323
|
+
<xsl:if test="following-sibling::*[1][local-name() = 'fn']">
|
3324
|
+
<xsl:attribute name="padding-right">0.5mm</xsl:attribute>
|
3325
|
+
</xsl:if>
|
3326
|
+
|
3323
3327
|
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
|
3324
3328
|
<xsl:value-of select="$current_fn_number_text"/>
|
3325
3329
|
</fo:basic-link>
|
@@ -4468,6 +4472,23 @@
|
|
4468
4472
|
<xsl:apply-templates/>
|
4469
4473
|
</xsl:template>
|
4470
4474
|
|
4475
|
+
<!-- Don't break standard's numbers -->
|
4476
|
+
<!-- Example : <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
|
4477
|
+
<xsl:template match="*[local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" priority="2">
|
4478
|
+
<xsl:choose>
|
4479
|
+
<xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
|
4480
|
+
<xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
|
4481
|
+
<fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
|
4482
|
+
</xsl:when>
|
4483
|
+
<xsl:otherwise>
|
4484
|
+
<xsl:apply-templates/>
|
4485
|
+
</xsl:otherwise>
|
4486
|
+
</xsl:choose>
|
4487
|
+
</xsl:template>
|
4488
|
+
<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">
|
4489
|
+
<fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
|
4490
|
+
</xsl:template>
|
4491
|
+
|
4471
4492
|
<!-- ========================= -->
|
4472
4493
|
<!-- END Rich text formatting -->
|
4473
4494
|
<!-- ========================= -->
|
@@ -4863,7 +4884,7 @@
|
|
4863
4884
|
<xsl:choose>
|
4864
4885
|
<xsl:when test="@colspan">
|
4865
4886
|
<xsl:variable name="td">
|
4866
|
-
<xsl:element name="
|
4887
|
+
<xsl:element name="{local-name()}">
|
4867
4888
|
<xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
|
4868
4889
|
<xsl:if test="local-name()='th'">
|
4869
4890
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
@@ -4878,7 +4899,7 @@
|
|
4878
4899
|
</xsl:call-template>
|
4879
4900
|
</xsl:when>
|
4880
4901
|
<xsl:otherwise>
|
4881
|
-
<xsl:element name="
|
4902
|
+
<xsl:element name="{local-name()}">
|
4882
4903
|
<xsl:apply-templates select="@*" mode="simple-table-colspan"/>
|
4883
4904
|
<xsl:if test="local-name()='th'">
|
4884
4905
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
@@ -4945,7 +4966,7 @@
|
|
4945
4966
|
<xsl:variable name="currentRow" select="."/>
|
4946
4967
|
|
4947
4968
|
<xsl:variable name="normalizedTDs">
|
4948
|
-
<xsl:for-each select="xalan:nodeset($previousRow)
|
4969
|
+
<xsl:for-each select="xalan:nodeset($previousRow)//*[self::td or self::th]">
|
4949
4970
|
<xsl:choose>
|
4950
4971
|
<xsl:when test="@rowspan > 1">
|
4951
4972
|
<xsl:copy>
|
@@ -4957,7 +4978,7 @@
|
|
4957
4978
|
</xsl:copy>
|
4958
4979
|
</xsl:when>
|
4959
4980
|
<xsl:otherwise>
|
4960
|
-
<xsl:copy-of select="$currentRow
|
4981
|
+
<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)])]"/>
|
4961
4982
|
</xsl:otherwise>
|
4962
4983
|
</xsl:choose>
|
4963
4984
|
</xsl:for-each>
|
@@ -5632,12 +5653,6 @@
|
|
5632
5653
|
|
5633
5654
|
<fo:block-container margin-left="0mm">
|
5634
5655
|
|
5635
|
-
<!-- <xsl:if test="$namespace = 'iho'">
|
5636
|
-
<xsl:if test="ancestor::iho:td">
|
5637
|
-
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
5638
|
-
</xsl:if>
|
5639
|
-
</xsl:if> -->
|
5640
|
-
|
5641
5656
|
<fo:block>
|
5642
5657
|
|
5643
5658
|
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
@@ -6152,6 +6167,31 @@
|
|
6152
6167
|
<xsl:apply-templates mode="svg_update"/>
|
6153
6168
|
</xsl:copy>
|
6154
6169
|
</xsl:template>
|
6170
|
+
|
6171
|
+
<!-- regex for 'display: inline-block;' -->
|
6172
|
+
<xsl:variable name="regex_svg_style_notsupported">display(\s|\h)*:(\s|\h)*inline-block(\s|\h)*;</xsl:variable>
|
6173
|
+
<xsl:template match="*[local-name() = 'svg']//*[local-name() = 'style']/text()" mode="svg_update">
|
6174
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), $regex_svg_style_notsupported, '')"/>
|
6175
|
+
</xsl:template>
|
6176
|
+
|
6177
|
+
<!-- replace
|
6178
|
+
stroke="rgba(r, g, b, alpha)" to
|
6179
|
+
stroke="rgb(r,g,b)" stroke-opacity="alpha", and
|
6180
|
+
fill="rgba(r, g, b, alpha)" to
|
6181
|
+
fill="rgb(r,g,b)" fill-opacity="alpha" -->
|
6182
|
+
<xsl:template match="@*[local-name() = 'stroke' or local-name() = 'fill'][starts-with(normalize-space(.), 'rgba')]" mode="svg_update">
|
6183
|
+
<xsl:variable name="components_">
|
6184
|
+
<xsl:call-template name="split">
|
6185
|
+
<xsl:with-param name="pText" select="substring-before(substring-after(., '('), ')')"/>
|
6186
|
+
<xsl:with-param name="sep" select="','"/>
|
6187
|
+
</xsl:call-template>
|
6188
|
+
</xsl:variable>
|
6189
|
+
<xsl:variable name="components" select="xalan:nodeset($components_)"/>
|
6190
|
+
<xsl:variable name="att_name" select="local-name()"/>
|
6191
|
+
<xsl:attribute name="{$att_name}"><xsl:value-of select="concat('rgb(', $components/item[1], ',', $components/item[2], ',', $components/item[3], ')')"/></xsl:attribute>
|
6192
|
+
<xsl:attribute name="{$att_name}-opacity"><xsl:value-of select="$components/item[4]"/></xsl:attribute>
|
6193
|
+
</xsl:template>
|
6194
|
+
|
6155
6195
|
<!-- ============== -->
|
6156
6196
|
<!-- END: svg_update -->
|
6157
6197
|
<!-- ============== -->
|
@@ -9061,7 +9101,9 @@
|
|
9061
9101
|
<!-- Update xml -->
|
9062
9102
|
<!-- ===================================== -->
|
9063
9103
|
<!-- =========================================================================== -->
|
9064
|
-
<!-- STEP1:
|
9104
|
+
<!-- STEP1: -->
|
9105
|
+
<!-- - Re-order elements in 'preface', 'sections' based on @displayorder -->
|
9106
|
+
<!-- - Ignore 'span' without style -->
|
9065
9107
|
<!-- =========================================================================== -->
|
9066
9108
|
<xsl:template match="@*|node()" mode="update_xml_step1">
|
9067
9109
|
<xsl:copy>
|
@@ -9144,7 +9186,8 @@
|
|
9144
9186
|
</xsl:copy>
|
9145
9187
|
</xsl:template>
|
9146
9188
|
|
9147
|
-
|
9189
|
+
<!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
|
9190
|
+
<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">
|
9148
9191
|
<xsl:copy>
|
9149
9192
|
<xsl:copy-of select="@*"/>
|
9150
9193
|
<xsl:apply-templates mode="update_xml_step1"/>
|
@@ -3414,6 +3414,10 @@
|
|
3414
3414
|
<xsl:variable name="footnote_inline">
|
3415
3415
|
<fo:inline xsl:use-attribute-sets="fn-num-style">
|
3416
3416
|
|
3417
|
+
<xsl:if test="following-sibling::*[1][local-name() = 'fn']">
|
3418
|
+
<xsl:attribute name="padding-right">0.5mm</xsl:attribute>
|
3419
|
+
</xsl:if>
|
3420
|
+
|
3417
3421
|
<fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
|
3418
3422
|
<xsl:value-of select="$current_fn_number_text"/>
|
3419
3423
|
</fo:basic-link>
|
@@ -4562,6 +4566,23 @@
|
|
4562
4566
|
<xsl:apply-templates/>
|
4563
4567
|
</xsl:template>
|
4564
4568
|
|
4569
|
+
<!-- Don't break standard's numbers -->
|
4570
|
+
<!-- Example : <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
|
4571
|
+
<xsl:template match="*[local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" priority="2">
|
4572
|
+
<xsl:choose>
|
4573
|
+
<xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
|
4574
|
+
<xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
|
4575
|
+
<fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
|
4576
|
+
</xsl:when>
|
4577
|
+
<xsl:otherwise>
|
4578
|
+
<xsl:apply-templates/>
|
4579
|
+
</xsl:otherwise>
|
4580
|
+
</xsl:choose>
|
4581
|
+
</xsl:template>
|
4582
|
+
<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">
|
4583
|
+
<fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
|
4584
|
+
</xsl:template>
|
4585
|
+
|
4565
4586
|
<!-- ========================= -->
|
4566
4587
|
<!-- END Rich text formatting -->
|
4567
4588
|
<!-- ========================= -->
|
@@ -4957,7 +4978,7 @@
|
|
4957
4978
|
<xsl:choose>
|
4958
4979
|
<xsl:when test="@colspan">
|
4959
4980
|
<xsl:variable name="td">
|
4960
|
-
<xsl:element name="
|
4981
|
+
<xsl:element name="{local-name()}">
|
4961
4982
|
<xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
|
4962
4983
|
<xsl:if test="local-name()='th'">
|
4963
4984
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
@@ -4972,7 +4993,7 @@
|
|
4972
4993
|
</xsl:call-template>
|
4973
4994
|
</xsl:when>
|
4974
4995
|
<xsl:otherwise>
|
4975
|
-
<xsl:element name="
|
4996
|
+
<xsl:element name="{local-name()}">
|
4976
4997
|
<xsl:apply-templates select="@*" mode="simple-table-colspan"/>
|
4977
4998
|
<xsl:if test="local-name()='th'">
|
4978
4999
|
<xsl:attribute name="font-weight">bold</xsl:attribute>
|
@@ -5039,7 +5060,7 @@
|
|
5039
5060
|
<xsl:variable name="currentRow" select="."/>
|
5040
5061
|
|
5041
5062
|
<xsl:variable name="normalizedTDs">
|
5042
|
-
<xsl:for-each select="xalan:nodeset($previousRow)
|
5063
|
+
<xsl:for-each select="xalan:nodeset($previousRow)//*[self::td or self::th]">
|
5043
5064
|
<xsl:choose>
|
5044
5065
|
<xsl:when test="@rowspan > 1">
|
5045
5066
|
<xsl:copy>
|
@@ -5051,7 +5072,7 @@
|
|
5051
5072
|
</xsl:copy>
|
5052
5073
|
</xsl:when>
|
5053
5074
|
<xsl:otherwise>
|
5054
|
-
<xsl:copy-of select="$currentRow
|
5075
|
+
<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)])]"/>
|
5055
5076
|
</xsl:otherwise>
|
5056
5077
|
</xsl:choose>
|
5057
5078
|
</xsl:for-each>
|
@@ -5730,12 +5751,6 @@
|
|
5730
5751
|
|
5731
5752
|
<fo:block-container margin-left="0mm">
|
5732
5753
|
|
5733
|
-
<!-- <xsl:if test="$namespace = 'iho'">
|
5734
|
-
<xsl:if test="ancestor::iho:td">
|
5735
|
-
<xsl:attribute name="font-size">12pt</xsl:attribute>
|
5736
|
-
</xsl:if>
|
5737
|
-
</xsl:if> -->
|
5738
|
-
|
5739
5754
|
<fo:block>
|
5740
5755
|
|
5741
5756
|
<xsl:attribute name="font-size">10pt</xsl:attribute>
|
@@ -6255,6 +6270,31 @@
|
|
6255
6270
|
<xsl:apply-templates mode="svg_update"/>
|
6256
6271
|
</xsl:copy>
|
6257
6272
|
</xsl:template>
|
6273
|
+
|
6274
|
+
<!-- regex for 'display: inline-block;' -->
|
6275
|
+
<xsl:variable name="regex_svg_style_notsupported">display(\s|\h)*:(\s|\h)*inline-block(\s|\h)*;</xsl:variable>
|
6276
|
+
<xsl:template match="*[local-name() = 'svg']//*[local-name() = 'style']/text()" mode="svg_update">
|
6277
|
+
<xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), $regex_svg_style_notsupported, '')"/>
|
6278
|
+
</xsl:template>
|
6279
|
+
|
6280
|
+
<!-- replace
|
6281
|
+
stroke="rgba(r, g, b, alpha)" to
|
6282
|
+
stroke="rgb(r,g,b)" stroke-opacity="alpha", and
|
6283
|
+
fill="rgba(r, g, b, alpha)" to
|
6284
|
+
fill="rgb(r,g,b)" fill-opacity="alpha" -->
|
6285
|
+
<xsl:template match="@*[local-name() = 'stroke' or local-name() = 'fill'][starts-with(normalize-space(.), 'rgba')]" mode="svg_update">
|
6286
|
+
<xsl:variable name="components_">
|
6287
|
+
<xsl:call-template name="split">
|
6288
|
+
<xsl:with-param name="pText" select="substring-before(substring-after(., '('), ')')"/>
|
6289
|
+
<xsl:with-param name="sep" select="','"/>
|
6290
|
+
</xsl:call-template>
|
6291
|
+
</xsl:variable>
|
6292
|
+
<xsl:variable name="components" select="xalan:nodeset($components_)"/>
|
6293
|
+
<xsl:variable name="att_name" select="local-name()"/>
|
6294
|
+
<xsl:attribute name="{$att_name}"><xsl:value-of select="concat('rgb(', $components/item[1], ',', $components/item[2], ',', $components/item[3], ')')"/></xsl:attribute>
|
6295
|
+
<xsl:attribute name="{$att_name}-opacity"><xsl:value-of select="$components/item[4]"/></xsl:attribute>
|
6296
|
+
</xsl:template>
|
6297
|
+
|
6258
6298
|
<!-- ============== -->
|
6259
6299
|
<!-- END: svg_update -->
|
6260
6300
|
<!-- ============== -->
|
@@ -9165,7 +9205,9 @@
|
|
9165
9205
|
<!-- Update xml -->
|
9166
9206
|
<!-- ===================================== -->
|
9167
9207
|
<!-- =========================================================================== -->
|
9168
|
-
<!-- STEP1:
|
9208
|
+
<!-- STEP1: -->
|
9209
|
+
<!-- - Re-order elements in 'preface', 'sections' based on @displayorder -->
|
9210
|
+
<!-- - Ignore 'span' without style -->
|
9169
9211
|
<!-- =========================================================================== -->
|
9170
9212
|
<xsl:template match="@*|node()" mode="update_xml_step1">
|
9171
9213
|
<xsl:copy>
|
@@ -9248,7 +9290,8 @@
|
|
9248
9290
|
</xsl:copy>
|
9249
9291
|
</xsl:template>
|
9250
9292
|
|
9251
|
-
|
9293
|
+
<!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
|
9294
|
+
<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">
|
9252
9295
|
<xsl:copy>
|
9253
9296
|
<xsl:copy-of select="@*"/>
|
9254
9297
|
<xsl:apply-templates mode="update_xml_step1"/>
|
data/lib/metanorma/un/isodoc.rng
CHANGED
data/lib/metanorma/un/version.rb
CHANGED
data/metanorma-un.gemspec
CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.add_dependency "roman-numerals"
|
32
32
|
spec.add_dependency "twitter_cldr"
|
33
33
|
|
34
|
-
spec.add_dependency "metanorma-standoc", "~> 2.
|
34
|
+
spec.add_dependency "metanorma-standoc", "~> 2.3.0"
|
35
35
|
|
36
36
|
spec.add_development_dependency "debug"
|
37
37
|
spec.add_development_dependency "equivalent-xml", "~> 0.6"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: metanorma-un
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.10.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: iso-639
|
@@ -58,14 +58,14 @@ dependencies:
|
|
58
58
|
requirements:
|
59
59
|
- - "~>"
|
60
60
|
- !ruby/object:Gem::Version
|
61
|
-
version: 2.
|
61
|
+
version: 2.3.0
|
62
62
|
type: :runtime
|
63
63
|
prerelease: false
|
64
64
|
version_requirements: !ruby/object:Gem::Requirement
|
65
65
|
requirements:
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
|
-
version: 2.
|
68
|
+
version: 2.3.0
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
70
|
name: debug
|
71
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -288,7 +288,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
288
288
|
- !ruby/object:Gem::Version
|
289
289
|
version: '0'
|
290
290
|
requirements: []
|
291
|
-
rubygems_version: 3.3.
|
291
|
+
rubygems_version: 3.3.26
|
292
292
|
signing_key:
|
293
293
|
specification_version: 4
|
294
294
|
summary: Metanorma for UN.
|