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.
@@ -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"/>
@@ -3348,6 +3348,10 @@
3348
3348
  <xsl:variable name="footnote_inline">
3349
3349
  <fo:inline xsl:use-attribute-sets="fn-num-style">
3350
3350
 
3351
+ <xsl:if test="following-sibling::*[1][local-name() = 'fn']">
3352
+ <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
3353
+ </xsl:if>
3354
+
3351
3355
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
3352
3356
  <xsl:value-of select="$current_fn_number_text"/>
3353
3357
  </fo:basic-link>
@@ -4512,6 +4516,23 @@
4512
4516
  <xsl:apply-templates/>
4513
4517
  </xsl:template>
4514
4518
 
4519
+ <!-- Don't break standard's numbers -->
4520
+ <!-- Example : <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
4521
+ <xsl:template match="*[local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" priority="2">
4522
+ <xsl:choose>
4523
+ <xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
4524
+ <xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
4525
+ <fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
4526
+ </xsl:when>
4527
+ <xsl:otherwise>
4528
+ <xsl:apply-templates/>
4529
+ </xsl:otherwise>
4530
+ </xsl:choose>
4531
+ </xsl:template>
4532
+ <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">
4533
+ <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
4534
+ </xsl:template>
4535
+
4515
4536
  <!-- ========================= -->
4516
4537
  <!-- END Rich text formatting -->
4517
4538
  <!-- ========================= -->
@@ -4907,7 +4928,7 @@
4907
4928
  <xsl:choose>
4908
4929
  <xsl:when test="@colspan">
4909
4930
  <xsl:variable name="td">
4910
- <xsl:element name="td">
4931
+ <xsl:element name="{local-name()}">
4911
4932
  <xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
4912
4933
  <xsl:if test="local-name()='th'">
4913
4934
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -4922,7 +4943,7 @@
4922
4943
  </xsl:call-template>
4923
4944
  </xsl:when>
4924
4945
  <xsl:otherwise>
4925
- <xsl:element name="td">
4946
+ <xsl:element name="{local-name()}">
4926
4947
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
4927
4948
  <xsl:if test="local-name()='th'">
4928
4949
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -4989,7 +5010,7 @@
4989
5010
  <xsl:variable name="currentRow" select="."/>
4990
5011
 
4991
5012
  <xsl:variable name="normalizedTDs">
4992
- <xsl:for-each select="xalan:nodeset($previousRow)//td">
5013
+ <xsl:for-each select="xalan:nodeset($previousRow)//*[self::td or self::th]">
4993
5014
  <xsl:choose>
4994
5015
  <xsl:when test="@rowspan &gt; 1">
4995
5016
  <xsl:copy>
@@ -5001,7 +5022,7 @@
5001
5022
  </xsl:copy>
5002
5023
  </xsl:when>
5003
5024
  <xsl:otherwise>
5004
- <xsl:copy-of select="$currentRow/td[1 + count(current()/preceding-sibling::td[not(@rowspan) or (@rowspan = 1)])]"/>
5025
+ <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)])]"/>
5005
5026
  </xsl:otherwise>
5006
5027
  </xsl:choose>
5007
5028
  </xsl:for-each>
@@ -5675,12 +5696,6 @@
5675
5696
 
5676
5697
  <fo:block-container margin-left="0mm">
5677
5698
 
5678
- <!-- <xsl:if test="$namespace = 'iho'">
5679
- <xsl:if test="ancestor::iho:td">
5680
- <xsl:attribute name="font-size">12pt</xsl:attribute>
5681
- </xsl:if>
5682
- </xsl:if> -->
5683
-
5684
5699
  <fo:block>
5685
5700
 
5686
5701
  <fo:inline xsl:use-attribute-sets="note-name-style">
@@ -6184,6 +6199,31 @@
6184
6199
  <xsl:apply-templates mode="svg_update"/>
6185
6200
  </xsl:copy>
6186
6201
  </xsl:template>
