metanorma-ogc 2.2.7 → 2.3.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: '0985f1b0b1d111aa7709f7392cc9960d8e71529622fb50f4680d5a54d7d10f4b'
4
- data.tar.gz: e70162f6802f659133002b67062da53124acc9c8d74c81fdf9d37c34afe56f45
3
+ metadata.gz: 5b9e35e003903e7672a0ee7d84881c84b79fa2ad88d4d64874c59f64158d1bac
4
+ data.tar.gz: 26720e23bc8f29703580e55d66cef66cf93bc117832c0f10f2e375b61d329ce8
5
5
  SHA512:
6
- metadata.gz: 1fec412142d9f7915da728e967ef534342add418d43feb9f95a898ff46d07773935627def39711d46a065a4cdd5e83a1cbdf36163d03ad139f9538a04c1e5d34
7
- data.tar.gz: '001939ffe7e6eca30f8166c774d16057609112fc7eb19501844c26cd51d2b11457599181f68f9ae337a94b24dfd4ed6a6ef6ecf84fa852daeb78dd1e2eede99b'
6
+ metadata.gz: 14fd6a6cf3778bd7a7ae74dc90f4de5cef10bbec26d105d275b9b5716e4cb5cfb63b6cf14ce692f73a7d621777abdb8a4110b5dad9abc2b268d1f9d3b570a6cd
7
+ data.tar.gz: 99fdc7b8ee2f1b86d45df83c980d403f0ad24de15f45537bdb1ccb90fda30ecf169e80bdcf16d46ec68451fce2eddbf1b1a851b3b1b783a98cdef0719eada40f
data/.gitignore CHANGED
@@ -3,7 +3,6 @@
3
3
  .rubocop-https--*
4
4
 
5
5
  /.rspec_status
6
- /Gemfile.devel
7
6
  /Gemfile.lock
8
7
  /coverage/
9
8
  /test.doc
@@ -4162,6 +4162,10 @@
4162
4162
  <xsl:variable name="footnote_inline">
4163
4163
  <fo:inline xsl:use-attribute-sets="fn-num-style">
4164
4164
 
4165
+ <xsl:if test="following-sibling::*[1][local-name() = 'fn']">
4166
+ <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
4167
+ </xsl:if>
4168
+
4165
4169
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
4166
4170
  <xsl:value-of select="$current_fn_number_text"/>
4167
4171
  </fo:basic-link>
@@ -5326,6 +5330,23 @@
5326
5330
  <xsl:apply-templates/>
5327
5331
  </xsl:template>
5328
5332
 
5333
+ <!-- Don't break standard's numbers -->
5334
+ <!-- Example : <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
5335
+ <xsl:template match="*[local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" priority="2">
5336
+ <xsl:choose>
5337
+ <xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
5338
+ <xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
5339
+ <fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
5340
+ </xsl:when>
5341
+ <xsl:otherwise>
5342
+ <xsl:apply-templates/>
5343
+ </xsl:otherwise>
5344
+ </xsl:choose>
5345
+ </xsl:template>
5346
+ <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">
5347
+ <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
5348
+ </xsl:template>
5349
+
5329
5350
  <!-- ========================= -->
5330
5351
  <!-- END Rich text formatting -->
5331
5352
  <!-- ========================= -->
@@ -5721,7 +5742,7 @@
5721
5742
  <xsl:choose>
5722
5743
  <xsl:when test="@colspan">
5723
5744
  <xsl:variable name="td">
5724
- <xsl:element name="td">
5745
+ <xsl:element name="{local-name()}">
5725
5746
  <xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
5726
5747
  <xsl:if test="local-name()='th'">
5727
5748
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -5736,7 +5757,7 @@
5736
5757
  </xsl:call-template>
5737
5758
  </xsl:when>
5738
5759
  <xsl:otherwise>
5739
- <xsl:element name="td">
5760
+ <xsl:element name="{local-name()}">
5740
5761
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
5741
5762
  <xsl:if test="local-name()='th'">
5742
5763
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -5803,7 +5824,7 @@
5803
5824
  <xsl:variable name="currentRow" select="."/>
5804
5825
 
5805
5826
  <xsl:variable name="normalizedTDs">
