metanorma-ogc 2.3.14 → 2.4.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: 49d48dcb669ad25c0c130f4ef75fc39afed2c9982eb93474d7765bda627ea7f0
4
- data.tar.gz: 5fef51b685daa9d1ccbead3b3699d51dae50c0bee4ac2d620f9efebf6ad9f084
3
+ metadata.gz: 5d4cd8698433670cb8dcbc3401345b4db09b559215d80264d5f87268b845051d
4
+ data.tar.gz: '09a1f9c9bb600fb387481388aaf366c70362bc64628056c71d827c5cf583b8cf'
5
5
  SHA512:
6
- metadata.gz: f39f3a19fe8f189591774f29b76ca050810ef9826a19a42e636bda5eebf729d1c070f7a040f8ae09d0384c58d059161567a7e38d1fc10edc9eee3043f09837bb
7
- data.tar.gz: 5f22ab9c29f36ec4748f08ed5ef8cb83275078072dbc1d03144526337b4300302b4729c3bde5d11844fdb36b0cb6809102c22c6f042dbe32ebd3b97f6116450c
6
+ metadata.gz: 7fc662db0f4187b8a889d742fc5218dfb5632258cb120249f308752d2fa623e6ad629cacaae52e43321ddeebb8253aa2f1ee0f8818b609dcb064f4e54a76a326
7
+ data.tar.gz: 4ba019984a2ca6514c0a75eba2f2f8bd52b21dd19af9e5af7172f9654ae787e74804566b8c914dc87472d796e5b06bc1bef205811365581e24ff299edb438099
@@ -65,7 +65,8 @@ module IsoDoc
65
65
 
66
66
  def middle_clause(_docxml)
67
67
  "//clause[parent::sections][not(@type = 'scope' or " \
68
- "@type = 'conformance')][not(descendant::terms)]"
68
+ "@type = 'conformance')][not(descendant::terms)]" \
69
+ "[not(descendant::references)]"
69
70
  end
70
71
 
71
72
  def is_clause?(name)
@@ -74,19 +75,6 @@ module IsoDoc
74
75
  super
75
76
  end
76
77
 
77
- def middle(isoxml, out)
78
- middle_title(isoxml, out)
79
- middle_admonitions(isoxml, out)
80
- i = scope isoxml, out, 0
81
- i = conformance isoxml, out, i
82
- i = norm_ref isoxml, out, i
83
- i = terms_defs isoxml, out, i
84
- i = symbols_abbrevs isoxml, out, i
85
- clause isoxml, out
86
- annex isoxml, out
87
- bibliography isoxml, out
88
- end
89
-
90
78
  def table_attrs(node)
91
79
  ret = super
92
80
  %w(recommendation requirement permission).include?(node["class"]) and
@@ -108,10 +96,13 @@ module IsoDoc
108
96
  end
109
97
 
110
98
  def para_class(node)
111
- return node["class"] if node["class"] &&
112
- node["class"] != "RecommendationLabel"
113
-
114
- super
99
+ if node["class"] == "RecommendationLabel"
100
+ node["class"] = nil
101
+ ret = super
102
+ node["class"] = "RecommendationLabel"
103
+ ret
104
+ else super
105
+ end
115
106
  end
116
107
 
117
108
  def ol_depth(node)
@@ -6,9 +6,6 @@ require_relative "metadata"
6
6
 
7
7
  module IsoDoc
8
8
  module Ogc
9
- # A {Converter} implementation that generates HTML output, and a document
10
- # schema encapsulation of the document for validation
11
- #
12
9
  class HtmlConvert < IsoDoc::HtmlConvert
13
10
  def initialize(options)
14
11
  @libdir = File.dirname(__FILE__)
@@ -61,14 +58,8 @@ module IsoDoc
61
58
  end
62
59
 
63
60
  def make_body3(body, docxml)
