metanorma-ogc 2.4.0 → 2.4.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -1822,11 +1822,26 @@
1822
1822
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
1823
1823
  </xsl:if>
1824
1824
 
1825
- <xsl:value-of select="."/>
1825
+ <xsl:variable name="font_family" select="."/>
1826
1826
 
1827
- <xsl:if test="$additional_fonts != ''">
1828
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1829
- </xsl:if>
1827
+ <xsl:choose>
1828
+ <xsl:when test="$additional_fonts = ''">
1829
+ <xsl:value-of select="$font_family"/>
1830
+ </xsl:when>
1831
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
1832
+ <xsl:choose>
1833
+ <xsl:when test="contains($font_family, ',')">
1834
+ <xsl:value-of select="substring-before($font_family, ',')"/>
1835
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1836
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
1837
+ </xsl:when>
1838
+ <xsl:otherwise>
1839
+ <xsl:value-of select="$font_family"/>
1840
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1841
+ </xsl:otherwise>
1842
+ </xsl:choose>
1843
+ </xsl:otherwise>
1844
+ </xsl:choose>
1830
1845
  </xsl:attribute>
1831
1846
  </xsl:when>
1832
1847
  <xsl:otherwise>
@@ -4480,21 +4495,21 @@
4480
4495
 
4481
4496
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
4482
4497
 
4483
- <fo:block xsl:use-attribute-sets="table-note-style">
4498
+ <fo:block xsl:use-attribute-sets="table-note-style">
4484
4499
 
4485
- <xsl:call-template name="refine_table-note-style"/>
4500
+ <xsl:call-template name="refine_table-note-style"/>
4486
4501
 
4487
- <!-- Table's note/example name (NOTE, for example) -->
4488
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
4502
+ <!-- Table's note/example name (NOTE, for example) -->
4503
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
4489
4504
 
4490
- <xsl:call-template name="refine_table-note-name-style"/>
4505
+ <xsl:call-template name="refine_table-note-name-style"/>
4491
4506
 
4492
- <xsl:apply-templates select="*[local-name() = 'name']"/>
4507
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
4493
4508
 
4494
- </fo:inline>
4509
+ </fo:inline>
4495
4510
 
4496
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4497
- </fo:block>
4511
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4512
+ </fo:block>
4498
4513
 
4499
4514
  </xsl:template> <!-- table/note -->
4500
4515
 
@@ -7637,8 +7652,12 @@
7637
7652
  <xsl:variable name="isAdded" select="../@added"/>
7638
7653
  <xsl:variable name="isDeleted" select="../@deleted"/>
7639
7654
  <xsl:choose>
7640
- <xsl:when test="ancestor::*[local-name() = 'title']">
7655
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
7641
7656
  <fo:inline padding-left="1mm" padding-right="1mm">
7657
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
7658
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
7659
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
7660
+ </xsl:if>
7642
7661
  <xsl:variable name="src">
7643
7662
  <xsl:call-template name="image_src"/>
7644
7663
  </xsl:variable>
@@ -7671,7 +7690,7 @@
7671
7690
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
7672
7691
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
7673
7692
 
7674
- <xsl:if test="@width != '' and @width != 'auto'">
7693
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
7675
7694
  <xsl:attribute name="width">
7676
7695
  <xsl:value-of select="@width"/>
7677
7696
  </xsl:attribute>
@@ -1822,11 +1822,26 @@
1822
1822
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
1823
1823
  </xsl:if>
1824
1824
 
1825
- <xsl:value-of select="."/>
1825
+ <xsl:variable name="font_family" select="."/>
1826
1826
 