5806
- <xsl:for-each select="xalan:nodeset($previousRow)//td">
5827
+ <xsl:for-each select="xalan:nodeset($previousRow)//*[self::td or self::th]">
5807
5828
  <xsl:choose>
5808
5829
  <xsl:when test="@rowspan &gt; 1">
5809
5830
  <xsl:copy>
@@ -5815,7 +5836,7 @@
5815
5836
  </xsl:copy>
5816
5837
  </xsl:when>
5817
5838
  <xsl:otherwise>
5818
- <xsl:copy-of select="$currentRow/td[1 + count(current()/preceding-sibling::td[not(@rowspan) or (@rowspan = 1)])]"/>
5839
+ <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)])]"/>
5819
5840
  </xsl:otherwise>
5820
5841
  </xsl:choose>
5821
5842
  </xsl:for-each>
@@ -6489,12 +6510,6 @@
6489
6510
 
6490
6511
  <fo:block-container margin-left="0mm">
6491
6512
 
6492
- <!-- <xsl:if test="$namespace = 'iho'">
6493
- <xsl:if test="ancestor::iho:td">
6494
- <xsl:attribute name="font-size">12pt</xsl:attribute>
6495
- </xsl:if>
6496
- </xsl:if> -->
6497
-
6498
6513
  <fo:block>
6499
6514
 
6500
6515
  <fo:inline xsl:use-attribute-sets="note-name-style">
@@ -7002,6 +7017,31 @@
7002
7017
  <xsl:apply-templates mode="svg_update"/>
7003
7018
  </xsl:copy>
7004
7019
  </xsl:template>
7020
+
7021
+ <!-- regex for 'display: inline-block;' -->
7022
+ <xsl:variable name="regex_svg_style_notsupported">display(\s|\h)*:(\s|\h)*inline-block(\s|\h)*;</xsl:variable>
7023
+ <xsl:template match="*[local-name() = 'svg']//*[local-name() = 'style']/text()" mode="svg_update">
7024
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), $regex_svg_style_notsupported, '')"/>
7025
+ </xsl:template>
7026
+
7027
+ <!-- replace
7028
+ stroke="rgba(r, g, b, alpha)" to
7029
+ stroke="rgb(r,g,b)" stroke-opacity="alpha", and
7030
+ fill="rgba(r, g, b, alpha)" to
7031
+ fill="rgb(r,g,b)" fill-opacity="alpha" -->
7032
+ <xsl:template match="@*[local-name() = 'stroke' or local-name() = 'fill'][starts-with(normalize-space(.), 'rgba')]" mode="svg_update">
7033
+ <xsl:variable name="components_">
7034
+ <xsl:call-template name="split">
7035
+ <xsl:with-param name="pText" select="substring-before(substring-after(., '('), ')')"/>
7036
+ <xsl:with-param name="sep" select="','"/>
7037
+ </xsl:call-template>
7038
+ </xsl:variable>
7039
+ <xsl:variable name="components" select="xalan:nodeset($components_)"/>
7040
+ <xsl:variable name="att_name" select="local-name()"/>
7041
+ <xsl:attribute name="{$att_name}"><xsl:value-of select="concat('rgb(', $components/item[1], ',', $components/item[2], ',', $components/item[3], ')')"/></xsl:attribute>
7042
+ <xsl:attribute name="{$att_name}-opacity"><xsl:value-of select="$components/item[4]"/></xsl:attribute>
7043
+ </xsl:template>
7044
+
7005
7045
  <!-- ============== -->
7006
7046
  <!-- END: svg_update -->
7007
7047
  <!-- ============== -->
@@ -9982,7 +10022,9 @@
9982
10022
  <!-- Update xml -->
9983
10023
  <!-- ===================================== -->
9984
10024
  <!-- =========================================================================== -->
9985
- <!-- STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
10025
+ <!-- STEP1: -->
10026
+ <!-- - Re-order elements in 'preface', 'sections' based on @displayorder -->
10027
+ <!-- - Ignore 'span' without style -->
9986
10028
  <!-- =========================================================================== -->
9987
10029
  <xsl:template match="@*|node()" mode="update_xml_step1">
9988
10030
  <xsl:copy>
@@ -10065,7 +10107,8 @@
10065
10107
  </xsl:copy>
