metanorma-ogc 2.6.0 → 2.6.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/isodoc/ogc/i18n-en.yaml +15 -9
- data/lib/isodoc/ogc/ogc.abstract-specification-topic.xsl +68 -21
- data/lib/isodoc/ogc/ogc.best-practice.xsl +68 -21
- data/lib/isodoc/ogc/ogc.change-request-supporting-document.xsl +68 -21
- data/lib/isodoc/ogc/ogc.community-practice.xsl +68 -21
- data/lib/isodoc/ogc/ogc.community-standard.xsl +68 -21
- data/lib/isodoc/ogc/ogc.discussion-paper.xsl +68 -21
- data/lib/isodoc/ogc/ogc.draft-standard.xsl +68 -21
- data/lib/isodoc/ogc/ogc.engineering-report.xsl +68 -21
- data/lib/isodoc/ogc/ogc.other.xsl +68 -21
- data/lib/isodoc/ogc/ogc.policy.xsl +68 -21
- data/lib/isodoc/ogc/ogc.reference-model.xsl +68 -21
- data/lib/isodoc/ogc/ogc.release-notes.xsl +68 -21
- data/lib/isodoc/ogc/ogc.standard.xsl +68 -21
- data/lib/isodoc/ogc/ogc.test-suite.xsl +68 -21
- data/lib/isodoc/ogc/ogc.user-guide.xsl +68 -21
- data/lib/isodoc/ogc/ogc.white-paper.xsl +68 -21
- data/lib/isodoc/ogc/word_convert.rb +1 -1
- data/lib/metanorma/ogc/basicdoc.rng +71 -6
- data/lib/metanorma/ogc/biblio.rng +3 -1
- data/lib/metanorma/ogc/isodoc.rng +3 -0
- data/lib/metanorma/ogc/reqt.rng +3 -0
- data/lib/metanorma/ogc/version.rb +1 -1
- metadata +2 -3
- data/Gemfile.devel +0 -4
@@ -8103,6 +8103,12 @@
|
|
8103
8103
|
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
8104
8104
|
<attachment filename="{@name}"/>
|
8105
8105
|
</xsl:for-each>
|
8106
|
+
<xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
|
8107
|
+
<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
|
8108
|
+
<xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
|
8109
|
+
<attachment filename="{$attachment_path}"/>
|
8110
|
+
</xsl:for-each>
|
8111
|
+
</xsl:if>
|
8106
8112
|
</xsl:variable>
|
8107
8113
|
<xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
|
8108
8114
|
|
@@ -8115,7 +8121,7 @@
|
|
8115
8121
|
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
8116
8122
|
</xsl:when>
|
8117
8123
|
<!-- link to the PDF attachment -->
|
8118
|
-
<xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
|
8124
|
+
<xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
|
8119
8125
|
<xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
|
8120
8126
|
</xsl:when>
|
8121
8127
|
<!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
|
@@ -8770,7 +8776,16 @@
|
|
8770
8776
|
</xsl:variable>
|
8771
8777
|
<xsl:variable name="img_src">
|
8772
8778
|
<xsl:choose>
|
8773
|
-
<xsl:when test="not(starts-with(@src, 'data:'))"
|
8779
|
+
<xsl:when test="not(starts-with(@src, 'data:'))">
|
8780
|
+
<xsl:choose>
|
8781
|
+
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
|
8782
|
+
<xsl:value-of select="@src"/>
|
8783
|
+
</xsl:when>
|
8784
|
+
<xsl:otherwise>
|
8785
|
+
<xsl:value-of select="concat($basepath, @src)"/>
|
8786
|
+
</xsl:otherwise>
|
8787
|
+
</xsl:choose>
|
8788
|
+
</xsl:when>
|
8774
8789
|
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
|
8775
8790
|
</xsl:choose>
|
8776
8791
|
</xsl:variable>
|
@@ -8783,7 +8798,7 @@
|
|
8783
8798
|
<!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
|
8784
8799
|
<xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
|
8785
8800
|
<xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
|
8786
|
-
<xsl:variable name="scale" select="java:org.metanorma.fop.
|
8801
|
+
<xsl:variable name="scale" select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
|
8787
8802
|
<xsl:value-of select="$scale"/>
|
8788
8803
|
</xsl:template>
|
8789
8804
|
|
@@ -8802,7 +8817,14 @@
|
|
8802
8817
|
<xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
|
8803
8818
|
</xsl:when>
|
8804
8819
|
<xsl:when test="not(starts-with(@src, 'data:'))">
|
8805
|
-
<xsl:
|
8820
|
+
<xsl:choose>
|
8821
|
+
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
|
8822
|
+
<xsl:value-of select="concat('url(file:///', @src, ')')"/>
|
8823
|
+
</xsl:when>
|
8824
|
+
<xsl:otherwise>
|
8825
|
+
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
|
8826
|
+
</xsl:otherwise>
|
8827
|
+
</xsl:choose>
|
8806
8828
|
</xsl:when>
|
8807
8829
|
<xsl:otherwise>
|
8808
8830
|
<xsl:value-of select="@src"/>
|
@@ -8824,7 +8846,14 @@
|
|
8824
8846
|
</xsl:when>
|
8825
8847
|
<xsl:when test="not(starts-with(@src, 'data:'))">
|
8826
8848
|
<xsl:variable name="src">
|
8827
|
-
<xsl:
|
8849
|
+
<xsl:choose>
|
8850
|
+
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
|
8851
|
+
<xsl:value-of select="concat('url(file:///', @src, ')')"/>
|
8852
|
+
</xsl:when>
|
8853
|
+
<xsl:otherwise>
|
8854
|
+
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
|
8855
|
+
</xsl:otherwise>
|
8856
|
+
</xsl:choose>
|
8828
8857
|
</xsl:variable>
|
8829
8858
|
<xsl:variable name="file" select="java:java.io.File.new(@src)"/>
|
8830
8859
|
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
|
@@ -13659,26 +13688,37 @@
|
|
13659
13688
|
</x:xmpmeta>
|
13660
13689
|
<!-- add attachments -->
|
13661
13690
|
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
13662
|
-
<xsl:
|
13663
|
-
|
13664
|
-
|
13665
|
-
|
13666
|
-
|
13667
|
-
|
13668
|
-
|
13669
|
-
|
13670
|
-
|
13671
|
-
|
13672
|
-
|
13673
|
-
|
13691
|
+
<xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
|
13692
|
+
|
13693
|
+
<pdf:embedded-file filename="{@name}">
|
13694
|
+
<xsl:attribute name="src">
|
13695
|
+
<xsl:choose>
|
13696
|
+
<xsl:when test="normalize-space() != ''">
|
13697
|
+
<xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'( | | )', '')"/> <!-- remove line breaks -->
|
13698
|
+
<xsl:value-of select="$src_attachment"/>
|
13699
|
+
</xsl:when>
|
13700
|
+
<xsl:otherwise>
|
13701
|
+
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
|
13702
|
+
<xsl:value-of select="$url"/>
|
13703
|
+
</xsl:otherwise>
|
13704
|
+
</xsl:choose>
|
13705
|
+
</xsl:attribute>
|
13706
|
+
<xsl:if test="$description != ''">
|
13707
|
+
<xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
|
13708
|
+
</xsl:if>
|
13709
|
+
</pdf:embedded-file>
|
13674
13710
|
</xsl:for-each>
|
13675
13711
|
<!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
|
13676
13712
|
<xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
|
13677
13713
|
<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
|
13678
13714
|
<xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
|
13679
|
-
<xsl:variable name="url" select="concat('url(file:///',$
|
13680
|
-
<xsl:variable name="
|
13681
|
-
<pdf:embedded-file src="{$url}" filename="{$
|
13715
|
+
<xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
|
13716
|
+
<xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
|
13717
|
+
<pdf:embedded-file src="{$url}" filename="{$attachment_path}">
|
13718
|
+
<xsl:if test="$description != ''">
|
13719
|
+
<xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
|
13720
|
+
</xsl:if>
|
13721
|
+
</pdf:embedded-file>
|
13682
13722
|
</xsl:for-each>
|
13683
13723
|
</xsl:if>
|
13684
13724
|
</xsl:template> <!-- addPDFUAmeta -->
|
@@ -14056,7 +14096,14 @@
|
|
14056
14096
|
<xsl:value-of select="$src"/>
|
14057
14097
|
</xsl:when>
|
14058
14098
|
<xsl:otherwise>
|
14059
|
-
<xsl:
|
14099
|
+
<xsl:choose>
|
14100
|
+
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
|
14101
|
+
<xsl:value-of select="concat('url(file:///', @src, ')')"/>
|
14102
|
+
</xsl:when>
|
14103
|
+
<xsl:otherwise>
|
14104
|
+
<xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
|
14105
|
+
</xsl:otherwise>
|
14106
|
+
</xsl:choose>
|
14060
14107
|
</xsl:otherwise>
|
14061
14108
|
</xsl:choose>
|
14062
14109
|
</xsl:template>
|
@@ -8103,6 +8103,12 @@
|
|
8103
8103
|
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
8104
8104
|
<attachment filename="{@name}"/>
|
8105
8105
|
</xsl:for-each>
|
8106
|
+
<xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
|
8107
|
+
<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
|
8108
|
+
<xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
|
8109
|
+
<attachment filename="{$attachment_path}"/>
|
8110
|
+
</xsl:for-each>
|
8111
|
+
</xsl:if>
|
8106
8112
|
</xsl:variable>
|
8107
8113
|
<xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
|
8108
8114
|
|
@@ -8115,7 +8121,7 @@
|
|
8115
8121
|
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
8116
8122
|
</xsl:when>
|
8117
8123
|
<!-- link to the PDF attachment -->
|
8118
|
-
<xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
|
8124
|
+
<xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
|
8119
8125
|
<xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
|
8120
8126
|
</xsl:when>
|
8121
8127
|
<!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
|
@@ -8770,7 +8776,16 @@
|
|
8770
8776
|
</xsl:variable>
|
8771
8777
|
<xsl:variable name="img_src">
|
8772
8778
|
<xsl:choose>
|
8773
|
-
<xsl:when test="not(starts-with(@src, 'data:'))"
|
8779
|
+
<xsl:when test="not(starts-with(@src, 'data:'))">
|
8780
|
+
<xsl:choose>
|
8781
|
+
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
|
8782
|
+
<xsl:value-of select="@src"/>
|
8783
|
+
</xsl:when>
|
8784
|
+
<xsl:otherwise>
|
8785
|
+
<xsl:value-of select="concat($basepath, @src)"/>
|
8786
|
+
</xsl:otherwise>
|
8787
|
+
</xsl:choose>
|
8788
|
+
</xsl:when>
|
8774
8789
|
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
|
8775
8790
|
</xsl:choose>
|
8776
8791
|
</xsl:variable>
|
@@ -8783,7 +8798,7 @@
|
|
8783
8798
|
<!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
|
8784
8799
|
<xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
|
8785
8800
|
<xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
|
8786
|
-
<xsl:variable name="scale" select="java:org.metanorma.fop.
|
8801
|
+
<xsl:variable name="scale" select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
|
8787
8802
|
<xsl:value-of select="$scale"/>
|
8788
8803
|
</xsl:template>
|
8789
8804
|
|
@@ -8802,7 +8817,14 @@
|
|
8802
8817
|
<xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
|
8803
8818
|
</xsl:when>
|
8804
8819
|
<xsl:when test="not(starts-with(@src, 'data:'))">
|
8805
|
-
<xsl:
|
8820
|
+
<xsl:choose>
|
8821
|
+
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
|
8822
|
+
<xsl:value-of select="concat('url(file:///', @src, ')')"/>
|
8823
|
+
</xsl:when>
|
8824
|
+
<xsl:otherwise>
|
8825
|
+
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
|
8826
|
+
</xsl:otherwise>
|
8827
|
+
</xsl:choose>
|
8806
8828
|
</xsl:when>
|
8807
8829
|
<xsl:otherwise>
|
8808
8830
|
<xsl:value-of select="@src"/>
|
@@ -8824,7 +8846,14 @@
|
|
8824
8846
|
</xsl:when>
|
8825
8847
|
<xsl:when test="not(starts-with(@src, 'data:'))">
|
8826
8848
|
<xsl:variable name="src">
|
8827
|
-
<xsl:
|
8849
|
+
<xsl:choose>
|
8850
|
+
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
|
8851
|
+
<xsl:value-of select="concat('url(file:///', @src, ')')"/>
|
8852
|
+
</xsl:when>
|
8853
|
+
<xsl:otherwise>
|
8854
|
+
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
|
8855
|
+
</xsl:otherwise>
|
8856
|
+
</xsl:choose>
|
8828
8857
|
</xsl:variable>
|
8829
8858
|
<xsl:variable name="file" select="java:java.io.File.new(@src)"/>
|
8830
8859
|
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
|
@@ -13659,26 +13688,37 @@
|
|
13659
13688
|
</x:xmpmeta>
|
13660
13689
|
<!-- add attachments -->
|
13661
13690
|
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
13662
|
-
<xsl:
|
13663
|
-
|
13664
|
-
|
13665
|
-
|
13666
|
-
|
13667
|
-
|
13668
|
-
|
13669
|
-
|
13670
|
-
|
13671
|
-
|
13672
|
-
|
13673
|
-
|
13691
|
+
<xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
|
13692
|
+
|
13693
|
+
<pdf:embedded-file filename="{@name}">
|
13694
|
+
<xsl:attribute name="src">
|
13695
|
+
<xsl:choose>
|
13696
|
+
<xsl:when test="normalize-space() != ''">
|
13697
|
+
<xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'( | | )', '')"/> <!-- remove line breaks -->
|
13698
|
+
<xsl:value-of select="$src_attachment"/>
|
13699
|
+
</xsl:when>
|
13700
|
+
<xsl:otherwise>
|
13701
|
+
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
|
13702
|
+
<xsl:value-of select="$url"/>
|
13703
|
+
</xsl:otherwise>
|
13704
|
+
</xsl:choose>
|
13705
|
+
</xsl:attribute>
|
13706
|
+
<xsl:if test="$description != ''">
|
13707
|
+
<xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
|
13708
|
+
</xsl:if>
|
13709
|
+
</pdf:embedded-file>
|
13674
13710
|
</xsl:for-each>
|
13675
13711
|
<!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
|
13676
13712
|
<xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
|
13677
13713
|
<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
|
13678
13714
|
<xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
|
13679
|
-
<xsl:variable name="url" select="concat('url(file:///',$
|
13680
|
-
<xsl:variable name="
|
13681
|
-
<pdf:embedded-file src="{$url}" filename="{$
|
13715
|
+
<xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
|
13716
|
+
<xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
|
13717
|
+
<pdf:embedded-file src="{$url}" filename="{$attachment_path}">
|
13718
|
+
<xsl:if test="$description != ''">
|
13719
|
+
<xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
|
13720
|
+
</xsl:if>
|
13721
|
+
</pdf:embedded-file>
|
13682
13722
|
</xsl:for-each>
|
13683
13723
|
</xsl:if>
|
13684
13724
|
</xsl:template> <!-- addPDFUAmeta -->
|
@@ -14056,7 +14096,14 @@
|
|
14056
14096
|
<xsl:value-of select="$src"/>
|
14057
14097
|
</xsl:when>
|
14058
14098
|
<xsl:otherwise>
|
14059
|
-
<xsl:
|
14099
|
+
<xsl:choose>
|
14100
|
+
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
|
14101
|
+
<xsl:value-of select="concat('url(file:///', @src, ')')"/>
|
14102
|
+
</xsl:when>
|
14103
|
+
<xsl:otherwise>
|
14104
|
+
<xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
|
14105
|
+
</xsl:otherwise>
|
14106
|
+
</xsl:choose>
|
14060
14107
|
</xsl:otherwise>
|
14061
14108
|
</xsl:choose>
|
14062
14109
|
</xsl:template>
|
@@ -8103,6 +8103,12 @@
|
|
8103
8103
|
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
8104
8104
|
<attachment filename="{@name}"/>
|
8105
8105
|
</xsl:for-each>
|
8106
|
+
<xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
|
8107
|
+
<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
|
8108
|
+
<xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
|
8109
|
+
<attachment filename="{$attachment_path}"/>
|
8110
|
+
</xsl:for-each>
|
8111
|
+
</xsl:if>
|
8106
8112
|
</xsl:variable>
|
8107
8113
|
<xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
|
8108
8114
|
|
@@ -8115,7 +8121,7 @@
|
|
8115
8121
|
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
8116
8122
|
</xsl:when>
|
8117
8123
|
<!-- link to the PDF attachment -->
|
8118
|
-
<xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
|
8124
|
+
<xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
|
8119
8125
|
<xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
|
8120
8126
|
</xsl:when>
|
8121
8127
|
<!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
|
@@ -8770,7 +8776,16 @@
|
|
8770
8776
|
</xsl:variable>
|
8771
8777
|
<xsl:variable name="img_src">
|
8772
8778
|
<xsl:choose>
|
8773
|
-
<xsl:when test="not(starts-with(@src, 'data:'))"
|
8779
|
+
<xsl:when test="not(starts-with(@src, 'data:'))">
|
8780
|
+
<xsl:choose>
|
8781
|
+
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
|
8782
|
+
<xsl:value-of select="@src"/>
|
8783
|
+
</xsl:when>
|
8784
|
+
<xsl:otherwise>
|
8785
|
+
<xsl:value-of select="concat($basepath, @src)"/>
|
8786
|
+
</xsl:otherwise>
|
8787
|
+
</xsl:choose>
|
8788
|
+
</xsl:when>
|
8774
8789
|
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
|
8775
8790
|
</xsl:choose>
|
8776
8791
|
</xsl:variable>
|
@@ -8783,7 +8798,7 @@
|
|
8783
8798
|
<!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
|
8784
8799
|
<xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
|
8785
8800
|
<xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
|
8786
|
-
<xsl:variable name="scale" select="java:org.metanorma.fop.
|
8801
|
+
<xsl:variable name="scale" select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
|
8787
8802
|
<xsl:value-of select="$scale"/>
|
8788
8803
|
</xsl:template>
|
8789
8804
|
|
@@ -8802,7 +8817,14 @@
|
|
8802
8817
|
<xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
|
8803
8818
|
</xsl:when>
|
8804
8819
|
<xsl:when test="not(starts-with(@src, 'data:'))">
|
8805
|
-
<xsl:
|
8820
|
+
<xsl:choose>
|
8821
|
+
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
|
8822
|
+
<xsl:value-of select="concat('url(file:///', @src, ')')"/>
|
8823
|
+
</xsl:when>
|
8824
|
+
<xsl:otherwise>
|
8825
|
+
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
|
8826
|
+
</xsl:otherwise>
|
8827
|
+
</xsl:choose>
|
8806
8828
|
</xsl:when>
|
8807
8829
|
<xsl:otherwise>
|
8808
8830
|
<xsl:value-of select="@src"/>
|
@@ -8824,7 +8846,14 @@
|
|
8824
8846
|
</xsl:when>
|
8825
8847
|
<xsl:when test="not(starts-with(@src, 'data:'))">
|
8826
8848
|
<xsl:variable name="src">
|
8827
|
-
<xsl:
|
8849
|
+
<xsl:choose>
|
8850
|
+
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
|
8851
|
+
<xsl:value-of select="concat('url(file:///', @src, ')')"/>
|
8852
|
+
</xsl:when>
|
8853
|
+
<xsl:otherwise>
|
8854
|
+
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
|
8855
|
+
</xsl:otherwise>
|
8856
|
+
</xsl:choose>
|
8828
8857
|
</xsl:variable>
|
8829
8858
|
<xsl:variable name="file" select="java:java.io.File.new(@src)"/>
|
8830
8859
|
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
|
@@ -13659,26 +13688,37 @@
|
|
13659
13688
|
</x:xmpmeta>
|
13660
13689
|
<!-- add attachments -->
|
13661
13690
|
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
13662
|
-
<xsl:
|
13663
|
-
|
13664
|
-
|
13665
|
-
|
13666
|
-
|
13667
|
-
|
13668
|
-
|
13669
|
-
|
13670
|
-
|
13671
|
-
|
13672
|
-
|
13673
|
-
|
13691
|
+
<xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
|
13692
|
+
|
13693
|
+
<pdf:embedded-file filename="{@name}">
|
13694
|
+
<xsl:attribute name="src">
|
13695
|
+
<xsl:choose>
|
13696
|
+
<xsl:when test="normalize-space() != ''">
|
13697
|
+
<xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'( | | )', '')"/> <!-- remove line breaks -->
|
13698
|
+
<xsl:value-of select="$src_attachment"/>
|
13699
|
+
</xsl:when>
|
13700
|
+
<xsl:otherwise>
|
13701
|
+
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
|
13702
|
+
<xsl:value-of select="$url"/>
|
13703
|
+
</xsl:otherwise>
|
13704
|
+
</xsl:choose>
|
13705
|
+
</xsl:attribute>
|
13706
|
+
<xsl:if test="$description != ''">
|
13707
|
+
<xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
|
13708
|
+
</xsl:if>
|
13709
|
+
</pdf:embedded-file>
|
13674
13710
|
</xsl:for-each>
|
13675
13711
|
<!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
|
13676
13712
|
<xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
|
13677
13713
|
<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
|
13678
13714
|
<xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
|
13679
|
-
<xsl:variable name="url" select="concat('url(file:///',$
|
13680
|
-
<xsl:variable name="
|
13681
|
-
<pdf:embedded-file src="{$url}" filename="{$
|
13715
|
+
<xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
|
13716
|
+
<xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
|
13717
|
+
<pdf:embedded-file src="{$url}" filename="{$attachment_path}">
|
13718
|
+
<xsl:if test="$description != ''">
|
13719
|
+
<xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
|
13720
|
+
</xsl:if>
|
13721
|
+
</pdf:embedded-file>
|
13682
13722
|
</xsl:for-each>
|
13683
13723
|
</xsl:if>
|
13684
13724
|
</xsl:template> <!-- addPDFUAmeta -->
|
@@ -14056,7 +14096,14 @@
|
|
14056
14096
|
<xsl:value-of select="$src"/>
|
14057
14097
|
</xsl:when>
|
14058
14098
|
<xsl:otherwise>
|
14059
|
-
<xsl:
|
14099
|
+
<xsl:choose>
|
14100
|
+
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
|
14101
|
+
<xsl:value-of select="concat('url(file:///', @src, ')')"/>
|
14102
|
+
</xsl:when>
|
14103
|
+
<xsl:otherwise>
|
14104
|
+
<xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
|
14105
|
+
</xsl:otherwise>
|
14106
|
+
</xsl:choose>
|
14060
14107
|
</xsl:otherwise>
|
14061
14108
|
</xsl:choose>
|
14062
14109
|
</xsl:template>
|
@@ -8103,6 +8103,12 @@
|
|
8103
8103
|
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
8104
8104
|
<attachment filename="{@name}"/>
|
8105
8105
|
</xsl:for-each>
|
8106
|
+
<xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
|
8107
|
+
<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
|
8108
|
+
<xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
|
8109
|
+
<attachment filename="{$attachment_path}"/>
|
8110
|
+
</xsl:for-each>
|
8111
|
+
</xsl:if>
|
8106
8112
|
</xsl:variable>
|
8107
8113
|
<xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
|
8108
8114
|
|
@@ -8115,7 +8121,7 @@
|
|
8115
8121
|
<xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
|
8116
8122
|
</xsl:when>
|
8117
8123
|
<!-- link to the PDF attachment -->
|
8118
|
-
<xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
|
8124
|
+
<xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
|
8119
8125
|
<xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
|
8120
8126
|
</xsl:when>
|
8121
8127
|
<!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
|
@@ -8770,7 +8776,16 @@
|
|
8770
8776
|
</xsl:variable>
|
8771
8777
|
<xsl:variable name="img_src">
|
8772
8778
|
<xsl:choose>
|
8773
|
-
<xsl:when test="not(starts-with(@src, 'data:'))"
|
8779
|
+
<xsl:when test="not(starts-with(@src, 'data:'))">
|
8780
|
+
<xsl:choose>
|
8781
|
+
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
|
8782
|
+
<xsl:value-of select="@src"/>
|
8783
|
+
</xsl:when>
|
8784
|
+
<xsl:otherwise>
|
8785
|
+
<xsl:value-of select="concat($basepath, @src)"/>
|
8786
|
+
</xsl:otherwise>
|
8787
|
+
</xsl:choose>
|
8788
|
+
</xsl:when>
|
8774
8789
|
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
|
8775
8790
|
</xsl:choose>
|
8776
8791
|
</xsl:variable>
|
@@ -8783,7 +8798,7 @@
|
|
8783
8798
|
<!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
|
8784
8799
|
<xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
|
8785
8800
|
<xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
|
8786
|
-
<xsl:variable name="scale" select="java:org.metanorma.fop.
|
8801
|
+
<xsl:variable name="scale" select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
|
8787
8802
|
<xsl:value-of select="$scale"/>
|
8788
8803
|
</xsl:template>
|
8789
8804
|
|
@@ -8802,7 +8817,14 @@
|
|
8802
8817
|
<xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
|
8803
8818
|
</xsl:when>
|
8804
8819
|
<xsl:when test="not(starts-with(@src, 'data:'))">
|
8805
|
-
<xsl:
|
8820
|
+
<xsl:choose>
|
8821
|
+
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
|
8822
|
+
<xsl:value-of select="concat('url(file:///', @src, ')')"/>
|
8823
|
+
</xsl:when>
|
8824
|
+
<xsl:otherwise>
|
8825
|
+
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
|
8826
|
+
</xsl:otherwise>
|
8827
|
+
</xsl:choose>
|
8806
8828
|
</xsl:when>
|
8807
8829
|
<xsl:otherwise>
|
8808
8830
|
<xsl:value-of select="@src"/>
|
@@ -8824,7 +8846,14 @@
|
|
8824
8846
|
</xsl:when>
|
8825
8847
|
<xsl:when test="not(starts-with(@src, 'data:'))">
|
8826
8848
|
<xsl:variable name="src">
|
8827
|
-
<xsl:
|
8849
|
+
<xsl:choose>
|
8850
|
+
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
|
8851
|
+
<xsl:value-of select="concat('url(file:///', @src, ')')"/>
|
8852
|
+
</xsl:when>
|
8853
|
+
<xsl:otherwise>
|
8854
|
+
<xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
|
8855
|
+
</xsl:otherwise>
|
8856
|
+
</xsl:choose>
|
8828
8857
|
</xsl:variable>
|
8829
8858
|
<xsl:variable name="file" select="java:java.io.File.new(@src)"/>
|
8830
8859
|
<xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
|
@@ -13659,26 +13688,37 @@
|
|
13659
13688
|
</x:xmpmeta>
|
13660
13689
|
<!-- add attachments -->
|
13661
13690
|
<xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
|
13662
|
-
<xsl:
|
13663
|
-
|
13664
|
-
|
13665
|
-
|
13666
|
-
|
13667
|
-
|
13668
|
-
|
13669
|
-
|
13670
|
-
|
13671
|
-
|
13672
|
-
|
13673
|
-
|
13691
|
+
<xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
|
13692
|
+
|
13693
|
+
<pdf:embedded-file filename="{@name}">
|
13694
|
+
<xsl:attribute name="src">
|
13695
|
+
<xsl:choose>
|
13696
|
+
<xsl:when test="normalize-space() != ''">
|
13697
|
+
<xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'( | | )', '')"/> <!-- remove line breaks -->
|
13698
|
+
<xsl:value-of select="$src_attachment"/>
|
13699
|
+
</xsl:when>
|
13700
|
+
<xsl:otherwise>
|
13701
|
+
<xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
|
13702
|
+
<xsl:value-of select="$url"/>
|
13703
|
+
</xsl:otherwise>
|
13704
|
+
</xsl:choose>
|
13705
|
+
</xsl:attribute>
|
13706
|
+
<xsl:if test="$description != ''">
|
13707
|
+
<xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
|
13708
|
+
</xsl:if>
|
13709
|
+
</pdf:embedded-file>
|
13674
13710
|
</xsl:for-each>
|
13675
13711
|
<!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
|
13676
13712
|
<xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
|
13677
13713
|
<xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
|
13678
13714
|
<xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
|
13679
|
-
<xsl:variable name="url" select="concat('url(file:///',$
|
13680
|
-
<xsl:variable name="
|
13681
|
-
<pdf:embedded-file src="{$url}" filename="{$
|
13715
|
+
<xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
|
13716
|
+
<xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
|
13717
|
+
<pdf:embedded-file src="{$url}" filename="{$attachment_path}">
|
13718
|
+
<xsl:if test="$description != ''">
|
13719
|
+
<xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
|
13720
|
+
</xsl:if>
|
13721
|
+
</pdf:embedded-file>
|
13682
13722
|
</xsl:for-each>
|
13683
13723
|
</xsl:if>
|
13684
13724
|
</xsl:template> <!-- addPDFUAmeta -->
|
@@ -14056,7 +14096,14 @@
|
|
14056
14096
|
<xsl:value-of select="$src"/>
|
14057
14097
|
</xsl:when>
|
14058
14098
|
<xsl:otherwise>
|
14059
|
-
<xsl:
|
14099
|
+
<xsl:choose>
|
14100
|
+
<xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
|
14101
|
+
<xsl:value-of select="concat('url(file:///', @src, ')')"/>
|
14102
|
+
</xsl:when>
|
14103
|
+
<xsl:otherwise>
|
14104
|
+
<xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
|
14105
|
+
</xsl:otherwise>
|
14106
|
+
</xsl:choose>
|
14060
14107
|
</xsl:otherwise>
|
14061
14108
|
</xsl:choose>
|
14062
14109
|
</xsl:template>
|