lib/isodoc/un/un.recommendation.xsl in metanorma-un-0.10.13 vs lib/isodoc/un/un.recommendation.xsl in metanorma-un-0.11.0
- old
+ new
@@ -4753,10 +4753,13 @@
<xsl:template match="*[local-name()='dd']" mode="dl_if_nested"/>
<!-- ===================== -->
<!-- END Definition List -->
<!-- ===================== -->
+ <!-- default: ignore title in sections/p -->
+ <xsl:template match="*[local-name() = 'sections']/*[local-name() = 'p'][starts-with(@class, 'zzSTDTitle')]" priority="3"/>
+
<!-- ========================= -->
<!-- Rich text formatting -->
<!-- ========================= -->
<xsl:template match="*[local-name()='em']">
<fo:inline font-style="italic">
@@ -6844,30 +6847,50 @@
</xsl:when>
<xsl:otherwise>
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
<xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
- <xsl:variable name="img_src">
- <xsl:choose>
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
- <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
- </xsl:choose>
- </xsl:variable>
+ <xsl:if test="@width != '' and @width != 'auto'">
+ <xsl:attribute name="width">
+ <xsl:value-of select="@width"/>
+ </xsl:attribute>
+ </xsl:if>
- <xsl:variable name="image_width_effective">
+ <xsl:if test="@height != '' and @height != 'auto'">
+ <xsl:attribute name="height">
+ <xsl:value-of select="@height"/>
+ </xsl:attribute>
+ </xsl:if>
- <xsl:value-of select="$width_effective"/>
+ <xsl:choose>
+ <xsl:when test="@width != '' and @width != 'auto' and @height != '' and @height != 'auto'">
+ <xsl:attribute name="scaling">non-uniform</xsl:attribute>
+ </xsl:when>
+ <xsl:otherwise>
- </xsl:variable>
+ <xsl:variable name="img_src">
+ <xsl:choose>
+ <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
+ <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
+ </xsl:choose>
+ </xsl:variable>
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
- <xsl:if test="number($scale) < 100">
+ <xsl:variable name="image_width_effective">
- <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
+ <xsl:value-of select="$width_effective"/>
- </xsl:if>
+ </xsl:variable>
+ <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
+ <xsl:if test="number($scale) < 100">
+
+ <xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
+
+ </xsl:if>
+ </xsl:otherwise>
+ </xsl:choose>
+
</xsl:if>
</fo:external-graphic>
</xsl:otherwise>
</xsl:choose>
@@ -10506,10 +10529,10 @@
</xsl:template>
<!-- Note: to enable the addition of character span markup with semantic styling for DIS Word output -->
<xsl:template match="*[local-name() = 'span']" mode="update_xml_step1">
<xsl:apply-templates mode="update_xml_step1"/>
</xsl:template>
- <xsl:template match="*[local-name() = 'sourcecode']//*[local-name() = 'span'][@class]" mode="update_xml_step1" priority="2">
+ <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">
<xsl:copy>
<xsl:copy-of select="@*"/>
<xsl:apply-templates mode="update_xml_step1"/>
</xsl:copy>
</xsl:template>
\ No newline at end of file