64
- body.div class: "main-section" do |div3|
65
- @prefacenum = 0
66
- boilerplate docxml, div3
67
- front docxml, div3
68
- middle docxml, div3
69
- footnotes div3
70
- comments div3
71
- end
61
+ @prefacenum = 0
62
+ super
72
63
  end
73
64
 
74
65
  def authority_cleanup(docxml)
@@ -1184,7 +1184,7 @@
1184
1184
  </xsl:if>
1185
1185
  </xsl:template>
1186
1186
 
1187
- <xsl:template match="*[local-name()='th']//text()" priority="2">
1187
+ <xsl:template match="*[local-name()='th']//text()[not(ancestor::ogc:fn)]" priority="2">
1188
1188
  <xsl:variable name="text">
1189
1189
  <xsl:call-template name="add-zero-spaces-java"/>
1190
1190
  </xsl:variable>
@@ -5577,6 +5577,9 @@
5577
5577
  <!-- END Definition List -->
5578
5578
  <!-- ===================== -->
5579
5579
 
5580
+ <!-- default: ignore title in sections/p -->
5581
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
5582
+
5580
5583
  <!-- ========================= -->
5581
5584
  <!-- Rich text formatting -->
5582
5585
  <!-- ========================= -->
@@ -7668,25 +7671,45 @@
7668
7671
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
7669
7672
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
7670
7673
 
7671
- <xsl:variable name="img_src">
7672
- <xsl:choose>
7673
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
7674
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7675
- </xsl:choose>
7676
- </xsl:variable>
7674
+ <xsl:if test="@width != '' and @width != 'auto'">
7675
+ <xsl:attribute name="width">
7676
+ <xsl:value-of select="@width"/>
7677
+ </xsl:attribute>
7678
+ </xsl:if>
7677
7679
 
7678
- <xsl:variable name="image_width_effective">
7680
+ <xsl:if test="@height != '' and @height != 'auto'">
7681
+ <xsl:attribute name="height">
7682
+ <xsl:value-of select="@height"/>
7683
+ </xsl:attribute>
7684
+ </xsl:if>
7679
7685
 
7680
- <xsl:value-of select="$width_effective"/>
7686
+ <xsl:choose>
7687
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
7688
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
7689
+ </xsl:when>
7690
+ <xsl:otherwise>
7681
7691
 
7682
- </xsl:variable>
7692
+ <xsl:variable name="img_src">
7693
+ <xsl:choose>
7694
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
7695
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7696
+ </xsl:choose>
7697
+ </xsl:variable>
7683
7698
 
7684
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7685
- <xsl:if test="number($scale) &lt; 100">
7699
+ <xsl:variable name="image_width_effective">
7686
7700
 
7687
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7701
+ <xsl:value-of select="$width_effective"/>
7688
7702
 
7689
- </xsl:if>
7703
+ </xsl:variable>
7704
+
7705
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7706
+ <xsl:if test="number($scale) &lt; 100">
7707
+
7708
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7709
+
7710
+ </xsl:if>
7711
+ </xsl:otherwise>
7712
+ </xsl:choose>
7690
7713
 
7691
7714
  </xsl:if>
7692
7715
 
@@ -11387,7 +11410,7 @@
11387
11410
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
11388
11411
  <xsl:apply-templates mode="update_xml_step1"/>
11389
11412
  </xsl:template>
