metanorma-ogc 2.6.0 → 2.6.2

Sign up to get free protection for your applications and to get access to all the features.
@@ -817,7 +817,7 @@
817
817
  <xsl:choose>
818
818
  <xsl:when test="@level = 1">
819
819
  <fo:list-block provisional-distance-between-starts="8mm">
820
- <xsl:if test="@type = 'annex'">
820
+ <xsl:if test="@type = 'annex' or (@type = 'references' and normalize-space(@section) = '')">
821
821
  <xsl:attribute name="provisional-distance-between-starts">0mm</xsl:attribute>
822
822
  </xsl:if>
823
823
  <fo:list-item>
@@ -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:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
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.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
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:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
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:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
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)"/>
@@ -13608,6 +13637,39 @@
13608
13637
  </pdf:catalog>
13609
13638
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
13610
13639
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
13640
+ <rdf:Description xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/" xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#" xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#" rdf:about="">
13641
+ <pdfaExtension:schemas>
13642
+ <rdf:Bag>
13643
+ <rdf:li rdf:parseType="Resource">
13644
+ <pdfaSchema:namespaceURI>http://www.aiim.org/pdfua/ns/id/</pdfaSchema:namespaceURI>
13645
+ <pdfaSchema:prefix>pdfuaid</pdfaSchema:prefix>
13646
+ <pdfaSchema:schema>PDF/UA identification schema</pdfaSchema:schema>
13647
+ <pdfaSchema:property>
13648
+ <rdf:Seq>
13649
+ <rdf:li rdf:parseType="Resource">
13650
+ <pdfaProperty:category>internal</pdfaProperty:category>
13651
+ <pdfaProperty:description>PDF/UA version identifier</pdfaProperty:description>
13652
+ <pdfaProperty:name>part</pdfaProperty:name>
13653
+ <pdfaProperty:valueType>Integer</pdfaProperty:valueType>
13654
+ </rdf:li>
13655
+ <rdf:li rdf:parseType="Resource">
13656
+ <pdfaProperty:category>internal</pdfaProperty:category>
13657
+ <pdfaProperty:description>PDF/UA amendment identifier</pdfaProperty:description>
13658
+ <pdfaProperty:name>amd</pdfaProperty:name>
13659
+ <pdfaProperty:valueType>Text</pdfaProperty:valueType>
13660
+ </rdf:li>
13661
+ <rdf:li rdf:parseType="Resource">
13662
+ <pdfaProperty:category>internal</pdfaProperty:category>
13663
+ <pdfaProperty:description>PDF/UA corrigenda identifier</pdfaProperty:description>
13664
+ <pdfaProperty:name>corr</pdfaProperty:name>
13665
+ <pdfaProperty:valueType>Text</pdfaProperty:valueType>
13666
+ </rdf:li>
13667
+ </rdf:Seq>
13668
+ </pdfaSchema:property>
13669
+ </rdf:li>
13670
+ </rdf:Bag>
13671
+ </pdfaExtension:schemas>
13672
+ </rdf:Description>
13611
13673
  <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
13612
13674
  <!-- Dublin Core properties go here -->
13613
13675
  <dc:title>
@@ -13618,33 +13680,57 @@
13618
13680
 
13619
13681
  </xsl:for-each>
13620
13682
  </xsl:variable>
13621
- <xsl:choose>
13622
- <xsl:when test="normalize-space($title) != ''">
13623
- <xsl:value-of select="$title"/>
13624
- </xsl:when>
13625
- <xsl:otherwise>
13626
- <xsl:text> </xsl:text>
13627
- </xsl:otherwise>
13628
- </xsl:choose>
13683
+ <rdf:Alt>
13684
+ <rdf:li xml:lang="x-default">
13685
+ <xsl:choose>
13686
+ <xsl:when test="normalize-space($title) != ''">
13687
+ <xsl:value-of select="$title"/>
13688
+ </xsl:when>
13689
+ <xsl:otherwise>
13690
+ <xsl:text> </xsl:text>
13691
+ </xsl:otherwise>
13692
+ </xsl:choose>
13693
+ </rdf:li>
13694
+ </rdf:Alt>
13629
13695
  </dc:title>
13630
- <dc:creator>
13696
+ <xsl:variable name="dc_creator">
13631
13697
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
13632
13698
 
