Skip to content

Commit

Permalink
xslt update based on metanorma/mn-native-pdf@a213222
Browse files Browse the repository at this point in the history
  • Loading branch information
Intelligent2013 authored Jun 8, 2024
1 parent cb3d6b3 commit dd1e47d
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 0 deletions.
9 changes: 9 additions & 0 deletions lib/isodoc/un/un.plenary-attachment.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -7279,6 +7279,15 @@
<xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
<xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
</xsl:when>
<!-- in WebP format, then convert image into PNG -->
<xsl:when test="starts-with(@src, 'data:image/webp')">
<xsl:variable name="src_png" select="java:org.metanorma.fop.utils.ImageUtils.convertWebPtoPNG(@src)"/>
<xsl:value-of select="$src_png"/>
</xsl:when>
<xsl:when test="not(starts-with(@src, 'data:')) and (java:endsWith(java:java.lang.String.new(@src), '.webp') or java:endsWith(java:java.lang.String.new(@src), '.WEBP'))">
<xsl:variable name="src_png" select="java:org.metanorma.fop.utils.ImageUtils.convertWebPtoPNG(@src)"/>
<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:when>
Expand Down
9 changes: 9 additions & 0 deletions lib/isodoc/un/un.plenary.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -7279,6 +7279,15 @@
<xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
<xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
</xsl:when>
<!-- in WebP format, then convert image into PNG -->
<xsl:when test="starts-with(@src, 'data:image/webp')">
<xsl:variable name="src_png" select="java:org.metanorma.fop.utils.ImageUtils.convertWebPtoPNG(@src)"/>
<xsl:value-of select="$src_png"/>
</xsl:when>
<xsl:when test="not(starts-with(@src, 'data:')) and (java:endsWith(java:java.lang.String.new(@src), '.webp') or java:endsWith(java:java.lang.String.new(@src), '.WEBP'))">
<xsl:variable name="src_png" select="java:org.metanorma.fop.utils.ImageUtils.convertWebPtoPNG(@src)"/>
<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:when>
Expand Down
9 changes: 9 additions & 0 deletions lib/isodoc/un/un.recommendation.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -7406,6 +7406,15 @@
<xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
<xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
</xsl:when>
<!-- in WebP format, then convert image into PNG -->
<xsl:when test="starts-with(@src, 'data:image/webp')">
<xsl:variable name="src_png" select="java:org.metanorma.fop.utils.ImageUtils.convertWebPtoPNG(@src)"/>
<xsl:value-of select="$src_png"/>
</xsl:when>
<xsl:when test="not(starts-with(@src, 'data:')) and (java:endsWith(java:java.lang.String.new(@src), '.webp') or java:endsWith(java:java.lang.String.new(@src), '.WEBP'))">
<xsl:variable name="src_png" select="java:org.metanorma.fop.utils.ImageUtils.convertWebPtoPNG(@src)"/>
<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:when>
Expand Down

0 comments on commit dd1e47d

Please sign in to comment.