10066
10108
  </xsl:template>
10067
10109
 
10068
- <xsl:template match="*[local-name() = 'span'][@style]" mode="update_xml_step1" priority="2">
10110
+ <!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
10111
+ <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">
10069
10112
  <xsl:copy>
10070
10113
  <xsl:copy-of select="@*"/>
10071
10114
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -4162,6 +4162,10 @@
4162
4162
  <xsl:variable name="footnote_inline">
4163
4163
  <fo:inline xsl:use-attribute-sets="fn-num-style">
4164
4164
 
4165
+ <xsl:if test="following-sibling::*[1][local-name() = 'fn']">
4166
+ <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
4167
+ </xsl:if>
4168
+
4165
4169
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
4166
4170
  <xsl:value-of select="$current_fn_number_text"/>
4167
4171
  </fo:basic-link>
@@ -5326,6 +5330,23 @@
5326
5330
  <xsl:apply-templates/>
5327
5331
  </xsl:template>
5328
5332
 
5333
+ <!-- Don't break standard's numbers -->
5334
+ <!-- Example : <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
5335
+ <xsl:template match="*[local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" priority="2">
5336
+ <xsl:choose>
5337
+ <xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
5338
+ <xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
5339
+ <fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
5340
+ </xsl:when>
5341
+ <xsl:otherwise>
5342
+ <xsl:apply-templates/>
5343
+ </xsl:otherwise>
5344
+ </xsl:choose>
5345
+ </xsl:template>
5346
+ <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">
5347
+ <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
5348
+ </xsl:template>
5349
+
5329
5350
  <!-- ========================= -->
5330
5351
  <!-- END Rich text formatting -->
5331
5352
  <!-- ========================= -->
@@ -5721,7 +5742,7 @@
5721
5742
  <xsl:choose>
5722
5743
  <xsl:when test="@colspan">
5723
5744
  <xsl:variable name="td">
5724
- <xsl:element name="td">
5745
+ <xsl:element name="{local-name()}">
5725
5746
  <xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
5726
5747
  <xsl:if test="local-name()='th'">
5727
5748
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -5736,7 +5757,7 @@
5736
5757
  </xsl:call-template>
5737
5758
  </xsl:when>
5738
5759
  <xsl:otherwise>
5739
- <xsl:element name="td">
5760
+ <xsl:element name="{local-name()}">
5740
5761
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
5741
5762
  <xsl:if test="local-name()='th'">
5742
5763
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -5803,7 +5824,7 @@
5803
5824
  <xsl:variable name="currentRow" select="."/>
5804
5825
 
5805
5826
  <xsl:variable name="normalizedTDs">
5806
- <xsl:for-each select="xalan:nodeset($previousRow)//td">
5827
+ <xsl:for-each select="xalan:nodeset($previousRow)//*[self::td or self::th]">
5807
5828
  <xsl:choose>
5808
5829
  <xsl:when test="@rowspan &gt; 1">
5809
5830
  <xsl:copy>
@@ -5815,7 +5836,7 @@
5815
5836
  </xsl:copy>
5816
5837
  </xsl:when>
5817
5838
  <xsl:otherwise>
5818
- <xsl:copy-of select="$currentRow/td[1 + count(current()/preceding-sibling::td[not(@rowspan) or (@rowspan = 1)])]"/>
5839
+ <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)])]"/>
5819
5840
  </xsl:otherwise>
5820
5841
  </xsl:choose>
5821
5842
  </xsl:for-each>
@@ -6489,12 +6510,6 @@
6489
6510
 
6490
6511
  <fo:block-container margin-left="0mm">
6491
6512
 
6492
- <!-- <xsl:if test="$namespace = 'iho'">
6493
- <xsl:if test="ancestor::iho:td">
6494
- <xsl:attribute name="font-size">12pt</xsl:attribute>
6495
- </xsl:if>
6496
- </xsl:if> -->
6497
-
6498
6513
  <fo:block>
6499
6514
 
6500
6515
  <fo:inline xsl:use-attribute-sets="note-name-style">
@@ -7002,6 +7017,31 @@
7002
7017
  <xsl:apply-templates mode="svg_update"/>
7003
7018
  </xsl:copy>
