metanorma-itu 2.1.13 → 2.2.1

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: c4affe5d05133fb88eabd946907e5c60c0c117dcf7f4a462db96c53ce88cd740
4
- data.tar.gz: f2dc781764d916f9a3d1983d22001e1f50264ccc544743ff5f7311501fe22ec9
3
+ metadata.gz: 92547850204e82af7ca66f1a4595e66247f9ec9e35d151d8580c66a125916202
4
+ data.tar.gz: '0995b9389ae4f2c865e273c609ebb27ea0c95e927359a774e3caf3b746789562'
5
5
  SHA512:
6
- metadata.gz: 499fd4a8889c4329fbdabb25cb40a6dc3817209b55618402945625ef1ed11b490256991ff963856cae8ef2056c2afd14dc8342bbc57ed3cc023cff51290f7b4f
7
- data.tar.gz: b8d8746048959d239089b805aa90d9bb207dcfee66ab1232d99c09418a913434ceb1336addb7264155cc7d3befeddc593b252b9409c259f24d70d64ab668ec9a
6
+ metadata.gz: d8900707417d6c2fb1cca49619fa6d75ab73ba719c76d39add7f3c2305839d84c868a6cf53b02f3db9d1b0dccbfb38622ec7ed31b370e915eda50722eb96608f
7
+ data.tar.gz: 11fb128acbd215d3347e5367d5f3b8b831017c585f621b458946340b7d61499f7f8bef1c705b29e4be1806f219793ba7ad1a1b572570eacb233a9df7838720b9
data/.gitignore CHANGED
@@ -5,5 +5,4 @@ coverage/
5
5
 
6
6
  .rubocop-https--*
7
7
 
8
- /Gemfile.devel
9
8
  /Gemfile.lock
@@ -4690,6 +4690,10 @@
4690
4690
  <xsl:variable name="footnote_inline">
4691
4691
  <fo:inline xsl:use-attribute-sets="fn-num-style">
4692
4692
 
4693
+ <xsl:if test="following-sibling::*[1][local-name() = 'fn']">
4694
+ <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
4695
+ </xsl:if>
4696
+
4693
4697
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
4694
4698
  <xsl:value-of select="$current_fn_number_text"/>
4695
4699
  </fo:basic-link>
@@ -5864,6 +5868,23 @@
5864
5868
  <xsl:apply-templates/>
5865
5869
  </xsl:template>
5866
5870
 
5871
+ <!-- Don't break standard's numbers -->
5872
+ <!-- Example : <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
5873
+ <xsl:template match="*[local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" priority="2">
5874
+ <xsl:choose>
5875
+ <xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
5876
+ <xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
5877
+ <fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
5878
+ </xsl:when>
5879
+ <xsl:otherwise>
5880
+ <xsl:apply-templates/>
5881
+ </xsl:otherwise>
5882
+ </xsl:choose>
5883
+ </xsl:template>
5884
+ <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">
5885
+ <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
5886
+ </xsl:template>
5887
+
5867
5888
  <!-- ========================= -->
5868
5889
  <!-- END Rich text formatting -->
5869
5890
  <!-- ========================= -->
@@ -6259,7 +6280,7 @@
6259
6280
  <xsl:choose>
6260
6281
  <xsl:when test="@colspan">
6261
6282
  <xsl:variable name="td">
6262
- <xsl:element name="td">
6283
+ <xsl:element name="{local-name()}">
6263
6284
  <xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
6264
6285
  <xsl:if test="local-name()='th'">
6265
6286
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -6274,7 +6295,7 @@
6274
6295
  </xsl:call-template>
6275
6296
  </xsl:when>
6276
6297
  <xsl:otherwise>
6277
- <xsl:element name="td">
6298
+ <xsl:element name="{local-name()}">
6278
6299
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
6279
6300
  <xsl:if test="local-name()='th'">
6280
6301
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -6341,7 +6362,7 @@
6341
6362
  <xsl:variable name="currentRow" select="."/>
6342
6363
 
6343
6364
  <xsl:variable name="normalizedTDs">
6344
- <xsl:for-each select="xalan:nodeset($previousRow)//td">
6365
+ <xsl:for-each select="xalan:nodeset($previousRow)//*[self::td or self::th]">
6345
6366
  <xsl:choose>
