Skip to content

Commit 02b2809

Browse files
xslt update based on metanorma/mn-native-pdf@0de45d5
1 parent 03cc7f6 commit 02b2809

File tree

1 file changed

+37
-5
lines changed

1 file changed

+37
-5
lines changed

lib/isodoc/plateau/plateau.international-standard.xsl

+37-5
Original file line numberDiff line numberDiff line change
@@ -1177,6 +1177,8 @@
11771177
</fo:block-container>
11781178
</xsl:template>
11791179

1180+
<xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']" priority="3"/>
1181+
11801182
<xsl:template match="*[local-name() = 'note'][not(ancestor::plateau:table)]/*[local-name() = 'p']" priority="2">
11811183
<xsl:call-template name="paragraph"/>
11821184
</xsl:template>
@@ -8437,7 +8439,16 @@
84378439
</xsl:variable>
84388440
<xsl:variable name="img_src">
84398441
<xsl:choose>
8440-
<xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
8442+
<xsl:when test="not(starts-with(@src, 'data:'))">
8443+
<xsl:choose>
8444+
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
8445+
<xsl:value-of select="@src"/>
8446+
</xsl:when>
8447+
<xsl:otherwise>
8448+
<xsl:value-of select="concat($basepath, @src)"/>
8449+
</xsl:otherwise>
8450+
</xsl:choose>
8451+
</xsl:when>
84418452
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
84428453
</xsl:choose>
84438454
</xsl:variable>
@@ -8450,7 +8461,7 @@
84508461
<!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
84518462
<xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
84528463
<xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
8453-
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
8464+
<xsl:variable name="scale" select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
84548465
<xsl:value-of select="$scale"/>
84558466
</xsl:template>
84568467

@@ -8469,7 +8480,14 @@
84698480
<xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
84708481
</xsl:when>
84718482
<xsl:when test="not(starts-with(@src, 'data:'))">
8472-
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
8483+
<xsl:choose>
8484+
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
8485+
<xsl:value-of select="concat('url(file:///', @src, ')')"/>
8486+
</xsl:when>
8487+
<xsl:otherwise>
8488+
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
8489+
</xsl:otherwise>
8490+
</xsl:choose>
84738491
</xsl:when>
84748492
<xsl:otherwise>
84758493
<xsl:value-of select="@src"/>
@@ -8491,7 +8509,14 @@
84918509
</xsl:when>
84928510
<xsl:when test="not(starts-with(@src, 'data:'))">
84938511
<xsl:variable name="src">
8494-
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
8512+
<xsl:choose>
8513+
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
8514+
<xsl:value-of select="concat('url(file:///', @src, ')')"/>
8515+
</xsl:when>
8516+
<xsl:otherwise>
8517+
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
8518+
</xsl:otherwise>
8519+
</xsl:choose>
84958520
</xsl:variable>
84968521
<xsl:variable name="file" select="java:java.io.File.new(@src)"/>
84978522
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
@@ -13775,7 +13800,14 @@
1377513800
<xsl:value-of select="$src"/>
1377613801
</xsl:when>
1377713802
<xsl:otherwise>
13778-
<xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
13803+
<xsl:choose>
13804+
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
13805+
<xsl:value-of select="concat('url(file:///', @src, ')')"/>
13806+
</xsl:when>
13807+
<xsl:otherwise>
13808+
<xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
13809+
</xsl:otherwise>
13810+
</xsl:choose>
1377913811
</xsl:otherwise>
1378013812
</xsl:choose>
1378113813
</xsl:template>

0 commit comments

Comments
 (0)