7004
7019
  </xsl:template>
7020
+
7021
+ <!-- regex for 'display: inline-block;' -->
7022
+ <xsl:variable name="regex_svg_style_notsupported">display(\s|\h)*:(\s|\h)*inline-block(\s|\h)*;</xsl:variable>
7023
+ <xsl:template match="*[local-name() = 'svg']//*[local-name() = 'style']/text()" mode="svg_update">
7024
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), $regex_svg_style_notsupported, '')"/>
7025
+ </xsl:template>
7026
+
7027
+ <!-- replace
7028
+ stroke="rgba(r, g, b, alpha)" to
7029
+ stroke="rgb(r,g,b)" stroke-opacity="alpha", and
7030
+ fill="rgba(r, g, b, alpha)" to
7031
+ fill="rgb(r,g,b)" fill-opacity="alpha" -->
7032
+ <xsl:template match="@*[local-name() = 'stroke' or local-name() = 'fill'][starts-with(normalize-space(.), 'rgba')]" mode="svg_update">
7033
+ <xsl:variable name="components_">
7034
+ <xsl:call-template name="split">
7035
+ <xsl:with-param name="pText" select="substring-before(substring-after(., '('), ')')"/>
7036
+ <xsl:with-param name="sep" select="','"/>
7037
+ </xsl:call-template>
7038
+ </xsl:variable>
7039
+ <xsl:variable name="components" select="xalan:nodeset($components_)"/>
7040
+ <xsl:variable name="att_name" select="local-name()"/>
7041
+ <xsl:attribute name="{$att_name}"><xsl:value-of select="concat('rgb(', $components/item[1], ',', $components/item[2], ',', $components/item[3], ')')"/></xsl:attribute>
7042
+ <xsl:attribute name="{$att_name}-opacity"><xsl:value-of select="$components/item[4]"/></xsl:attribute>
7043
+ </xsl:template>
7044
+
7005
7045
  <!-- ============== -->
7006
7046
  <!-- END: svg_update -->
7007
7047
  <!-- ============== -->
@@ -9982,7 +10022,9 @@
9982
10022
  <!-- Update xml -->
9983
10023
  <!-- ===================================== -->
9984
10024
  <!-- =========================================================================== -->
9985
- <!-- STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
10025
+ <!-- STEP1: -->
10026
+ <!-- - Re-order elements in 'preface', 'sections' based on @displayorder -->
10027
+ <!-- - Ignore 'span' without style -->
9986
10028
  <!-- =========================================================================== -->
9987
10029
  <xsl:template match="@*|node()" mode="update_xml_step1">
9988
10030
  <xsl:copy>
@@ -10065,7 +10107,8 @@
10065
10107
  </xsl:copy>
10066
10108
  </xsl:template>
10067
10109
 
10068
- <xsl:template match="*[local-name() = 'span'][@style]" mode="update_xml_step1" priority="2">
10110
+ <!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
10111
+ <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">
10069
10112
  <xsl:copy>
10070
10113
  <xsl:copy-of select="@*"/>
10071
10114
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -4162,6 +4162,10 @@
4162
4162
  <xsl:variable name="footnote_inline">
4163
4163
  <fo:inline xsl:use-attribute-sets="fn-num-style">
4164
4164
 
4165
+ <xsl:if test="following-sibling::*[1][local-name() = 'fn']">
4166
+ <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
4167
+ </xsl:if>
4168
+
4165
4169
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
4166
4170
  <xsl:value-of select="$current_fn_number_text"/>
4167
4171
  </fo:basic-link>
@@ -5326,6 +5330,23 @@
5326
5330
  <xsl:apply-templates/>
5327
5331
  </xsl:template>
5328
5332
 
5333
+ <!-- Don't break standard's numbers -->
5334
+ <!-- Example : <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
5335
+ <xsl:template match="*[local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" priority="2">
5336
+ <xsl:choose>
5337
+ <xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
5338
+ <xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
5339
+ <fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
5340
+ </xsl:when>
5341
+ <xsl:otherwise>
5342
+ <xsl:apply-templates/>
5343
+ </xsl:otherwise>
5344
+ </xsl:choose>
5345
+ </xsl:template>
5346
+ <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">
5347
+ <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
5348
+ </xsl:template>
5349
+
5329
5350
  <!-- ========================= -->