1827
- <xsl:if test="$additional_fonts != ''">
1828
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1829
- </xsl:if>
1827
+ <xsl:choose>
1828
+ <xsl:when test="$additional_fonts = ''">
1829
+ <xsl:value-of select="$font_family"/>
1830
+ </xsl:when>
1831
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
1832
+ <xsl:choose>
1833
+ <xsl:when test="contains($font_family, ',')">
1834
+ <xsl:value-of select="substring-before($font_family, ',')"/>
1835
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1836
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
1837
+ </xsl:when>
1838
+ <xsl:otherwise>
1839
+ <xsl:value-of select="$font_family"/>
1840
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1841
+ </xsl:otherwise>
1842
+ </xsl:choose>
1843
+ </xsl:otherwise>
1844
+ </xsl:choose>
1830
1845
  </xsl:attribute>
1831
1846
  </xsl:when>
1832
1847
  <xsl:otherwise>
@@ -4480,21 +4495,21 @@
4480
4495
 
4481
4496
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
4482
4497
 
4483
- <fo:block xsl:use-attribute-sets="table-note-style">
4498
+ <fo:block xsl:use-attribute-sets="table-note-style">
4484
4499
 
4485
- <xsl:call-template name="refine_table-note-style"/>
4500
+ <xsl:call-template name="refine_table-note-style"/>
4486
4501
 
4487
- <!-- Table's note/example name (NOTE, for example) -->
4488
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
4502
+ <!-- Table's note/example name (NOTE, for example) -->
4503
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
4489
4504
 
4490
- <xsl:call-template name="refine_table-note-name-style"/>
4505
+ <xsl:call-template name="refine_table-note-name-style"/>
4491
4506
 
4492
- <xsl:apply-templates select="*[local-name() = 'name']"/>
4507
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
4493
4508
 
4494
- </fo:inline>
4509
+ </fo:inline>
4495
4510
 
4496
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4497
- </fo:block>
4511
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4512
+ </fo:block>
4498
4513
 
4499
4514
  </xsl:template> <!-- table/note -->
4500
4515
 
@@ -7637,8 +7652,12 @@
7637
7652
  <xsl:variable name="isAdded" select="../@added"/>
7638
7653
  <xsl:variable name="isDeleted" select="../@deleted"/>
7639
7654
  <xsl:choose>
7640
- <xsl:when test="ancestor::*[local-name() = 'title']">
7655
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
7641
7656
  <fo:inline padding-left="1mm" padding-right="1mm">
7657
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
7658
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
7659
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
7660
+ </xsl:if>
7642
7661
  <xsl:variable name="src">
7643
7662
  <xsl:call-template name="image_src"/>
7644
7663
  </xsl:variable>
@@ -7671,7 +7690,7 @@
7671
7690
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
7672
7691
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
7673
7692
 
7674
- <xsl:if test="@width != '' and @width != 'auto'">
7693
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
7675
7694
  <xsl:attribute name="width">
7676
7695
  <xsl:value-of select="@width"/>
7677
7696
  </xsl:attribute>
@@ -1822,11 +1822,26 @@
1822
1822
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
1823
1823
  </xsl:if>
1824
1824
 
1825
- <xsl:value-of select="."/>
1825
+ <xsl:variable name="font_family" select="."/>
1826
1826
 
1827
- <xsl:if test="$additional_fonts != ''">
1828
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1829
- </xsl:if>
1827
+ <xsl:choose>
1828
+ <xsl:when test="$additional_fonts = ''">
1829
+ <xsl:value-of select="$font_family"/>
1830
+ </xsl:when>
1831
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
1832
+ <xsl:choose>
1833
+ <xsl:when test="contains($font_family, ',')">
1834
+ <xsl:value-of select="substring-before($font_family, ',')"/>
1835
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1836
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
1837
+ </xsl:when>
1838
+ <xsl:otherwise>
1839
+ <xsl:value-of select="$font_family"/>
1840
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1841
+ </xsl:otherwise>
1842
+ </xsl:choose>
1843
+ </xsl:otherwise>
1844
+ </xsl:choose>
1830
1845
  </xsl:attribute>
1831
1846
  </xsl:when>
1832
1847
  <xsl:otherwise>
@@ -4480,21 +4495,21 @@
4480
4495
 
4481
4496
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
4482
4497
 