6346
6367
  <xsl:when test="@rowspan &gt; 1">
6347
6368
  <xsl:copy>
@@ -6353,7 +6374,7 @@
6353
6374
  </xsl:copy>
6354
6375
  </xsl:when>
6355
6376
  <xsl:otherwise>
6356
- <xsl:copy-of select="$currentRow/td[1 + count(current()/preceding-sibling::td[not(@rowspan) or (@rowspan = 1)])]"/>
6377
+ <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)])]"/>
6357
6378
  </xsl:otherwise>
6358
6379
  </xsl:choose>
6359
6380
  </xsl:for-each>
@@ -7023,12 +7044,6 @@
7023
7044
 
7024
7045
  <fo:block-container margin-left="0mm">
7025
7046
 
7026
- <!-- <xsl:if test="$namespace = 'iho'">
7027
- <xsl:if test="ancestor::iho:td">
7028
- <xsl:attribute name="font-size">12pt</xsl:attribute>
7029
- </xsl:if>
7030
- </xsl:if> -->
7031
-
7032
7047
  <fo:block>
7033
7048
 
7034
7049
  <xsl:if test="ancestor::itu:figure">
@@ -7538,6 +7553,31 @@
7538
7553
  <xsl:apply-templates mode="svg_update"/>
7539
7554
  </xsl:copy>
7540
7555
  </xsl:template>
7556
+
7557
+ <!-- regex for 'display: inline-block;' -->
7558
+ <xsl:variable name="regex_svg_style_notsupported">display(\s|\h)*:(\s|\h)*inline-block(\s|\h)*;</xsl:variable>
7559
+ <xsl:template match="*[local-name() = 'svg']//*[local-name() = 'style']/text()" mode="svg_update">
7560
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), $regex_svg_style_notsupported, '')"/>
7561
+ </xsl:template>
7562
+
7563
+ <!-- replace
7564
+ stroke="rgba(r, g, b, alpha)" to
7565
+ stroke="rgb(r,g,b)" stroke-opacity="alpha", and
7566
+ fill="rgba(r, g, b, alpha)" to
7567
+ fill="rgb(r,g,b)" fill-opacity="alpha" -->
7568
+ <xsl:template match="@*[local-name() = 'stroke' or local-name() = 'fill'][starts-with(normalize-space(.), 'rgba')]" mode="svg_update">
7569
+ <xsl:variable name="components_">
7570
+ <xsl:call-template name="split">
7571
+ <xsl:with-param name="pText" select="substring-before(substring-after(., '('), ')')"/>
7572
+ <xsl:with-param name="sep" select="','"/>
7573
+ </xsl:call-template>
7574
+ </xsl:variable>
7575
+ <xsl:variable name="components" select="xalan:nodeset($components_)"/>
7576
+ <xsl:variable name="att_name" select="local-name()"/>
7577
+ <xsl:attribute name="{$att_name}"><xsl:value-of select="concat('rgb(', $components/item[1], ',', $components/item[2], ',', $components/item[3], ')')"/></xsl:attribute>
7578
+ <xsl:attribute name="{$att_name}-opacity"><xsl:value-of select="$components/item[4]"/></xsl:attribute>
7579
+ </xsl:template>
7580
+
7541
7581
  <!-- ============== -->
7542
7582
  <!-- END: svg_update -->
7543
7583
  <!-- ============== -->
@@ -10516,7 +10556,9 @@
10516
10556
  <!-- Update xml -->
10517
10557
  <!-- ===================================== -->
10518
10558
  <!-- =========================================================================== -->
10519
- <!-- STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
10559
+ <!-- STEP1: -->
10560
+ <!-- - Re-order elements in 'preface', 'sections' based on @displayorder -->
10561
+ <!-- - Ignore 'span' without style -->
10520
10562
  <!-- =========================================================================== -->
10521
10563
  <xsl:template match="@*|node()" mode="update_xml_step1">
10522
10564
  <xsl:copy>
@@ -10599,7 +10641,8 @@
10599
10641
  </xsl:copy>
10600
10642
  </xsl:template>
10601
10643
 
10602
- <xsl:template match="*[local-name() = 'span'][@style]" mode="update_xml_step1" priority="2">
10644
+ <!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
10645
+ <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">
10603
10646
  <xsl:copy>
