Skip to content

Commit

Permalink
Merge pull request #749 from metanorma/feature/xslt-update
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Dec 21, 2024
2 parents f688cbf + b79b278 commit 0fe667a
Show file tree
Hide file tree
Showing 16 changed files with 384 additions and 496 deletions.
55 changes: 24 additions & 31 deletions lib/isodoc/ogc/ogc.abstract-specification-topic.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -9054,16 +9054,29 @@
<xsl:template name="getImageSrc">
<xsl:choose>
<xsl:when test="not(starts-with(@src, 'data:'))">
<xsl:call-template name="getImageSrcExternal"/>
</xsl:when>
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template name="getImageSrcExternal">
<xsl:choose>
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
<xsl:value-of select="@src"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="src_with_basepath" select="concat($basepath, @src)"/>
<xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($src_with_basepath)))"/>
<xsl:choose>
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
<xsl:value-of select="@src"/>
<xsl:when test="$file_exists = 'true'">
<xsl:value-of select="$src_with_basepath"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($basepath, @src)"/>
<xsl:value-of select="@src"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

Expand Down Expand Up @@ -9111,14 +9124,8 @@
<xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
</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="concat('url(file:///', @src, ')')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
<xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@src"/>
Expand All @@ -9139,16 +9146,8 @@
</svg>
</xsl:when>
<xsl:when test="not(starts-with(@src, 'data:'))">
<xsl:variable name="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="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
<xsl:variable name="src" select="concat('url(file:///', $src_external, ')')"/>
<xsl:variable name="file" select="java:java.io.File.new(@src)"/>
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
<xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
Expand Down Expand Up @@ -14761,14 +14760,8 @@
<xsl:value-of select="$src"/>
</xsl:when>
<xsl:otherwise>
<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 name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
<xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Expand Down
55 changes: 24 additions & 31 deletions lib/isodoc/ogc/ogc.best-practice.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -9054,16 +9054,29 @@
<xsl:template name="getImageSrc">
<xsl:choose>
<xsl:when test="not(starts-with(@src, 'data:'))">
<xsl:call-template name="getImageSrcExternal"/>
</xsl:when>
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template name="getImageSrcExternal">
<xsl:choose>
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
<xsl:value-of select="@src"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="src_with_basepath" select="concat($basepath, @src)"/>
<xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($src_with_basepath)))"/>
<xsl:choose>
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
<xsl:value-of select="@src"/>
<xsl:when test="$file_exists = 'true'">
<xsl:value-of select="$src_with_basepath"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($basepath, @src)"/>
<xsl:value-of select="@src"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

Expand Down Expand Up @@ -9111,14 +9124,8 @@
<xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
</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="concat('url(file:///', @src, ')')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
<xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@src"/>
Expand All @@ -9139,16 +9146,8 @@
</svg>
</xsl:when>
<xsl:when test="not(starts-with(@src, 'data:'))">
<xsl:variable name="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="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
<xsl:variable name="src" select="concat('url(file:///', $src_external, ')')"/>
<xsl:variable name="file" select="java:java.io.File.new(@src)"/>
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
<xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
Expand Down Expand Up @@ -14761,14 +14760,8 @@
<xsl:value-of select="$src"/>
</xsl:when>
<xsl:otherwise>
<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 name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
<xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Expand Down
55 changes: 24 additions & 31 deletions lib/isodoc/ogc/ogc.change-request-supporting-document.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -9054,16 +9054,29 @@
<xsl:template name="getImageSrc">
<xsl:choose>
<xsl:when test="not(starts-with(@src, 'data:'))">
<xsl:call-template name="getImageSrcExternal"/>
</xsl:when>
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template name="getImageSrcExternal">
<xsl:choose>
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
<xsl:value-of select="@src"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="src_with_basepath" select="concat($basepath, @src)"/>
<xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($src_with_basepath)))"/>
<xsl:choose>
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
<xsl:value-of select="@src"/>
<xsl:when test="$file_exists = 'true'">
<xsl:value-of select="$src_with_basepath"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($basepath, @src)"/>
<xsl:value-of select="@src"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

Expand Down Expand Up @@ -9111,14 +9124,8 @@
<xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
</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="concat('url(file:///', @src, ')')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
<xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@src"/>
Expand All @@ -9139,16 +9146,8 @@
</svg>
</xsl:when>
<xsl:when test="not(starts-with(@src, 'data:'))">
<xsl:variable name="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="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
<xsl:variable name="src" select="concat('url(file:///', $src_external, ')')"/>
<xsl:variable name="file" select="java:java.io.File.new(@src)"/>
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
<xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
Expand Down Expand Up @@ -14761,14 +14760,8 @@
<xsl:value-of select="$src"/>
</xsl:when>
<xsl:otherwise>
<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 name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
<xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Expand Down
55 changes: 24 additions & 31 deletions lib/isodoc/ogc/ogc.community-practice.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -9054,16 +9054,29 @@
<xsl:template name="getImageSrc">
<xsl:choose>
<xsl:when test="not(starts-with(@src, 'data:'))">
<xsl:call-template name="getImageSrcExternal"/>
</xsl:when>
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
</xsl:choose>
</xsl:template>

<xsl:template name="getImageSrcExternal">
<xsl:choose>
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
<xsl:value-of select="@src"/>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="src_with_basepath" select="concat($basepath, @src)"/>
<xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($src_with_basepath)))"/>
<xsl:choose>
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
<xsl:value-of select="@src"/>
<xsl:when test="$file_exists = 'true'">
<xsl:value-of select="$src_with_basepath"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat($basepath, @src)"/>
<xsl:value-of select="@src"/>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
</xsl:otherwise>
</xsl:choose>
</xsl:template>

Expand Down Expand Up @@ -9111,14 +9124,8 @@
<xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
</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="concat('url(file:///', @src, ')')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
</xsl:otherwise>
</xsl:choose>
<xsl:variable name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
<xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
</xsl:when>
<xsl:otherwise>
<xsl:value-of select="@src"/>
Expand All @@ -9139,16 +9146,8 @@
</svg>
</xsl:when>
<xsl:when test="not(starts-with(@src, 'data:'))">
<xsl:variable name="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="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
<xsl:variable name="src" select="concat('url(file:///', $src_external, ')')"/>
<xsl:variable name="file" select="java:java.io.File.new(@src)"/>
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
<xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
Expand Down Expand Up @@ -14761,14 +14760,8 @@
<xsl:value-of select="$src"/>
</xsl:when>
<xsl:otherwise>
<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 name="src_external"><xsl:call-template name="getImageSrcExternal"/></xsl:variable>
<xsl:value-of select="concat('url(file:///', $src_external, ')')"/>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
Expand Down
Loading

0 comments on commit 0fe667a

Please sign in to comment.