metanorma / mn-native-pdf

Development repository for mn2pdf with Metanorma document samples
3 stars 2 forks source link

PDF: support attachments for all XSLT #694

Closed Intelligent2013 closed 5 months ago

Intelligent2013 commented 5 months ago

In continue of: https://github.com/metanorma/iso-10303/issues/208

Add PDF attachment support for all XSLT. Currently, ISO XSLT only supports it.

Intelligent2013 commented 5 months ago

Documentation: https://www.metanorma.org/author/topics/sections/attachments/

Need support both:

Intelligent2013 commented 5 months ago

For adoc instance:

== Scope

Test case: <<file1>>

[bibliography]
== Bibliography

* [[[ISO3696,ISO 3696]]], _Water for analytical laboratory use -- Specification and test methods_

* [[[file1,attachment:(schemas/action_schema.exp)]]]

the Presentation XML structure for attachments:

    <metanorma-extension>
...
        <attachment name="action_schema.exp">data:application/octet-stream;base64,KCoNCiRJZD
...
    </metanorma-extension>
...
<sections>
   ...
      <p id="_">Test case: <link target="./_test.attachment_attachments/action_schema.exp">schemas/action_schema.exp</link>
...
</sections>
...

<bibliography>
...
     <bibitem id="file1" hidden="true">
            <formattedref format="application/x-isodoc+xml">[NO INFORMATION AVAILABLE]</formattedref>
            <uri type="attachment">./_test.attachment_attachments/action_schema.exp</uri>
            <uri type="citation">./_test.attachment_attachments/action_schema.exp</uri>
            <docidentifier type="metanorma">[schemas/action_schema.exp]</docidentifier>
            </bibitem>
...
Intelligent2013 commented 5 months ago

binary-encoded within the Metanorma XML file,

This feature realized already in all XSLT (https://github.com/metanorma/metanorma-standoc/issues/872).

references to attachments

In adoc: :data-uri-attachment: false

the Presentation XML is:

<sections>
   ...
      <p id="_">Test case: <link target="./_test.attachment_attachments/action_schema.exp">schemas/action_schema.exp</link>
...
</sections>
...

<bibliography>
...
     <bibitem id="file1" hidden="true">
            <formattedref format="application/x-isodoc+xml">[NO INFORMATION AVAILABLE]</formattedref>
            <uri type="attachment">./_test.attachment_attachments/action_schema.exp</uri>
            <uri type="citation">./_test.attachment_attachments/action_schema.exp</uri>
            <docidentifier type="metanorma">[schemas/action_schema.exp]</docidentifier>
            </bibitem>
...
Intelligent2013 commented 5 months ago

Done.