|
7782 | 7782 | <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
7783 | 7783 | <attachment filename="{@name}"/>
|
7784 | 7784 | </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> |
7785 | 7791 | </xsl:variable>
|
7786 | 7792 | <xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
|
7787 | 7793 |
|
|
7794 | 7800 | <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
7795 | 7801 | </xsl:when>
|
7796 | 7802 | <!-- 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]"> |
7798 | 7804 | <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
|
7799 | 7805 | </xsl:when>
|
7800 | 7806 | <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
|
|
13424 | 13430 | <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
|
13425 | 13431 | <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
|
13426 | 13432 | <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}"/> |
13430 | 13436 | </xsl:for-each>
|
13431 | 13437 | </xsl:if>
|
13432 | 13438 | </xsl:template> <!-- addPDFUAmeta -->
|
|
0 commit comments