6202
+
6203
+ <!-- regex for 'display: inline-block;' -->
6204
+ <xsl:variable name="regex_svg_style_notsupported">display(\s|\h)*:(\s|\h)*inline-block(\s|\h)*;</xsl:variable>
6205
+ <xsl:template match="*[local-name() = 'svg']//*[local-name() = 'style']/text()" mode="svg_update">
6206
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), $regex_svg_style_notsupported, '')"/>
6207
+ </xsl:template>
6208
+
6209
+ <!-- replace
6210
+ stroke="rgba(r, g, b, alpha)" to
6211
+ stroke="rgb(r,g,b)" stroke-opacity="alpha", and
6212
+ fill="rgba(r, g, b, alpha)" to
6213
+ fill="rgb(r,g,b)" fill-opacity="alpha" -->
6214
+ <xsl:template match="@*[local-name() = 'stroke' or local-name() = 'fill'][starts-with(normalize-space(.), 'rgba')]" mode="svg_update">
6215
+ <xsl:variable name="components_">
6216
+ <xsl:call-template name="split">
6217
+ <xsl:with-param name="pText" select="substring-before(substring-after(., '('), ')')"/>
6218
+ <xsl:with-param name="sep" select="','"/>
6219
+ </xsl:call-template>
6220
+ </xsl:variable>
6221
+ <xsl:variable name="components" select="xalan:nodeset($components_)"/>
6222
+ <xsl:variable name="att_name" select="local-name()"/>
6223
+ <xsl:attribute name="{$att_name}"><xsl:value-of select="concat('rgb(', $components/item[1], ',', $components/item[2], ',', $components/item[3], ')')"/></xsl:attribute>
6224
+ <xsl:attribute name="{$att_name}-opacity"><xsl:value-of select="$components/item[4]"/></xsl:attribute>
6225
+ </xsl:template>
6226
+
6187
6227
  <!-- ============== -->
6188
6228
  <!-- END: svg_update -->
6189
6229
  <!-- ============== -->
@@ -9136,7 +9176,9 @@
9136
9176
  <!-- Update xml -->
9137
9177
  <!-- ===================================== -->
9138
9178
  <!-- =========================================================================== -->
9139
- <!-- STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
9179
+ <!-- STEP1: -->
9180
+ <!-- - Re-order elements in 'preface', 'sections' based on @displayorder -->
9181
+ <!-- - Ignore 'span' without style -->
9140
9182
  <!-- =========================================================================== -->
9141
9183
  <xsl:template match="@*|node()" mode="update_xml_step1">
9142
9184
  <xsl:copy>
@@ -9219,7 +9261,8 @@
9219
9261
  </xsl:copy>
9220
9262
  </xsl:template>
9221
9263
 
9222
- <xsl:template match="*[local-name() = 'span'][@style]" mode="update_xml_step1" priority="2">
9264
+ <!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
9265
+ <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">
9223
9266
  <xsl:copy>
9224
9267
  <xsl:copy-of select="@*"/>
9225
9268
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -103,7 +103,7 @@ module IsoDoc
103
103
  def annex1(elem)
104
104
  lbl = @xrefs.anchor(elem["id"], :label)
105
105
  t = elem.at(ns("./title")) and
106
- t.children = "<strong>#{t.children.to_xml}</strong>"
106
+ t.children = "<strong>#{to_xml(t.children)}</strong>"
107
107
  prefix_name(elem, "<br/>", lbl, "title")
108
108
  end
109
109
 
@@ -168,10 +168,10 @@ module IsoDoc
168
168
 
169
169
  def termsource1(elem)
170
170
  while elem&.next_element&.name == "termsource"
171
- elem << "; #{elem.next_element.remove.children.to_xml}"
171
+ elem << "; #{to_xml(elem.next_element.remove.children)}"
172
172
  end
173
173
  elem.children = l10n("[<strong>#{@i18n.source}:</strong> " \
174
- "#{elem.children.to_xml.strip}]")
174
+ "#{to_xml(elem.children).strip}]")
175
175
  end
176
176
 
177
177
  def bibliography_bibitem_number_skip(bibitem)
@@ -683,6 +683,9 @@
683
683
  </define>
684
684
  <define name="underline">
685
685
  <element name="underline">
686
+ <optional>
687
+ <attribute name="style"/>
688
+ </optional>
686
689
  <zeroOrMore>
687
690
  <ref name="PureTextElement"/>
688
691
  </zeroOrMore>
@@ -47,7 +47,7 @@
47
47
  </element>
48
48
  </define>
49
49
  <define name="DocumentType">
50
- <value>document</value>
50
+ <text/>
51
51
  </define>
52
52
  <define name="docsubtype">
53
53
  <element name="subdoctype">
@@ -2653,6 +2653,7 @@
2653
2653
  <value>full</value>
2654
2654
  <value>short</value>
2655
2655
  <value>id</value>
2656
+ <value>modspec</value>
2656
2657
  </choice>
2657
2658
  </define>
2658
2659
  <define name="erefTypeWithConnective">
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ogc
3
- VERSION = "2.2.7".freeze
3
+ VERSION = "2.3.0".freeze
4
4
  end
5
5
  end
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
26
26
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
27
27
 
28
28
  spec.add_dependency "iso-639"
29
- spec.add_dependency "metanorma-standoc", "~> 2.2.4"
29
+ spec.add_dependency "metanorma-standoc", "~> 2.3.0"
30
30
 
31
31
  spec.add_development_dependency "debug"
32
32
  spec.add_development_dependency "equivalent-xml", "~> 0.6"