10604
10647
  <xsl:copy-of select="@*"/>
10605
10648
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -4690,6 +4690,10 @@
4690
4690
  <xsl:variable name="footnote_inline">
4691
4691
  <fo:inline xsl:use-attribute-sets="fn-num-style">
4692
4692
 
4693
+ <xsl:if test="following-sibling::*[1][local-name() = 'fn']">
4694
+ <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
4695
+ </xsl:if>
4696
+
4693
4697
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
4694
4698
  <xsl:value-of select="$current_fn_number_text"/>
4695
4699
  </fo:basic-link>
@@ -5864,6 +5868,23 @@
5864
5868
  <xsl:apply-templates/>
5865
5869
  </xsl:template>
5866
5870
 
5871
+ <!-- Don't break standard's numbers -->
5872
+ <!-- Example : <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
5873
+ <xsl:template match="*[local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" priority="2">
5874
+ <xsl:choose>
5875
+ <xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
5876
+ <xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
5877
+ <fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
5878
+ </xsl:when>
5879
+ <xsl:otherwise>
5880
+ <xsl:apply-templates/>
5881
+ </xsl:otherwise>
5882
+ </xsl:choose>
5883
+ </xsl:template>
5884
+ <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">
5885
+ <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
5886
+ </xsl:template>
5887
+
5867
5888
  <!-- ========================= -->
5868
5889
  <!-- END Rich text formatting -->
5869
5890
  <!-- ========================= -->
@@ -6259,7 +6280,7 @@
6259
6280
  <xsl:choose>
6260
6281
  <xsl:when test="@colspan">
6261
6282
  <xsl:variable name="td">
6262
- <xsl:element name="td">
6283
+ <xsl:element name="{local-name()}">
6263
6284
  <xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
6264
6285
  <xsl:if test="local-name()='th'">
6265
6286
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -6274,7 +6295,7 @@
6274
6295
  </xsl:call-template>
6275
6296
  </xsl:when>
6276
6297
  <xsl:otherwise>
6277
- <xsl:element name="td">
6298
+ <xsl:element name="{local-name()}">
6278
6299
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
6279
6300
  <xsl:if test="local-name()='th'">
6280
6301
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -6341,7 +6362,7 @@
6341
6362
  <xsl:variable name="currentRow" select="."/>
6342
6363
 
6343
6364
  <xsl:variable name="normalizedTDs">
6344
- <xsl:for-each select="xalan:nodeset($previousRow)//td">
6365
+ <xsl:for-each select="xalan:nodeset($previousRow)//*[self::td or self::th]">
6345
6366
  <xsl:choose>
6346
6367
  <xsl:when test="@rowspan &gt; 1">
6347
6368
  <xsl:copy>
@@ -6353,7 +6374,7 @@
6353
6374
  </xsl:copy>
6354
6375
  </xsl:when>
6355
6376
  <xsl:otherwise>
6356
- <xsl:copy-of select="$currentRow/td[1 + count(current()/preceding-sibling::td[not(@rowspan) or (@rowspan = 1)])]"/>
6377
+ <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)])]"/>
6357
6378
  </xsl:otherwise>
6358
6379
  </xsl:choose>
6359
6380
  </xsl:for-each>
@@ -7023,12 +7044,6 @@
7023
7044
 
7024
7045
  <fo:block-container margin-left="0mm">
7025
7046
 
7026
- <!-- <xsl:if test="$namespace = 'iho'">
7027
- <xsl:if test="ancestor::iho:td">
7028
- <xsl:attribute name="font-size">12pt</xsl:attribute>
7029
- </xsl:if>
7030
- </xsl:if> -->
7031
-
7032
7047
  <fo:block>
7033
7048
 
7034
7049
  <xsl:if test="ancestor::itu:figure">
@@ -7538,6 +7553,31 @@
7538
7553
  <xsl:apply-templates mode="svg_update"/>
7539
7554
  </xsl:copy>
7540
7555
  </xsl:template>
