Skip to content

Commit

Permalink
common.xsl updated for support external attachments, #694
Browse files Browse the repository at this point in the history
  • Loading branch information
Intelligent2013 committed Jun 20, 2024
1 parent ad72513 commit ed29063
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions xslt_src/common.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -19433,6 +19433,15 @@
</xsl:otherwise>
</xsl:choose>
</xsl:for-each>
<!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
<xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
<xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, $attachment_path, ')')"/>
<xsl:variable name="filename_embedded" select="substring-after($attachment_path, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
<pdf:embedded-file src="{$url}" filename="{$filename_embedded}" xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf"/>
</xsl:for-each>
</xsl:if>
</xsl:template> <!-- addPDFUAmeta -->

<xsl:template name="getId">
Expand Down

0 comments on commit ed29063

Please sign in to comment.