5330
5351
  <!-- END Rich text formatting -->
5331
5352
  <!-- ========================= -->
@@ -5721,7 +5742,7 @@
5721
5742
  <xsl:choose>
5722
5743
  <xsl:when test="@colspan">
5723
5744
  <xsl:variable name="td">
5724
- <xsl:element name="td">
5745
+ <xsl:element name="{local-name()}">
5725
5746
  <xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
5726
5747
  <xsl:if test="local-name()='th'">
5727
5748
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -5736,7 +5757,7 @@
5736
5757
  </xsl:call-template>
5737
5758
  </xsl:when>
5738
5759
  <xsl:otherwise>
5739
- <xsl:element name="td">
5760
+ <xsl:element name="{local-name()}">
5740
5761
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
5741
5762
  <xsl:if test="local-name()='th'">
5742
5763
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -5803,7 +5824,7 @@
5803
5824
  <xsl:variable name="currentRow" select="."/>
5804
5825
 
5805
5826
  <xsl:variable name="normalizedTDs">
5806
- <xsl:for-each select="xalan:nodeset($previousRow)//td">
5827
+ <xsl:for-each select="xalan:nodeset($previousRow)//*[self::td or self::th]">
5807
5828
  <xsl:choose>
5808
5829
  <xsl:when test="@rowspan &gt; 1">
5809
5830
  <xsl:copy>
@@ -5815,7 +5836,7 @@
5815
5836
  </xsl:copy>
5816
5837
  </xsl:when>
5817
5838
  <xsl:otherwise>
5818
- <xsl:copy-of select="$currentRow/td[1 + count(current()/preceding-sibling::td[not(@rowspan) or (@rowspan = 1)])]"/>
5839
+ <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)])]"/>
5819
5840
  </xsl:otherwise>
5820
5841
  </xsl:choose>
5821
5842
  </xsl:for-each>
@@ -6489,12 +6510,6 @@
6489
6510
 
6490
6511
  <fo:block-container margin-left="0mm">
6491
6512
 
6492
- <!-- <xsl:if test="$namespace = 'iho'">
6493
- <xsl:if test="ancestor::iho:td">
6494
- <xsl:attribute name="font-size">12pt</xsl:attribute>
6495
- </xsl:if>
6496
- </xsl:if> -->
6497
-
6498
6513
  <fo:block>
6499
6514
 
6500
6515
  <fo:inline xsl:use-attribute-sets="note-name-style">
@@ -7002,6 +7017,31 @@
7002
7017
  <xsl:apply-templates mode="svg_update"/>
7003
7018
  </xsl:copy>
7004
7019
  </xsl:template>
7020
+
7021
+ <!-- regex for 'display: inline-block;' -->
7022
+ <xsl:variable name="regex_svg_style_notsupported">display(\s|\h)*:(\s|\h)*inline-block(\s|\h)*;</xsl:variable>
7023
+ <xsl:template match="*[local-name() = 'svg']//*[local-name() = 'style']/text()" mode="svg_update">
7024
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), $regex_svg_style_notsupported, '')"/>
7025
+ </xsl:template>
7026
+
7027
+ <!-- replace
7028
+ stroke="rgba(r, g, b, alpha)" to
7029
+ stroke="rgb(r,g,b)" stroke-opacity="alpha", and
7030
+ fill="rgba(r, g, b, alpha)" to
7031
+ fill="rgb(r,g,b)" fill-opacity="alpha" -->
7032
+ <xsl:template match="@*[local-name() = 'stroke' or local-name() = 'fill'][starts-with(normalize-space(.), 'rgba')]" mode="svg_update">
7033
+ <xsl:variable name="components_">
7034
+ <xsl:call-template name="split">
7035
+ <xsl:with-param name="pText" select="substring-before(substring-after(., '('), ')')"/>
7036
+ <xsl:with-param name="sep" select="','"/>
7037
+ </xsl:call-template>
7038
+ </xsl:variable>
7039
+ <xsl:variable name="components" select="xalan:nodeset($components_)"/>
7040
+ <xsl:variable name="att_name" select="local-name()"/>
7041
+ <xsl:attribute name="{$att_name}"><xsl:value-of select="concat('rgb(', $components/item[1], ',', $components/item[2], ',', $components/item[3], ')')"/></xsl:attribute>
7042
+ <xsl:attribute name="{$att_name}-opacity"><xsl:value-of select="$components/item[4]"/></xsl:attribute>
7043
+ </xsl:template>
7044
+
7005
7045
  <!-- ============== -->