4483
- <fo:block xsl:use-attribute-sets="table-note-style">
4498
+ <fo:block xsl:use-attribute-sets="table-note-style">
4484
4499
 
4485
- <xsl:call-template name="refine_table-note-style"/>
4500
+ <xsl:call-template name="refine_table-note-style"/>
4486
4501
 
4487
- <!-- Table's note/example name (NOTE, for example) -->
4488
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
4502
+ <!-- Table's note/example name (NOTE, for example) -->
4503
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
4489
4504
 
4490
- <xsl:call-template name="refine_table-note-name-style"/>
4505
+ <xsl:call-template name="refine_table-note-name-style"/>
4491
4506
 
4492
- <xsl:apply-templates select="*[local-name() = 'name']"/>
4507
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
4493
4508
 
4494
- </fo:inline>
4509
+ </fo:inline>
4495
4510
 
4496
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4497
- </fo:block>
4511
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4512
+ </fo:block>
4498
4513
 
4499
4514
  </xsl:template> <!-- table/note -->
4500
4515
 
@@ -7637,8 +7652,12 @@
7637
7652
  <xsl:variable name="isAdded" select="../@added"/>
7638
7653
  <xsl:variable name="isDeleted" select="../@deleted"/>
7639
7654
  <xsl:choose>
7640
- <xsl:when test="ancestor::*[local-name() = 'title']">
7655
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
7641
7656
  <fo:inline padding-left="1mm" padding-right="1mm">
7657
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
7658
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
7659
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
7660
+ </xsl:if>
7642
7661
  <xsl:variable name="src">
7643
7662
  <xsl:call-template name="image_src"/>
7644
7663
  </xsl:variable>
@@ -7671,7 +7690,7 @@
7671
7690
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
7672
7691
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
7673
7692
 
7674
- <xsl:if test="@width != '' and @width != 'auto'">
7693
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
7675
7694
  <xsl:attribute name="width">
7676
7695
  <xsl:value-of select="@width"/>
7677
7696
  </xsl:attribute>
@@ -1822,11 +1822,26 @@
1822
1822
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
1823
1823
  </xsl:if>
1824
1824
 
1825
- <xsl:value-of select="."/>
1825
+ <xsl:variable name="font_family" select="."/>
1826
1826
 
1827
- <xsl:if test="$additional_fonts != ''">
1828
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1829
- </xsl:if>
1827
+ <xsl:choose>
1828
+ <xsl:when test="$additional_fonts = ''">
1829
+ <xsl:value-of select="$font_family"/>
1830
+ </xsl:when>
1831
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
1832
+ <xsl:choose>
1833
+ <xsl:when test="contains($font_family, ',')">
1834
+ <xsl:value-of select="substring-before($font_family, ',')"/>
1835
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1836
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
1837
+ </xsl:when>
1838
+ <xsl:otherwise>
1839
+ <xsl:value-of select="$font_family"/>
1840
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1841
+ </xsl:otherwise>
1842
+ </xsl:choose>
1843
+ </xsl:otherwise>
1844
+ </xsl:choose>
1830
1845
  </xsl:attribute>
1831
1846
  </xsl:when>
1832
1847
  <xsl:otherwise>
@@ -4480,21 +4495,21 @@
4480
4495
 
4481
4496
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
4482
4497
 
4483
- <fo:block xsl:use-attribute-sets="table-note-style">
4498
+ <fo:block xsl:use-attribute-sets="table-note-style">
4484
4499
 
4485
- <xsl:call-template name="refine_table-note-style"/>
4500
+ <xsl:call-template name="refine_table-note-style"/>
4486
4501
 
4487
- <!-- Table's note/example name (NOTE, for example) -->
4488
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
4502
+ <!-- Table's note/example name (NOTE, for example) -->
4503
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
4489
4504
 
4490
- <xsl:call-template name="refine_table-note-name-style"/>
4505
+ <xsl:call-template name="refine_table-note-name-style"/>
4491
4506
 
4492
- <xsl:apply-templates select="*[local-name() = 'name']"/>
4507
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
4493
4508
 