7556
+
7557
+ <!-- regex for 'display: inline-block;' -->
7558
+ <xsl:variable name="regex_svg_style_notsupported">display(\s|\h)*:(\s|\h)*inline-block(\s|\h)*;</xsl:variable>
7559
+ <xsl:template match="*[local-name() = 'svg']//*[local-name() = 'style']/text()" mode="svg_update">
7560
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), $regex_svg_style_notsupported, '')"/>
7561
+ </xsl:template>
7562
+
7563
+ <!-- replace
7564
+ stroke="rgba(r, g, b, alpha)" to
7565
+ stroke="rgb(r,g,b)" stroke-opacity="alpha", and
7566
+ fill="rgba(r, g, b, alpha)" to
7567
+ fill="rgb(r,g,b)" fill-opacity="alpha" -->
7568
+ <xsl:template match="@*[local-name() = 'stroke' or local-name() = 'fill'][starts-with(normalize-space(.), 'rgba')]" mode="svg_update">
7569
+ <xsl:variable name="components_">
7570
+ <xsl:call-template name="split">
7571
+ <xsl:with-param name="pText" select="substring-before(substring-after(., '('), ')')"/>
7572
+ <xsl:with-param name="sep" select="','"/>
7573
+ </xsl:call-template>
7574
+ </xsl:variable>
7575
+ <xsl:variable name="components" select="xalan:nodeset($components_)"/>
7576
+ <xsl:variable name="att_name" select="local-name()"/>
7577
+ <xsl:attribute name="{$att_name}"><xsl:value-of select="concat('rgb(', $components/item[1], ',', $components/item[2], ',', $components/item[3], ')')"/></xsl:attribute>
7578
+ <xsl:attribute name="{$att_name}-opacity"><xsl:value-of select="$components/item[4]"/></xsl:attribute>
7579
+ </xsl:template>
7580
+
7541
7581
  <!-- ============== -->
7542
7582
  <!-- END: svg_update -->
7543
7583
  <!-- ============== -->
@@ -10516,7 +10556,9 @@
10516
10556
  <!-- Update xml -->
10517
10557
  <!-- ===================================== -->
10518
10558
  <!-- =========================================================================== -->
10519
- <!-- STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
10559
+ <!-- STEP1: -->
10560
+ <!-- - Re-order elements in 'preface', 'sections' based on @displayorder -->
10561
+ <!-- - Ignore 'span' without style -->
10520
10562
  <!-- =========================================================================== -->
10521
10563
  <xsl:template match="@*|node()" mode="update_xml_step1">
10522
10564
  <xsl:copy>
@@ -10599,7 +10641,8 @@
10599
10641
  </xsl:copy>
10600
10642
  </xsl:template>
10601
10643
 
10602
- <xsl:template match="*[local-name() = 'span'][@style]" mode="update_xml_step1" priority="2">
10644
+ <!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
10645
+ <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">
10603
10646
  <xsl:copy>
10604
10647
  <xsl:copy-of select="@*"/>
10605
10648
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -4690,6 +4690,10 @@
4690
4690
  <xsl:variable name="footnote_inline">
4691
4691
  <fo:inline xsl:use-attribute-sets="fn-num-style">
4692
4692
 
4693
+ <xsl:if test="following-sibling::*[1][local-name() = 'fn']">
4694
+ <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
4695
+ </xsl:if>
4696
+
4693
4697
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
4694
4698
  <xsl:value-of select="$current_fn_number_text"/>
4695
4699
  </fo:basic-link>
@@ -5864,6 +5868,23 @@
5864
5868
  <xsl:apply-templates/>
5865
5869
  </xsl:template>
5866
5870
 
5871
+ <!-- Don't break standard's numbers -->
5872
+ <!-- Example : <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
5873
+ <xsl:template match="*[local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" priority="2">
5874
+ <xsl:choose>
5875
+ <xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
5876
+ <xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
5877
+ <fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
5878
+ </xsl:when>
5879
+ <xsl:otherwise>
5880
+ <xsl:apply-templates/>
5881
+ </xsl:otherwise>
5882
+ </xsl:choose>
5883
+ </xsl:template>
5884
+ <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">
5885
+ <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
5886
+ </xsl:template>
5887
+
5867
5888
  <!-- ========================= -->
5868
5889
  <!-- END Rich text formatting -->
5869
5890
  <!-- ========================= -->
@@ -6259,7 +6280,7 @@
6259
6280
  <xsl:choose>
6260
6281
  <xsl:when test="@colspan">
6261
6282
  <xsl:variable name="td">