7006
7046
  <!-- END: svg_update -->
7007
7047
  <!-- ============== -->
@@ -9982,7 +10022,9 @@
9982
10022
  <!-- Update xml -->
9983
10023
  <!-- ===================================== -->
9984
10024
  <!-- =========================================================================== -->
9985
- <!-- STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
10025
+ <!-- STEP1: -->
10026
+ <!-- - Re-order elements in 'preface', 'sections' based on @displayorder -->
10027
+ <!-- - Ignore 'span' without style -->
9986
10028
  <!-- =========================================================================== -->
9987
10029
  <xsl:template match="@*|node()" mode="update_xml_step1">
9988
10030
  <xsl:copy>
@@ -10065,7 +10107,8 @@
10065
10107
  </xsl:copy>
10066
10108
  </xsl:template>
10067
10109
 
10068
- <xsl:template match="*[local-name() = 'span'][@style]" mode="update_xml_step1" priority="2">
10110
+ <!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
10111
+ <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">
10069
10112
  <xsl:copy>
10070
10113
  <xsl:copy-of select="@*"/>
10071
10114
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -4162,6 +4162,10 @@
4162
4162
  <xsl:variable name="footnote_inline">
4163
4163
  <fo:inline xsl:use-attribute-sets="fn-num-style">
4164
4164
 
4165
+ <xsl:if test="following-sibling::*[1][local-name() = 'fn']">
4166
+ <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
4167
+ </xsl:if>
4168
+
4165
4169
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
4166
4170
  <xsl:value-of select="$current_fn_number_text"/>
4167
4171
  </fo:basic-link>
@@ -5326,6 +5330,23 @@
5326
5330
  <xsl:apply-templates/>
5327
5331
  </xsl:template>
5328
5332
 
5333
+ <!-- Don't break standard's numbers -->
5334
+ <!-- Example : <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
5335
+ <xsl:template match="*[local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" priority="2">
5336
+ <xsl:choose>
5337
+ <xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
5338
+ <xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
5339
+ <fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
5340
+ </xsl:when>
5341
+ <xsl:otherwise>
5342
+ <xsl:apply-templates/>
5343
+ </xsl:otherwise>
5344
+ </xsl:choose>
5345
+ </xsl:template>
5346
+ <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">
5347
+ <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
5348
+ </xsl:template>
5349
+
5329
5350
  <!-- ========================= -->
5330
5351
  <!-- END Rich text formatting -->
5331
5352
  <!-- ========================= -->
@@ -5721,7 +5742,7 @@
5721
5742
  <xsl:choose>
5722
5743
  <xsl:when test="@colspan">
5723
5744
  <xsl:variable name="td">
5724
- <xsl:element name="td">
5745
+ <xsl:element name="{local-name()}">
5725
5746
  <xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
5726
5747
  <xsl:if test="local-name()='th'">
5727
5748
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -5736,7 +5757,7 @@
5736
5757
  </xsl:call-template>
5737
5758
  </xsl:when>
5738
5759
  <xsl:otherwise>
5739
- <xsl:element name="td">
5760
+ <xsl:element name="{local-name()}">
5740
5761
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
5741
5762
  <xsl:if test="local-name()='th'">
5742
5763
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -5803,7 +5824,7 @@
5803
5824
  <xsl:variable name="currentRow" select="."/>
5804
5825
 
5805
5826
  <xsl:variable name="normalizedTDs">
5806
- <xsl:for-each select="xalan:nodeset($previousRow)//td">
5827
+ <xsl:for-each select="xalan:nodeset($previousRow)//*[self::td or self::th]">
5807
5828
  <xsl:choose>
5808
5829
  <xsl:when test="@rowspan &gt; 1">
5809
5830
  <xsl:copy>
@@ -5815,7 +5836,7 @@
5815
5836
  </xsl:copy>
5816
5837
  </xsl:when>