4494
- </fo:inline>
4509
+ </fo:inline>
4495
4510
 
4496
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4497
- </fo:block>
4511
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4512
+ </fo:block>
4498
4513
 
4499
4514
  </xsl:template> <!-- table/note -->
4500
4515
 
@@ -7637,8 +7652,12 @@
7637
7652
  <xsl:variable name="isAdded" select="../@added"/>
7638
7653
  <xsl:variable name="isDeleted" select="../@deleted"/>
7639
7654
  <xsl:choose>
7640
- <xsl:when test="ancestor::*[local-name() = 'title']">
7655
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
7641
7656
  <fo:inline padding-left="1mm" padding-right="1mm">
7657
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
7658
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
7659
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
7660
+ </xsl:if>
7642
7661
  <xsl:variable name="src">
7643
7662
  <xsl:call-template name="image_src"/>
7644
7663
  </xsl:variable>
@@ -7671,7 +7690,7 @@
7671
7690
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
7672
7691
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
7673
7692
 
7674
- <xsl:if test="@width != '' and @width != 'auto'">
7693
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
7675
7694
  <xsl:attribute name="width">
7676
7695
  <xsl:value-of select="@width"/>
7677
7696
  </xsl:attribute>
@@ -1822,11 +1822,26 @@
1822
1822
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
1823
1823
  </xsl:if>
1824
1824
 
1825
- <xsl:value-of select="."/>
1825
+ <xsl:variable name="font_family" select="."/>
1826
1826
 
1827
- <xsl:if test="$additional_fonts != ''">
1828
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1829
- </xsl:if>
1827
+ <xsl:choose>
1828
+ <xsl:when test="$additional_fonts = ''">
1829
+ <xsl:value-of select="$font_family"/>
1830
+ </xsl:when>
1831
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
1832
+ <xsl:choose>
1833
+ <xsl:when test="contains($font_family, ',')">
1834
+ <xsl:value-of select="substring-before($font_family, ',')"/>
1835
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1836
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
1837
+ </xsl:when>
1838
+ <xsl:otherwise>
1839
+ <xsl:value-of select="$font_family"/>
1840
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1841
+ </xsl:otherwise>
1842
+ </xsl:choose>
1843
+ </xsl:otherwise>
1844
+ </xsl:choose>
1830
1845
  </xsl:attribute>
1831
1846
  </xsl:when>
1832
1847
  <xsl:otherwise>
@@ -4480,21 +4495,21 @@
4480
4495
 
4481
4496
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
4482
4497
 
4483
- <fo:block xsl:use-attribute-sets="table-note-style">
4498
+ <fo:block xsl:use-attribute-sets="table-note-style">
4484
4499
 
4485
- <xsl:call-template name="refine_table-note-style"/>
4500
+ <xsl:call-template name="refine_table-note-style"/>
4486
4501
 
4487
- <!-- Table's note/example name (NOTE, for example) -->
4488
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
4502
+ <!-- Table's note/example name (NOTE, for example) -->
4503
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
4489
4504
 
4490
- <xsl:call-template name="refine_table-note-name-style"/>
4505
+ <xsl:call-template name="refine_table-note-name-style"/>
4491
4506
 
4492
- <xsl:apply-templates select="*[local-name() = 'name']"/>
4507
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
4493
4508
 
4494
- </fo:inline>
4509
+ </fo:inline>
4495
4510
 
4496
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4497
- </fo:block>
4511
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4512
+ </fo:block>
4498
4513
 
4499
4514
  </xsl:template> <!-- table/note -->
4500
4515
 
@@ -7637,8 +7652,12 @@
7637
7652
  <xsl:variable name="isAdded" select="../@added"/>
7638
7653
  <xsl:variable name="isDeleted" select="../@deleted"/>
7639
7654
  <xsl:choose>
7640
- <xsl:when test="ancestor::*[local-name() = 'title']">
7655
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
7641
7656
  <fo:inline padding-left="1mm" padding-right="1mm">