6262
- <xsl:element name="td">
6283
+ <xsl:element name="{local-name()}">
6263
6284
  <xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
6264
6285
  <xsl:if test="local-name()='th'">
6265
6286
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -6274,7 +6295,7 @@
6274
6295
  </xsl:call-template>
6275
6296
  </xsl:when>
6276
6297
  <xsl:otherwise>
6277
- <xsl:element name="td">
6298
+ <xsl:element name="{local-name()}">
6278
6299
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
6279
6300
  <xsl:if test="local-name()='th'">
6280
6301
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -6341,7 +6362,7 @@
6341
6362
  <xsl:variable name="currentRow" select="."/>
6342
6363
 
6343
6364
  <xsl:variable name="normalizedTDs">
6344
- <xsl:for-each select="xalan:nodeset($previousRow)//td">
6365
+ <xsl:for-each select="xalan:nodeset($previousRow)//*[self::td or self::th]">
6345
6366
  <xsl:choose>
6346
6367
  <xsl:when test="@rowspan &gt; 1">
6347
6368
  <xsl:copy>
@@ -6353,7 +6374,7 @@
6353
6374
  </xsl:copy>
6354
6375
  </xsl:when>
6355
6376
  <xsl:otherwise>
6356
- <xsl:copy-of select="$currentRow/td[1 + count(current()/preceding-sibling::td[not(@rowspan) or (@rowspan = 1)])]"/>
6377
+ <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)])]"/>
6357
6378
  </xsl:otherwise>
6358
6379
  </xsl:choose>
6359
6380
  </xsl:for-each>
@@ -7023,12 +7044,6 @@
7023
7044
 
7024
7045
  <fo:block-container margin-left="0mm">
7025
7046
 
7026
- <!-- <xsl:if test="$namespace = 'iho'">
7027
- <xsl:if test="ancestor::iho:td">
7028
- <xsl:attribute name="font-size">12pt</xsl:attribute>
7029
- </xsl:if>
7030
- </xsl:if> -->
7031
-
7032
7047
  <fo:block>
7033
7048
 
7034
7049
  <xsl:if test="ancestor::itu:figure">
@@ -7538,6 +7553,31 @@
7538
7553
  <xsl:apply-templates mode="svg_update"/>
7539
7554
  </xsl:copy>
7540
7555
  </xsl:template>
7556
+
7557
+ <!-- regex for 'display: inline-block;' -->
7558
+ <xsl:variable name="regex_svg_style_notsupported">display(\s|\h)*:(\s|\h)*inline-block(\s|\h)*;</xsl:variable>
7559
+ <xsl:template match="*[local-name() = 'svg']//*[local-name() = 'style']/text()" mode="svg_update">
7560
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), $regex_svg_style_notsupported, '')"/>
7561
+ </xsl:template>
7562
+
7563
+ <!-- replace
7564
+ stroke="rgba(r, g, b, alpha)" to
7565
+ stroke="rgb(r,g,b)" stroke-opacity="alpha", and
7566
+ fill="rgba(r, g, b, alpha)" to
7567
+ fill="rgb(r,g,b)" fill-opacity="alpha" -->
7568
+ <xsl:template match="@*[local-name() = 'stroke' or local-name() = 'fill'][starts-with(normalize-space(.), 'rgba')]" mode="svg_update">
7569
+ <xsl:variable name="components_">
7570
+ <xsl:call-template name="split">
7571
+ <xsl:with-param name="pText" select="substring-before(substring-after(., '('), ')')"/>
7572
+ <xsl:with-param name="sep" select="','"/>
7573
+ </xsl:call-template>
7574
+ </xsl:variable>
7575
+ <xsl:variable name="components" select="xalan:nodeset($components_)"/>
7576
+ <xsl:variable name="att_name" select="local-name()"/>
7577
+ <xsl:attribute name="{$att_name}"><xsl:value-of select="concat('rgb(', $components/item[1], ',', $components/item[2], ',', $components/item[3], ')')"/></xsl:attribute>
7578
+ <xsl:attribute name="{$att_name}-opacity"><xsl:value-of select="$components/item[4]"/></xsl:attribute>
7579
+ </xsl:template>
7580
+
7541
7581
  <!-- ============== -->
7542
7582
  <!-- END: svg_update -->