5817
5838
  <xsl:otherwise>
5818
- <xsl:copy-of select="$currentRow/td[1 + count(current()/preceding-sibling::td[not(@rowspan) or (@rowspan = 1)])]"/>
5839
+ <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)])]"/>
5819
5840
  </xsl:otherwise>
5820
5841
  </xsl:choose>
5821
5842
  </xsl:for-each>
@@ -6489,12 +6510,6 @@
6489
6510
 
6490
6511
  <fo:block-container margin-left="0mm">
6491
6512
 
6492
- <!-- <xsl:if test="$namespace = 'iho'">
6493
- <xsl:if test="ancestor::iho:td">
6494
- <xsl:attribute name="font-size">12pt</xsl:attribute>
6495
- </xsl:if>
6496
- </xsl:if> -->
6497
-
6498
6513
  <fo:block>
6499
6514
 
6500
6515
  <fo:inline xsl:use-attribute-sets="note-name-style">
@@ -7002,6 +7017,31 @@
7002
7017
  <xsl:apply-templates mode="svg_update"/>
7003
7018
  </xsl:copy>
7004
7019
  </xsl:template>
7020
+
7021
+ <!-- regex for 'display: inline-block;' -->
7022
+ <xsl:variable name="regex_svg_style_notsupported">display(\s|\h)*:(\s|\h)*inline-block(\s|\h)*;</xsl:variable>
7023
+ <xsl:template match="*[local-name() = 'svg']//*[local-name() = 'style']/text()" mode="svg_update">
7024
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), $regex_svg_style_notsupported, '')"/>
7025
+ </xsl:template>
7026
+
7027
+ <!-- replace
7028
+ stroke="rgba(r, g, b, alpha)" to
7029
+ stroke="rgb(r,g,b)" stroke-opacity="alpha", and
7030
+ fill="rgba(r, g, b, alpha)" to
7031
+ fill="rgb(r,g,b)" fill-opacity="alpha" -->
7032
+ <xsl:template match="@*[local-name() = 'stroke' or local-name() = 'fill'][starts-with(normalize-space(.), 'rgba')]" mode="svg_update">
7033
+ <xsl:variable name="components_">
7034
+ <xsl:call-template name="split">
7035
+ <xsl:with-param name="pText" select="substring-before(substring-after(., '('), ')')"/>
7036
+ <xsl:with-param name="sep" select="','"/>
7037
+ </xsl:call-template>
7038
+ </xsl:variable>
7039
+ <xsl:variable name="components" select="xalan:nodeset($components_)"/>
7040
+ <xsl:variable name="att_name" select="local-name()"/>
7041
+ <xsl:attribute name="{$att_name}"><xsl:value-of select="concat('rgb(', $components/item[1], ',', $components/item[2], ',', $components/item[3], ')')"/></xsl:attribute>
7042
+ <xsl:attribute name="{$att_name}-opacity"><xsl:value-of select="$components/item[4]"/></xsl:attribute>
7043
+ </xsl:template>
7044
+
7005
7045
  <!-- ============== -->
7006
7046
  <!-- END: svg_update -->
7007
7047
  <!-- ============== -->
@@ -9982,7 +10022,9 @@
9982
10022
  <!-- Update xml -->
9983
10023
  <!-- ===================================== -->
9984
10024
  <!-- =========================================================================== -->
9985
- <!-- STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
10025
+ <!-- STEP1: -->
10026
+ <!-- - Re-order elements in 'preface', 'sections' based on @displayorder -->
10027
+ <!-- - Ignore 'span' without style -->
9986
10028
  <!-- =========================================================================== -->
9987
10029
  <xsl:template match="@*|node()" mode="update_xml_step1">
9988
10030
  <xsl:copy>
@@ -10065,7 +10107,8 @@
10065
10107
  </xsl:copy>
10066
10108
  </xsl:template>
10067
10109
 
10068
- <xsl:template match="*[local-name() = 'span'][@style]" mode="update_xml_step1" priority="2">
10110
+ <!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
10111
+ <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">
10069
10112
  <xsl:copy>
10070
10113
  <xsl:copy-of select="@*"/>
10071
10114
  <xsl:apply-templates mode="update_xml_step1"/>