Skip to content

Commit

Permalink
Merge pull request #734 from metanorma/plateau_update
Browse files Browse the repository at this point in the history
Plateau update
  • Loading branch information
Intelligent2013 authored Aug 23, 2024
2 parents 222a0cd + 64edba4 commit 0de45d5
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 5 deletions.
40 changes: 35 additions & 5 deletions xslt_src/common.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -13215,7 +13215,16 @@
</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:when test="not(starts-with(@src, 'data:'))">
<xsl:choose>
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
<xsl:value-of select="@src"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($basepath, @src)"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
Expand All @@ -13241,7 +13250,7 @@
<!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
<xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
<xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
<xsl:variable name="scale" select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
<xsl:value-of select="$scale"/>
</xsl:template>

Expand All @@ -13262,7 +13271,14 @@
<xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
</xsl:when>
<xsl:when test="not(starts-with(@src, 'data:'))">
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
<xsl:choose>
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
<xsl:value-of select="concat('url(file:///', @src, ')')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@src"/>
Expand All @@ -13284,7 +13300,14 @@
</xsl:when>
<xsl:when test="not(starts-with(@src, 'data:'))">
<xsl:variable name="src">
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
<xsl:choose>
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
<xsl:value-of select="concat('url(file:///', @src, ')')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="file" select="java:java.io.File.new(@src)"/>
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
Expand Down Expand Up @@ -20144,7 +20167,14 @@
<xsl:value-of select="$src"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
<xsl:choose>
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
<xsl:value-of select="concat('url(file:///', @src, ')')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Expand Down
2 changes: 2 additions & 0 deletions xslt_src/plateau.international-standard.core.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -1226,6 +1226,8 @@
</fo:block-container>
</xsl:template>

<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']" priority="3"/>

<xsl:template match="*[local-name() = 'note'][not(ancestor::plateau:table)]/*[local-name() = 'p']" priority="2">
<xsl:call-template name="paragraph"/>
</xsl:template>
Expand Down

0 comments on commit 0de45d5

Please sign in to comment.