7657
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
7658
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
7659
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
7660
+ </xsl:if>
7642
7661
  <xsl:variable name="src">
7643
7662
  <xsl:call-template name="image_src"/>
7644
7663
  </xsl:variable>
@@ -7671,7 +7690,7 @@
7671
7690
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
7672
7691
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
7673
7692
 
7674
- <xsl:if test="@width != '' and @width != 'auto'">
7693
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
7675
7694
  <xsl:attribute name="width">
7676
7695
  <xsl:value-of select="@width"/>
7677
7696
  </xsl:attribute>
@@ -1822,11 +1822,26 @@
1822
1822
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
1823
1823
  </xsl:if>
1824
1824
 
1825
- <xsl:value-of select="."/>
1825
+ <xsl:variable name="font_family" select="."/>
1826
1826
 
1827
- <xsl:if test="$additional_fonts != ''">
1828
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1829
- </xsl:if>
1827
+ <xsl:choose>
1828
+ <xsl:when test="$additional_fonts = ''">
1829
+ <xsl:value-of select="$font_family"/>
1830
+ </xsl:when>
1831
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
1832
+ <xsl:choose>
1833
+ <xsl:when test="contains($font_family, ',')">
1834
+ <xsl:value-of select="substring-before($font_family, ',')"/>
1835
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1836
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
1837
+ </xsl:when>
1838
+ <xsl:otherwise>
1839
+ <xsl:value-of select="$font_family"/>
1840
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1841
+ </xsl:otherwise>
1842
+ </xsl:choose>
1843
+ </xsl:otherwise>
1844
+ </xsl:choose>
1830
1845
  </xsl:attribute>
1831
1846
  </xsl:when>
1832
1847
  <xsl:otherwise>
@@ -4480,21 +4495,21 @@
4480
4495
 
4481
4496
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
4482
4497
 
4483
- <fo:block xsl:use-attribute-sets="table-note-style">
4498
+ <fo:block xsl:use-attribute-sets="table-note-style">
4484
4499
 
4485
- <xsl:call-template name="refine_table-note-style"/>
4500
+ <xsl:call-template name="refine_table-note-style"/>
4486
4501
 
4487
- <!-- Table's note/example name (NOTE, for example) -->
4488
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
4502
+ <!-- Table's note/example name (NOTE, for example) -->
4503
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
4489
4504
 
4490
- <xsl:call-template name="refine_table-note-name-style"/>
4505
+ <xsl:call-template name="refine_table-note-name-style"/>
4491
4506
 
4492
- <xsl:apply-templates select="*[local-name() = 'name']"/>
4507
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
4493
4508
 
4494
- </fo:inline>
4509
+ </fo:inline>
4495
4510
 
4496
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4497
- </fo:block>
4511
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4512
+ </fo:block>
4498
4513
 
4499
4514
  </xsl:template> <!-- table/note -->
4500
4515
 
@@ -7637,8 +7652,12 @@
7637
7652
  <xsl:variable name="isAdded" select="../@added"/>
7638
7653
  <xsl:variable name="isDeleted" select="../@deleted"/>
7639
7654
  <xsl:choose>
7640
- <xsl:when test="ancestor::*[local-name() = 'title']">
7655
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
7641
7656
  <fo:inline padding-left="1mm" padding-right="1mm">
7657
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
7658
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
7659
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
7660
+ </xsl:if>
7642
7661
  <xsl:variable name="src">
7643
7662
  <xsl:call-template name="image_src"/>
7644
7663
  </xsl:variable>
@@ -7671,7 +7690,7 @@
7671
7690
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
7672
7691
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
7673
7692
 
7674
- <xsl:if test="@width != '' and @width != 'auto'">
7693
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
7675
7694
  <xsl:attribute name="width">
7676
7695
  <xsl:value-of select="@width"/>
7677
7696
  </xsl:attribute>
@@ -1822,11 +1822,26 @@
1822
1822
  <xsl:value-of select="$font_extended"/><xsl:text>, </xsl:text>