13633
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
13634
- <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
13635
- <xsl:if test="position() != last()">; </xsl:if>
13636
- </xsl:for-each>
13699
+ <rdf:Seq>
13700
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
13701
+ <rdf:li>
13702
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
13703
+ </rdf:li>
13704
+ <!-- <xsl:if test="position() != last()">; </xsl:if> -->
13705
+ </xsl:for-each>
13706
+ </rdf:Seq>
13637
13707
 
13638
13708
  </xsl:for-each>
13639
- </dc:creator>
13640
- <dc:description>
13709
+ </xsl:variable>
13710
+ <xsl:if test="normalize-space($dc_creator) != ''">
13711
+ <dc:creator>
13712
+ <xsl:copy-of select="$dc_creator"/>
13713
+ </dc:creator>
13714
+ </xsl:if>
13715
+
13716
+ <xsl:variable name="dc_description">
13641
13717
  <xsl:variable name="abstract">
13642
13718
 
13643
13719
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'title'])]"/>
13644
13720
 
13645
13721
  </xsl:variable>
13646
- <xsl:value-of select="normalize-space($abstract)"/>
13647
- </dc:description>
13722
+ <rdf:Alt>
13723
+ <rdf:li xml:lang="x-default">
13724
+ <xsl:value-of select="normalize-space($abstract)"/>
13725
+ </rdf:li>
13726
+ </rdf:Alt>
13727
+ </xsl:variable>
13728
+ <xsl:if test="normalize-space($dc_description)">
13729
+ <dc:description>
13730
+ <xsl:copy-of select="$dc_description"/>
13731
+ </dc:description>
13732
+ </xsl:if>
13733
+
13648
13734
  <pdf:Keywords>
13649
13735
  <xsl:call-template name="insertKeywords">
13650
13736
  <xsl:with-param name="meta">true</xsl:with-param>
@@ -13659,26 +13745,37 @@
13659
13745
  </x:xmpmeta>
13660
13746
  <!-- add attachments -->
13661
13747
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
13662
- <xsl:choose>
13663
- <xsl:when test="normalize-space() != ''">
13664
- <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
13665
- <pdf:embedded-file src="{$src_attachment}" filename="{@name}"/>
13666
- </xsl:when>
13667
- <xsl:otherwise>
13668
- <!-- _{filename}_attachments -->
13669
- <!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
13670
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
13671
- <pdf:embedded-file src="{$url}" filename="{@name}"/>
13672
- </xsl:otherwise>
13673
- </xsl:choose>
13748
+ <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
13749
+
13750
+ <pdf:embedded-file filename="{@name}">
13751
+ <xsl:attribute name="src">
13752
+ <xsl:choose>
13753
+ <xsl:when test="normalize-space() != ''">
13754
+ <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
13755
+ <xsl:value-of select="$src_attachment"/>
13756
+ </xsl:when>
13757
+ <xsl:otherwise>
13758
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
13759
+ <xsl:value-of select="$url"/>
13760
+ </xsl:otherwise>
13761
+ </xsl:choose>
13762
+ </xsl:attribute>
13763
+ <xsl:if test="$description != ''">
13764
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
13765
+ </xsl:if>
13766
+ </pdf:embedded-file>
13674
13767
  </xsl:for-each>
13675
13768
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
13676
13769
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
13677
13770
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
13678
13771
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
13679
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, $attachment_path, ')')"/>
13680
- <xsl:variable name="filename_embedded" select="substring-after($attachment_path, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
13681
- <pdf:embedded-file src="{$url}" filename="{$filename_embedded}"/>
13772
+ <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
13773
+ <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
13774
+ <pdf:embedded-file src="{$url}" filename="{$attachment_path}">
13775
+ <xsl:if test="$description != ''">
13776
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
13777
+ </xsl:if>
13778
+ </pdf:embedded-file>
13682
13779
  </xsl:for-each>
13683
13780
  </xsl:if>
13684
13781
  </xsl:template> <!-- addPDFUAmeta -->
@@ -14056,7 +14153,14 @@
14056
14153
  <xsl:value-of select="$src"/>
14057
14154
  </xsl:when>
14058
14155
  <xsl:otherwise>
14059
- <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
14156
+ <xsl:choose>
14157
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
14158
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
14159
+ </xsl:when>
14160
+ <xsl:otherwise>
14161
+ <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
14162
+ </xsl:otherwise>
14163
+ </xsl:choose>
14060
14164
  </xsl:otherwise>
14061
14165
  </xsl:choose>
14062
14166
  </xsl:template>
@@ -817,7 +817,7 @@
817
817
  <xsl:choose>
