Skip to content

Commit

Permalink
Merge pull request #249 from metanorma/feature/xslt-update
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] authored Oct 7, 2024
2 parents c96e888 + 0ef6ff7 commit 3b3d6f3
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 8 deletions.
16 changes: 12 additions & 4 deletions lib/isodoc/m3aawg/m3aawg.policy.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -12393,7 +12393,8 @@
<xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
<xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
<!-- Todo: need update -->
<xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
<xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
<xsl:variable name="volatile" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>

<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{$filename}" link-as-file-annotation="true">
<xsl:attribute name="src">
Expand All @@ -12414,6 +12415,9 @@
<xsl:if test="$afrelationship != ''">
<xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
</xsl:if>
<xsl:if test="$volatile != ''">
<xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
</xsl:if>
</pdf:embedded-file>
</xsl:for-each>
<!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
Expand All @@ -12424,14 +12428,18 @@
<xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
<xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
<!-- Todo: need update -->
<xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
<xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
<xsl:variable name="volatile" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
<xsl:if test="$description != ''">
<xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
</xsl:if>
<xsl:if test="$afrelationship != ''">
<xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
</xsl:if>
<xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
</xsl:if>
<xsl:if test="$volatile != ''">
<xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
</xsl:if>
</pdf:embedded-file>
</xsl:for-each>
</xsl:if>
Expand Down
16 changes: 12 additions & 4 deletions lib/isodoc/m3aawg/m3aawg.report.xsl
Original file line number Diff line number Diff line change
Expand Up @@ -12393,7 +12393,8 @@
<xsl:variable name="description" select="normalize-space($bibitem_attachment/*[local-name() = 'formattedref'])"/>
<xsl:variable name="filename" select="java:org.metanorma.fop.Util.getFilenameFromPath(@name)"/>
<!-- Todo: need update -->
<xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
<xsl:variable name="afrelationship" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
<xsl:variable name="volatile" select="normalize-space($bibitem_attachment//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>

<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{$filename}" link-as-file-annotation="true">
<xsl:attribute name="src">
Expand All @@ -12414,6 +12415,9 @@
<xsl:if test="$afrelationship != ''">
<xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
</xsl:if>
<xsl:if test="$volatile != ''">
<xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
</xsl:if>
</pdf:embedded-file>
</xsl:for-each>
<!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
Expand All @@ -12424,14 +12428,18 @@
<xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
<xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
<!-- Todo: need update -->
<xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'span'][@class = 'pdf-AFRelationship'])"/>
<xsl:variable name="afrelationship" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-AFRelationship'])"/>
<xsl:variable name="volatile" select="normalize-space(.//*[local-name() = 'classification'][@type = 'pdf-volatile'])"/>
<pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_name}" link-as-file-annotation="true">
<xsl:if test="$description != ''">
<xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
</xsl:if>
<xsl:if test="$afrelationship != ''">
<xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
</xsl:if>
<xsl:attribute name="afrelationship"><xsl:value-of select="$afrelationship"/></xsl:attribute>
</xsl:if>
<xsl:if test="$volatile != ''">
<xsl:attribute name="volatile"><xsl:value-of select="$volatile"/></xsl:attribute>
</xsl:if>
</pdf:embedded-file>
</xsl:for-each>
</xsl:if>
Expand Down

0 comments on commit 3b3d6f3

Please sign in to comment.