11390
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11413
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]/*[local-name() = 'span'][@class] | *[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11391
11414
  <xsl:copy>
11392
11415
  <xsl:copy-of select="@*"/>
11393
11416
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -1184,7 +1184,7 @@
1184
1184
  </xsl:if>
1185
1185
  </xsl:template>
1186
1186
 
1187
- <xsl:template match="*[local-name()='th']//text()" priority="2">
1187
+ <xsl:template match="*[local-name()='th']//text()[not(ancestor::ogc:fn)]" priority="2">
1188
1188
  <xsl:variable name="text">
1189
1189
  <xsl:call-template name="add-zero-spaces-java"/>
1190
1190
  </xsl:variable>
@@ -5577,6 +5577,9 @@
5577
5577
  <!-- END Definition List -->
5578
5578
  <!-- ===================== -->
5579
5579
 
5580
+ <!-- default: ignore title in sections/p -->
5581
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
5582
+
5580
5583
  <!-- ========================= -->
5581
5584
  <!-- Rich text formatting -->
5582
5585
  <!-- ========================= -->
@@ -7668,25 +7671,45 @@
7668
7671
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
7669
7672
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
7670
7673
 
7671
- <xsl:variable name="img_src">
7672
- <xsl:choose>
7673
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
7674
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7675
- </xsl:choose>
7676
- </xsl:variable>
7674
+ <xsl:if test="@width != '' and @width != 'auto'">
7675
+ <xsl:attribute name="width">
7676
+ <xsl:value-of select="@width"/>
7677
+ </xsl:attribute>
7678
+ </xsl:if>
7677
7679
 
7678
- <xsl:variable name="image_width_effective">
7680
+ <xsl:if test="@height != '' and @height != 'auto'">
7681
+ <xsl:attribute name="height">
7682
+ <xsl:value-of select="@height"/>
7683
+ </xsl:attribute>
7684
+ </xsl:if>
7679
7685
 
7680
- <xsl:value-of select="$width_effective"/>
7686
+ <xsl:choose>
7687
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
7688
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
7689
+ </xsl:when>
7690
+ <xsl:otherwise>
7681
7691
 
7682
- </xsl:variable>
7692
+ <xsl:variable name="img_src">
7693
+ <xsl:choose>
7694
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
7695
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7696
+ </xsl:choose>
7697
+ </xsl:variable>
7683
7698
 
7684
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7685
- <xsl:if test="number($scale) &lt; 100">
7699
+ <xsl:variable name="image_width_effective">
7686
7700
 
7687
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7701
+ <xsl:value-of select="$width_effective"/>
7688
7702
 
7689
- </xsl:if>
7703
+ </xsl:variable>
7704
+
7705
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7706
+ <xsl:if test="number($scale) &lt; 100">
7707
+
7708
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7709
+
7710
+ </xsl:if>
7711
+ </xsl:otherwise>
7712
+ </xsl:choose>
7690
7713
 
7691
7714
  </xsl:if>
7692
7715
 
@@ -11387,7 +11410,7 @@
11387
11410
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
11388
11411
  <xsl:apply-templates mode="update_xml_step1"/>
11389
11412
  </xsl:template>
11390
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11413
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]/*[local-name() = 'span'][@class] | *[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11391
11414
  <xsl:copy>
11392
11415
  <xsl:copy-of select="@*"/>
11393
11416
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -1184,7 +1184,7 @@
1184
1184
  </xsl:if>
1185
1185
  </xsl:template>
1186
1186
 
1187
- <xsl:template match="*[local-name()='th']//text()" priority="2">
1187
+ <xsl:template match="*[local-name()='th']//text()[not(ancestor::ogc:fn)]" priority="2">
1188
1188
  <xsl:variable name="text">
1189
1189
  <xsl:call-template name="add-zero-spaces-java"/>
1190
1190
  </xsl:variable>
@@ -5577,6 +5577,9 @@
5577
5577
  <!-- END Definition List -->
5578
5578
  <!-- ===================== -->
5579
5579
 
5580
+ <!-- default: ignore title in sections/p -->
5581
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
5582
+
5580
5583
  <!-- ========================= -->
5581
5584
  <!-- Rich text formatting -->
5582
5585
  <!-- ========================= -->
@@ -7668,25 +7671,45 @@
7668
7671
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
7669
7672
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
7670
7673
 
7671
- <xsl:variable name="img_src">
7672
- <xsl:choose>
7673
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
7674
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7675
- </xsl:choose>
7676
- </xsl:variable>
7674
+ <xsl:if test="@width != '' and @width != 'auto'">
7675
+ <xsl:attribute name="width">
7676
+ <xsl:value-of select="@width"/>
7677
+ </xsl:attribute>
7678
+ </xsl:if>
7677
7679
 
7678
- <xsl:variable name="image_width_effective">
7680
+ <xsl:if test="@height != '' and @height != 'auto'">
7681
+ <xsl:attribute name="height">
7682
+ <xsl:value-of select="@height"/>
7683
+ </xsl:attribute>
7684
+ </xsl:if>
7679
7685
 
7680
- <xsl:value-of select="$width_effective"/>
7686
+ <xsl:choose>
7687
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
7688
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
7689
+ </xsl:when>
7690
+ <xsl:otherwise>
7681
7691
 
7682
- </xsl:variable>
7692
+ <xsl:variable name="img_src">
7693
+ <xsl:choose>
7694
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
7695
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7696
+ </xsl:choose>
7697
+ </xsl:variable>
7683
7698
 
7684
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7685
- <xsl:if test="number($scale) &lt; 100">
7699
+ <xsl:variable name="image_width_effective">
7686
7700
 
7687
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7701
+ <xsl:value-of select="$width_effective"/>
7688
7702
 
7689
- </xsl:if>
7703
+ </xsl:variable>
7704
+
7705
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7706
+ <xsl:if test="number($scale) &lt; 100">
7707
+
7708
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7709
+
7710
+ </xsl:if>
7711
+ </xsl:otherwise>
7712
+ </xsl:choose>
7690
7713
 
7691
7714
  </xsl:if>
7692
7715
 
@@ -11387,7 +11410,7 @@
11387
11410
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
11388
11411
  <xsl:apply-templates mode="update_xml_step1"/>
11389
11412
  </xsl:template>
11390
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11413
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]/*[local-name() = 'span'][@class] | *[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11391
11414
  <xsl:copy>
11392
11415
  <xsl:copy-of select="@*"/>
11393
11416
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -1184,7 +1184,7 @@
1184
1184
  </xsl:if>
1185
1185
  </xsl:template>
1186
1186
 
1187
- <xsl:template match="*[local-name()='th']//text()" priority="2">
1187
+ <xsl:template match="*[local-name()='th']//text()[not(ancestor::ogc:fn)]" priority="2">
1188
1188
  <xsl:variable name="text">
1189
1189
  <xsl:call-template name="add-zero-spaces-java"/>
1190
1190
  </xsl:variable>
@@ -5577,6 +5577,9 @@
5577
5577
  <!-- END Definition List -->
5578
5578
  <!-- ===================== -->
5579
5579
 
5580
+ <!-- default: ignore title in sections/p -->
5581
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
5582
+
5580
5583
  <!-- ========================= -->
5581
5584
  <!-- Rich text formatting -->
5582
5585
  <!-- ========================= -->
@@ -7668,25 +7671,45 @@
7668
7671
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
7669
7672
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
7670
7673
 
7671
- <xsl:variable name="img_src">
7672
- <xsl:choose>
7673
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
7674
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7675
- </xsl:choose>
7676
- </xsl:variable>
7674
+ <xsl:if test="@width != '' and @width != 'auto'">
7675
+ <xsl:attribute name="width">
7676
+ <xsl:value-of select="@width"/>
7677
+ </xsl:attribute>
7678
+ </xsl:if>
7677
7679
 
7678
- <xsl:variable name="image_width_effective">
7680
+ <xsl:if test="@height != '' and @height != 'auto'">
7681
+ <xsl:attribute name="height">
7682
+ <xsl:value-of select="@height"/>
7683
+ </xsl:attribute>
7684
+ </xsl:if>
7679
7685
 
7680
- <xsl:value-of select="$width_effective"/>
7686
+ <xsl:choose>
7687
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
7688
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
7689
+ </xsl:when>
7690
+ <xsl:otherwise>
7681
7691
 
7682
- </xsl:variable>
7692
+ <xsl:variable name="img_src">
7693
+ <xsl:choose>
7694
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
7695
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7696
+ </xsl:choose>
7697
+ </xsl:variable>
7683
7698
 
7684
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7685
- <xsl:if test="number($scale) &lt; 100">
7699
+ <xsl:variable name="image_width_effective">
7686
7700
 
7687
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7701
+ <xsl:value-of select="$width_effective"/>
7688
7702
 
7689
- </xsl:if>
7703
+ </xsl:variable>
7704
+
7705
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7706
+ <xsl:if test="number($scale) &lt; 100">
7707
+
7708
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7709
+
7710
+ </xsl:if>
7711
+ </xsl:otherwise>
7712
+ </xsl:choose>
7690
7713
 
7691
7714
  </xsl:if>
7692
7715
 
@@ -11387,7 +11410,7 @@
11387
11410
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
11388
11411
  <xsl:apply-templates mode="update_xml_step1"/>
11389
11412
  </xsl:template>
11390
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11413
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]/*[local-name() = 'span'][@class] | *[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11391
11414
  <xsl:copy>
11392
11415
  <xsl:copy-of select="@*"/>
11393
11416
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -1184,7 +1184,7 @@
1184
1184
  </xsl:if>
1185
1185
  </xsl:template>
1186
1186
 
1187
- <xsl:template match="*[local-name()='th']//text()" priority="2">
1187
+ <xsl:template match="*[local-name()='th']//text()[not(ancestor::ogc:fn)]" priority="2">
1188
1188
  <xsl:variable name="text">
1189
1189
  <xsl:call-template name="add-zero-spaces-java"/>
1190
1190
  </xsl:variable>
@@ -5577,6 +5577,9 @@
5577
5577
  <!-- END Definition List -->
5578
5578
  <!-- ===================== -->
5579
5579
 
5580
+ <!-- default: ignore title in sections/p -->
5581
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
5582
+
5580
5583
  <!-- ========================= -->
5581
5584
  <!-- Rich text formatting -->
5582
5585
  <!-- ========================= -->
@@ -7668,25 +7671,45 @@
7668
7671
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
7669
7672
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
7670
7673
 
7671
- <xsl:variable name="img_src">
7672
- <xsl:choose>
7673
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
7674
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7675
- </xsl:choose>
7676
- </xsl:variable>
7674
+ <xsl:if test="@width != '' and @width != 'auto'">
7675
+ <xsl:attribute name="width">
7676
+ <xsl:value-of select="@width"/>
7677
+ </xsl:attribute>
7678
+ </xsl:if>
7677
7679
 
7678
- <xsl:variable name="image_width_effective">
7680
+ <xsl:if test="@height != '' and @height != 'auto'">
7681
+ <xsl:attribute name="height">
7682
+ <xsl:value-of select="@height"/>
7683
+ </xsl:attribute>
7684
+ </xsl:if>
7679
7685
 
7680
- <xsl:value-of select="$width_effective"/>
7686
+ <xsl:choose>
7687
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
7688
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
7689
+ </xsl:when>
7690
+ <xsl:otherwise>
7681
7691
 
7682
- </xsl:variable>
7692
+ <xsl:variable name="img_src">
7693
+ <xsl:choose>
7694
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
7695
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7696
+ </xsl:choose>
7697
+ </xsl:variable>
7683
7698
 
7684
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7685
- <xsl:if test="number($scale) &lt; 100">
7699
+ <xsl:variable name="image_width_effective">
7686
7700
 
7687
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7701
+ <xsl:value-of select="$width_effective"/>
7688
7702
 
7689
- </xsl:if>
7703
+ </xsl:variable>
7704
+
7705
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7706
+ <xsl:if test="number($scale) &lt; 100">
7707
+
7708
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7709
+
7710
+ </xsl:if>
7711
+ </xsl:otherwise>
7712
+ </xsl:choose>
7690
7713
 
7691
7714
  </xsl:if>
7692
7715
 
@@ -11387,7 +11410,7 @@
11387
11410
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
11388
11411
  <xsl:apply-templates mode="update_xml_step1"/>
11389
11412
  </xsl:template>
11390
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11413
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]/*[local-name() = 'span'][@class] | *[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11391
11414
  <xsl:copy>
11392
11415
  <xsl:copy-of select="@*"/>
11393
11416
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -1184,7 +1184,7 @@
1184
1184
  </xsl:if>
1185
1185
  </xsl:template>
1186
1186
 
1187
- <xsl:template match="*[local-name()='th']//text()" priority="2">
1187
+ <xsl:template match="*[local-name()='th']//text()[not(ancestor::ogc:fn)]" priority="2">
1188
1188
  <xsl:variable name="text">
1189
1189
  <xsl:call-template name="add-zero-spaces-java"/>
1190
1190
  </xsl:variable>
@@ -5577,6 +5577,9 @@
5577
5577
  <!-- END Definition List -->
5578
5578
  <!-- ===================== -->
5579
5579
 
5580
+ <!-- default: ignore title in sections/p -->
5581
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
5582
+
5580
5583
  <!-- ========================= -->
5581
5584
  <!-- Rich text formatting -->
5582
5585
  <!-- ========================= -->
@@ -7668,25 +7671,45 @@
7668
7671
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
7669
7672
  <xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
7670
7673
 
7671
- <xsl:variable name="img_src">
7672
- <xsl:choose>
7673
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
7674
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7675
- </xsl:choose>
7676
- </xsl:variable>
7674
+ <xsl:if test="@width != '' and @width != 'auto'">
7675
+ <xsl:attribute name="width">
7676
+ <xsl:value-of select="@width"/>
7677
+ </xsl:attribute>
7678
+ </xsl:if>
7677
7679
 
7678
- <xsl:variable name="image_width_effective">
7680
+ <xsl:if test="@height != '' and @height != 'auto'">
7681
+ <xsl:attribute name="height">
7682
+ <xsl:value-of select="@height"/>
7683
+ </xsl:attribute>
7684
+ </xsl:if>
7679
7685
 
7680
- <xsl:value-of select="$width_effective"/>
7686
+ <xsl:choose>
7687
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
7688
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
7689
+ </xsl:when>
7690
+ <xsl:otherwise>
7681
7691
 
7682
- </xsl:variable>
7692
+ <xsl:variable name="img_src">
7693
+ <xsl:choose>
7694
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
7695
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7696
+ </xsl:choose>
7697
+ </xsl:variable>
7683
7698
 
7684
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7685
- <xsl:if test="number($scale) &lt; 100">
7699
+ <xsl:variable name="image_width_effective">
7686
7700
 
7687
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7701
+ <xsl:value-of select="$width_effective"/>
7688
7702
 
7689
- </xsl:if>
7703
+ </xsl:variable>
7704
+
7705
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7706
+ <xsl:if test="number($scale) &lt; 100">
7707
+
7708
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
7709
+
7710
+ </xsl:if>
7711
+ </xsl:otherwise>
7712
+ </xsl:choose>
7690
7713
 
7691
7714
  </xsl:if>
7692
7715
 
@@ -11387,7 +11410,7 @@
11387
11410
  <xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
11388
11411
  <xsl:apply-templates mode="update_xml_step1"/>
11389
11412
  </xsl:template>
11390
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11413
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]/*[local-name() = 'span'][@class] | *[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
11391
11414
  <xsl:copy>
11392
11415
  <xsl:copy-of select="@*"/>
11393
11416
  <xsl:apply-templates mode="update_xml_step1"/>