1823
1823
  </xsl:if>
1824
1824
 
1825
- <xsl:value-of select="."/>
1825
+ <xsl:variable name="font_family" select="."/>
1826
1826
 
1827
- <xsl:if test="$additional_fonts != ''">
1828
- <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1829
- </xsl:if>
1827
+ <xsl:choose>
1828
+ <xsl:when test="$additional_fonts = ''">
1829
+ <xsl:value-of select="$font_family"/>
1830
+ </xsl:when>
1831
+ <xsl:otherwise> <!-- $additional_fonts != '' -->
1832
+ <xsl:choose>
1833
+ <xsl:when test="contains($font_family, ',')">
1834
+ <xsl:value-of select="substring-before($font_family, ',')"/>
1835
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1836
+ <xsl:text>, </xsl:text><xsl:value-of select="substring-after($font_family, ',')"/>
1837
+ </xsl:when>
1838
+ <xsl:otherwise>
1839
+ <xsl:value-of select="$font_family"/>
1840
+ <xsl:text>, </xsl:text><xsl:value-of select="$additional_fonts"/>
1841
+ </xsl:otherwise>
1842
+ </xsl:choose>
1843
+ </xsl:otherwise>
1844
+ </xsl:choose>
1830
1845
  </xsl:attribute>
1831
1846
  </xsl:when>
1832
1847
  <xsl:otherwise>
@@ -4480,21 +4495,21 @@
4480
4495
 
4481
4496
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example']" priority="2">
4482
4497
 
4483
- <fo:block xsl:use-attribute-sets="table-note-style">
4498
+ <fo:block xsl:use-attribute-sets="table-note-style">
4484
4499
 
4485
- <xsl:call-template name="refine_table-note-style"/>
4500
+ <xsl:call-template name="refine_table-note-style"/>
4486
4501
 
4487
- <!-- Table's note/example name (NOTE, for example) -->
4488
- <fo:inline xsl:use-attribute-sets="table-note-name-style">
4502
+ <!-- Table's note/example name (NOTE, for example) -->
4503
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
4489
4504
 
4490
- <xsl:call-template name="refine_table-note-name-style"/>
4505
+ <xsl:call-template name="refine_table-note-name-style"/>
4491
4506
 
4492
- <xsl:apply-templates select="*[local-name() = 'name']"/>
4507
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
4493
4508
 
4494
- </fo:inline>
4509
+ </fo:inline>
4495
4510
 
4496
- <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4497
- </fo:block>
4511
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4512
+ </fo:block>
4498
4513
 
4499
4514
  </xsl:template> <!-- table/note -->
4500
4515
 
@@ -7637,8 +7652,12 @@
7637
7652
  <xsl:variable name="isAdded" select="../@added"/>
7638
7653
  <xsl:variable name="isDeleted" select="../@deleted"/>
7639
7654
  <xsl:choose>
7640
- <xsl:when test="ancestor::*[local-name() = 'title']">
7655
+ <xsl:when test="ancestor::*[local-name() = 'title'] or not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
7641
7656
  <fo:inline padding-left="1mm" padding-right="1mm">
7657
+ <xsl:if test="not(parent::*[local-name() = 'figure']) or parent::*[local-name() = 'p']">
7658
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
7659
+ <xsl:attribute name="padding-right">0mm</xsl:attribute>
7660
+ </xsl:if>
7642
7661
  <xsl:variable name="src">
7643
7662
  <xsl:call-template name="image_src"/>
7644
7663
  </xsl:variable>
@@ -7671,7 +7690,7 @@
7671
7690
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
7672
7691
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
7673
7692
 
7674
- <xsl:if test="@width != '' and @width != 'auto'">
7693
+ <xsl:if test="@width != '' and @width != 'auto' and @width != 'text-width' and @width != 'full-page-width' and @width != 'narrow'">
7675
7694
  <xsl:attribute name="width">
7676
7695
  <xsl:value-of select="@width"/>
7677
7696
  </xsl:attribute>