818
818
  <xsl:when test="@level = 1">
819
819
  <fo:list-block provisional-distance-between-starts="8mm">
820
- <xsl:if test="@type = 'annex'">
820
+ <xsl:if test="@type = 'annex' or (@type = 'references' and normalize-space(@section) = '')">
821
821
  <xsl:attribute name="provisional-distance-between-starts">0mm</xsl:attribute>
822
822
  </xsl:if>
823
823
  <fo:list-item>
@@ -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:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
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.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
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:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
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:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
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)"/>
@@ -13608,6 +13637,39 @@
13608
13637
  </pdf:catalog>
13609
13638
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
13610
13639
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
13640
+ <rdf:Description xmlns:pdfaExtension="http://www.aiim.org/pdfa/ns/extension/" xmlns:pdfaProperty="http://www.aiim.org/pdfa/ns/property#" xmlns:pdfaSchema="http://www.aiim.org/pdfa/ns/schema#" rdf:about="">
13641
+ <pdfaExtension:schemas>
13642
+ <rdf:Bag>
13643
+ <rdf:li rdf:parseType="Resource">
13644
+ <pdfaSchema:namespaceURI>http://www.aiim.org/pdfua/ns/id/</pdfaSchema:namespaceURI>
13645
+ <pdfaSchema:prefix>pdfuaid</pdfaSchema:prefix>
13646
+ <pdfaSchema:schema>PDF/UA identification schema</pdfaSchema:schema>
13647
+ <pdfaSchema:property>
13648
+ <rdf:Seq>
13649
+ <rdf:li rdf:parseType="Resource">
13650
+ <pdfaProperty:category>internal</pdfaProperty:category>
13651
+ <pdfaProperty:description>PDF/UA version identifier</pdfaProperty:description>
13652
+ <pdfaProperty:name>part</pdfaProperty:name>
13653
+ <pdfaProperty:valueType>Integer</pdfaProperty:valueType>
13654
+ </rdf:li>
13655
+ <rdf:li rdf:parseType="Resource">
13656
+ <pdfaProperty:category>internal</pdfaProperty:category>
13657
+ <pdfaProperty:description>PDF/UA amendment identifier</pdfaProperty:description>
13658
+ <pdfaProperty:name>amd</pdfaProperty:name>
13659
+ <pdfaProperty:valueType>Text</pdfaProperty:valueType>
13660
+ </rdf:li>
13661
+ <rdf:li rdf:parseType="Resource">
13662
+ <pdfaProperty:category>internal</pdfaProperty:category>
13663
+ <pdfaProperty:description>PDF/UA corrigenda identifier</pdfaProperty:description>
13664
+ <pdfaProperty:name>corr</pdfaProperty:name>
13665
+ <pdfaProperty:valueType>Text</pdfaProperty:valueType>
13666
+ </rdf:li>
13667
+ </rdf:Seq>
13668
+ </pdfaSchema:property>
13669
+ </rdf:li>
13670
+ </rdf:Bag>
13671
+ </pdfaExtension:schemas>
13672
+ </rdf:Description>
13611
13673
  <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
13612
13674
  <!-- Dublin Core properties go here -->
13613
13675
  <dc:title>
@@ -13618,33 +13680,57 @@
13618
13680
 
13619
13681
  </xsl:for-each>
13620
13682
  </xsl:variable>
13621
- <xsl:choose>
13622
- <xsl:when test="normalize-space($title) != ''">
13623
- <xsl:value-of select="$title"/>
13624
- </xsl:when>
13625
- <xsl:otherwise>
13626
- <xsl:text> </xsl:text>
13627
- </xsl:otherwise>
13628
- </xsl:choose>
13683
+ <rdf:Alt>
13684
+ <rdf:li xml:lang="x-default">
13685
+ <xsl:choose>
13686
+ <xsl:when test="normalize-space($title) != ''">
13687
+ <xsl:value-of select="$title"/>
13688
+ </xsl:when>
13689
+ <xsl:otherwise>
13690
+ <xsl:text> </xsl:text>
13691
+ </xsl:otherwise>
13692
+ </xsl:choose>
13693
+ </rdf:li>
13694
+ </rdf:Alt>
13629
13695
  </dc:title>
13630
- <dc:creator>
13696
+ <xsl:variable name="dc_creator">
13631
13697
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
13632
13698
 