7543
7583
  <!-- ============== -->
@@ -10516,7 +10556,9 @@
10516
10556
  <!-- Update xml -->
10517
10557
  <!-- ===================================== -->
10518
10558
  <!-- =========================================================================== -->
10519
- <!-- STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
10559
+ <!-- STEP1: -->
10560
+ <!-- - Re-order elements in 'preface', 'sections' based on @displayorder -->
10561
+ <!-- - Ignore 'span' without style -->
10520
10562
  <!-- =========================================================================== -->
10521
10563
  <xsl:template match="@*|node()" mode="update_xml_step1">
10522
10564
  <xsl:copy>
@@ -10599,7 +10641,8 @@
10599
10641
  </xsl:copy>
10600
10642
  </xsl:template>
10601
10643
 
10602
- <xsl:template match="*[local-name() = 'span'][@style]" mode="update_xml_step1" priority="2">
10644
+ <!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
10645
+ <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">
10603
10646
  <xsl:copy>
10604
10647
  <xsl:copy-of select="@*"/>
10605
10648
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -4690,6 +4690,10 @@
4690
4690
  <xsl:variable name="footnote_inline">
4691
4691
  <fo:inline xsl:use-attribute-sets="fn-num-style">
4692
4692
 
4693
+ <xsl:if test="following-sibling::*[1][local-name() = 'fn']">
4694
+ <xsl:attribute name="padding-right">0.5mm</xsl:attribute>
4695
+ </xsl:if>
4696
+
4693
4697
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
4694
4698
  <xsl:value-of select="$current_fn_number_text"/>
4695
4699
  </fo:basic-link>
@@ -5864,6 +5868,23 @@
5864
5868
  <xsl:apply-templates/>
5865
5869
  </xsl:template>
5866
5870
 
5871
+ <!-- Don't break standard's numbers -->
5872
+ <!-- Example : <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
5873
+ <xsl:template match="*[local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']" priority="2">
5874
+ <xsl:choose>
5875
+ <xsl:when test="ancestor::*[local-name() = 'table']"><xsl:apply-templates/></xsl:when>
5876
+ <xsl:when test="following-sibling::*[2][local-name() = 'span'][@class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear']">
5877
+ <fo:inline keep-with-next.within-line="always"><xsl:apply-templates/></fo:inline>
5878
+ </xsl:when>
5879
+ <xsl:otherwise>
5880
+ <xsl:apply-templates/>
5881
+ </xsl:otherwise>
5882
+ </xsl:choose>
5883
+ </xsl:template>
5884
+ <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">
5885
+ <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
5886
+ </xsl:template>
5887
+
5867
5888
  <!-- ========================= -->
5868
5889
  <!-- END Rich text formatting -->
5869
5890
  <!-- ========================= -->
@@ -6259,7 +6280,7 @@
6259
6280
  <xsl:choose>
6260
6281
  <xsl:when test="@colspan">
6261
6282
  <xsl:variable name="td">
6262
- <xsl:element name="td">
6283
+ <xsl:element name="{local-name()}">
6263
6284
  <xsl:attribute name="divide"><xsl:value-of select="@colspan"/></xsl:attribute>
6264
6285
  <xsl:if test="local-name()='th'">
6265
6286
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -6274,7 +6295,7 @@
6274
6295
  </xsl:call-template>
6275
6296
  </xsl:when>
6276
6297
  <xsl:otherwise>
6277
- <xsl:element name="td">
6298
+ <xsl:element name="{local-name()}">
6278
6299
  <xsl:apply-templates select="@*" mode="simple-table-colspan"/>
6279
6300
  <xsl:if test="local-name()='th'">
6280
6301
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -6341,7 +6362,7 @@
6341
6362
  <xsl:variable name="currentRow" select="."/>
6342
6363
 
6343
6364
  <xsl:variable name="normalizedTDs">
6344
- <xsl:for-each select="xalan:nodeset($previousRow)//td">
6365
+ <xsl:for-each select="xalan:nodeset($previousRow)//*[self::td or self::th]">
6345
6366
  <xsl:choose>
6346
6367
  <xsl:when test="@rowspan &gt; 1">
6347
6368
  <xsl:copy>
@@ -6353,7 +6374,7 @@
6353
6374
  </xsl:copy>
6354
6375
  </xsl:when>
