Skip to content

Commit 8b22b6f

Browse files
xslt update based on metanorma/mn-native-pdf@ac24692
1 parent 1656229 commit 8b22b6f

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

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

+10-4
Original file line numberDiff line numberDiff line change
@@ -7782,6 +7782,12 @@
77827782
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
77837783
<attachment filename="{@name}"/>
77847784
</xsl:for-each>
7785+
<xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
7786+
<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
7787+
<xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
7788+
<attachment filename="{$attachment_path}"/>
7789+
</xsl:for-each>
7790+
</xsl:if>
77857791
</xsl:variable>
77867792
<xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
77877793

@@ -7794,7 +7800,7 @@
77947800
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
77957801
</xsl:when>
77967802
<!-- link to the PDF attachment -->
7797-
<xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
7803+
<xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
77987804
<xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
77997805
</xsl:when>
78007806
<!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
@@ -13424,9 +13430,9 @@
1342413430
<xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
1342513431
<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
1342613432
<xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
13427-
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, $attachment_path, ')')"/>
13428-
<xsl:variable name="filename_embedded" select="substring-after($attachment_path, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
13429-
<pdf:embedded-file src="{$url}" filename="{$filename_embedded}"/>
13433+
<xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
13434+
<!-- <xsl:variable name="filename_embedded" select="substring-after($attachment_path, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/> -->
13435+
<pdf:embedded-file src="{$url}" filename="{$attachment_path}"/>
1343013436
</xsl:for-each>
1343113437
</xsl:if>
1343213438
</xsl:template> <!-- addPDFUAmeta -->

0 commit comments

Comments
 (0)