13633
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
13634
- <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
13635
- <xsl:if test="position() != last()">; </xsl:if>
13636
- </xsl:for-each>
13699
+ <rdf:Seq>
13700
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
13701
+ <rdf:li>
13702
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
13703
+ </rdf:li>
13704
+ <!-- <xsl:if test="position() != last()">; </xsl:if> -->
13705
+ </xsl:for-each>
13706
+ </rdf:Seq>
13637
13707
 
13638
13708
  </xsl:for-each>
13639
- </dc:creator>
13640
- <dc:description>
13709
+ </xsl:variable>
13710
+ <xsl:if test="normalize-space($dc_creator) != ''">
13711
+ <dc:creator>
13712
+ <xsl:copy-of select="$dc_creator"/>
13713
+ </dc:creator>
13714
+ </xsl:if>
13715
+
13716
+ <xsl:variable name="dc_description">
13641
13717
  <xsl:variable name="abstract">
13642
13718
 
13643
13719
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'title'])]"/>
13644
13720
 
13645
13721
  </xsl:variable>
13646
- <xsl:value-of select="normalize-space($abstract)"/>
13647
- </dc:description>
13722
+ <rdf:Alt>
13723
+ <rdf:li xml:lang="x-default">
13724
+ <xsl:value-of select="normalize-space($abstract)"/>
13725
+ </rdf:li>
13726
+ </rdf:Alt>
13727
+ </xsl:variable>
13728
+ <xsl:if test="normalize-space($dc_description)">
13729
+ <dc:description>
13730
+ <xsl:copy-of select="$dc_description"/>
13731
+ </dc:description>
13732
+ </xsl:if>
13733
+
13648
13734
  <pdf:Keywords>
13649
13735
  <xsl:call-template name="insertKeywords">
13650
13736
  <xsl:with-param name="meta">true</xsl:with-param>
@@ -13659,26 +13745,37 @@
13659
13745
  </x:xmpmeta>
13660
13746
  <!-- add attachments -->
13661
13747
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
13662
- <xsl:choose>
13663
- <xsl:when test="normalize-space() != ''">
13664
- <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
13665
- <pdf:embedded-file src="{$src_attachment}" filename="{@name}"/>
13666
- </xsl:when>
13667
- <xsl:otherwise>
13668
- <!-- _{filename}_attachments -->
13669
- <!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
13670
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
13671
- <pdf:embedded-file src="{$url}" filename="{@name}"/>
13672
- </xsl:otherwise>
13673
- </xsl:choose>
13748
+ <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
13749
+
13750
+ <pdf:embedded-file filename="{@name}">
13751
+ <xsl:attribute name="src">
13752
+ <xsl:choose>
13753
+ <xsl:when test="normalize-space() != ''">
13754
+ <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
13755
+ <xsl:value-of select="$src_attachment"/>
13756
+ </xsl:when>
13757
+ <xsl:otherwise>
13758
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
13759
+ <xsl:value-of select="$url"/>
13760
+ </xsl:otherwise>
13761
+ </xsl:choose>
13762
+ </xsl:attribute>
13763
+ <xsl:if test="$description != ''">
13764
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
13765
+ </xsl:if>
13766
+ </pdf:embedded-file>
13674
13767
  </xsl:for-each>
13675
13768
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
13676
13769
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
13677
13770
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
13678
13771
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
13679
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, $attachment_path, ')')"/>
13680
- <xsl:variable name="filename_embedded" select="substring-after($attachment_path, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
13681
- <pdf:embedded-file src="{$url}" filename="{$filename_embedded}"/>
13772
+ <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
13773
+ <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
13774
+ <pdf:embedded-file src="{$url}" filename="{$attachment_path}">
13775
+ <xsl:if test="$description != ''">
13776
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
13777
+ </xsl:if>
13778
+ </pdf:embedded-file>
13682
13779
  </xsl:for-each>
13683
13780
  </xsl:if>
13684
13781
  </xsl:template> <!-- addPDFUAmeta -->
@@ -14056,7 +14153,14 @@
14056
14153
  <xsl:value-of select="$src"/>
14057
14154
  </xsl:when>
14058
14155
  <xsl:otherwise>
14059
- <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
14156
+ <xsl:choose>
14157
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
14158
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
14159
+ </xsl:when>
14160
+ <xsl:otherwise>
14161
+ <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
14162
+ </xsl:otherwise>
14163
+ </xsl:choose>
14060
14164
  </xsl:otherwise>
14061
14165
  </xsl:choose>
14062
14166
  </xsl:template>