6355
6376
  <xsl:otherwise>
6356
- <xsl:copy-of select="$currentRow/td[1 + count(current()/preceding-sibling::td[not(@rowspan) or (@rowspan = 1)])]"/>
6377
+ <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)])]"/>
6357
6378
  </xsl:otherwise>
6358
6379
  </xsl:choose>
6359
6380
  </xsl:for-each>
@@ -7023,12 +7044,6 @@
7023
7044
 
7024
7045
  <fo:block-container margin-left="0mm">
7025
7046
 
7026
- <!-- <xsl:if test="$namespace = 'iho'">
7027
- <xsl:if test="ancestor::iho:td">
7028
- <xsl:attribute name="font-size">12pt</xsl:attribute>
7029
- </xsl:if>
7030
- </xsl:if> -->
7031
-
7032
7047
  <fo:block>
7033
7048
 
7034
7049
  <xsl:if test="ancestor::itu:figure">
@@ -7538,6 +7553,31 @@
7538
7553
  <xsl:apply-templates mode="svg_update"/>
7539
7554
  </xsl:copy>
7540
7555
  </xsl:template>
7556
+
7557
+ <!-- regex for 'display: inline-block;' -->
7558
+ <xsl:variable name="regex_svg_style_notsupported">display(\s|\h)*:(\s|\h)*inline-block(\s|\h)*;</xsl:variable>
7559
+ <xsl:template match="*[local-name() = 'svg']//*[local-name() = 'style']/text()" mode="svg_update">
7560
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.), $regex_svg_style_notsupported, '')"/>
7561
+ </xsl:template>
7562
+
7563
+ <!-- replace
7564
+ stroke="rgba(r, g, b, alpha)" to
7565
+ stroke="rgb(r,g,b)" stroke-opacity="alpha", and
7566
+ fill="rgba(r, g, b, alpha)" to
7567
+ fill="rgb(r,g,b)" fill-opacity="alpha" -->
7568
+ <xsl:template match="@*[local-name() = 'stroke' or local-name() = 'fill'][starts-with(normalize-space(.), 'rgba')]" mode="svg_update">
7569
+ <xsl:variable name="components_">
7570
+ <xsl:call-template name="split">
7571
+ <xsl:with-param name="pText" select="substring-before(substring-after(., '('), ')')"/>
7572
+ <xsl:with-param name="sep" select="','"/>
7573
+ </xsl:call-template>
7574
+ </xsl:variable>
7575
+ <xsl:variable name="components" select="xalan:nodeset($components_)"/>
7576
+ <xsl:variable name="att_name" select="local-name()"/>
7577
+ <xsl:attribute name="{$att_name}"><xsl:value-of select="concat('rgb(', $components/item[1], ',', $components/item[2], ',', $components/item[3], ')')"/></xsl:attribute>
7578
+ <xsl:attribute name="{$att_name}-opacity"><xsl:value-of select="$components/item[4]"/></xsl:attribute>
7579
+ </xsl:template>
7580
+
7541
7581
  <!-- ============== -->
7542
7582
  <!-- END: svg_update -->
7543
7583
  <!-- ============== -->
@@ -10516,7 +10556,9 @@
10516
10556
  <!-- Update xml -->
10517
10557
  <!-- ===================================== -->
10518
10558
  <!-- =========================================================================== -->
10519
- <!-- STEP1: Re-order elements in 'preface', 'sections' based on @displayorder -->
10559
+ <!-- STEP1: -->
10560
+ <!-- - Re-order elements in 'preface', 'sections' based on @displayorder -->
10561
+ <!-- - Ignore 'span' without style -->
10520
10562
  <!-- =========================================================================== -->
10521
10563
  <xsl:template match="@*|node()" mode="update_xml_step1">
10522
10564
  <xsl:copy>
@@ -10599,7 +10641,8 @@
10599
10641
  </xsl:copy>
10600
10642
  </xsl:template>
10601
10643
 
10602
- <xsl:template match="*[local-name() = 'span'][@style]" mode="update_xml_step1" priority="2">
10644
+ <!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
10645
+ <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">
10603
10646
  <xsl:copy>
10604
10647
  <xsl:copy-of select="@*"/>
10605
10648
  <xsl:apply-templates mode="update_xml_step1"/>