metanorma-bipm 2.5.0 → 2.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6e64338ce855335c62f1d91866164719bc27d51fba3da87c05a0a2742fd616f1
4
- data.tar.gz: 2a0b624bf5af319f0b6d07a722c2cc8548ea94d08ae51afb1251de6219ad7bd5
3
+ metadata.gz: 383bf45f87ea65566e738977584c76a596ce22c419a58aa571f4bffab61c06ae
4
+ data.tar.gz: dcf5f78ced811ad1bf65ac8fd41c6c35bfe71310baa1d922ed587694d29ddaa7
5
5
  SHA512:
6
- metadata.gz: a6f425f80f2b93e33ae13331e3fd808f7a25f81621d54c2af65377457173621c03598886c54f0982105e44f60f1506cb40b4c7bcce76226aacb5934569808236
7
- data.tar.gz: 1bd5e4718c7e410f270c3f23d66204c0b174725b23eb467b55acc38b619066fff62e19ea28e382984558120bbaa9f0ff7349f47caf0c6d404d130ba0cfc59932
6
+ metadata.gz: b74015cf3c36fbba63afb772b18898cdb5f6c44176f8ceaba504f8966e3be23d58c5a68e5fe048dcad41773d38bb605f74dd676c70a99ac8c3a016b9635c67f3
7
+ data.tar.gz: 3b11a266828af1d89b41cd261f4c1270430067b4b62f700ac952598900c4610646251c3586c98371cd2f6f37cc8d5334829413168483c4498724e291f6fd3a40
@@ -10025,6 +10025,12 @@
10025
10025
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
10026
10026
  <attachment filename="{@name}"/>
10027
10027
  </xsl:for-each>
10028
+ <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
10029
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
10030
+ <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
10031
+ <attachment filename="{$attachment_path}"/>
10032
+ </xsl:for-each>
10033
+ </xsl:if>
10028
10034
  </xsl:variable>
10029
10035
  <xsl:variable xmlns:redirect="http://xml.apache.org/xalan/redirect" name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
10030
10036
 
@@ -10037,7 +10043,7 @@
10037
10043
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
10038
10044
  </xsl:when>
10039
10045
  <!-- link to the PDF attachment -->
10040
- <xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
10046
+ <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
10041
10047
  <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
10042
10048
  </xsl:when>
10043
10049
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
@@ -10705,7 +10711,16 @@
10705
10711
  </xsl:variable>
10706
10712
  <xsl:variable name="img_src">
10707
10713
  <xsl:choose>
10708
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
10714
+ <xsl:when test="not(starts-with(@src, 'data:'))">
10715
+ <xsl:choose>
10716
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
10717
+ <xsl:value-of select="@src"/>
10718
+ </xsl:when>
10719
+ <xsl:otherwise>
10720
+ <xsl:value-of select="concat($basepath, @src)"/>
10721
+ </xsl:otherwise>
10722
+ </xsl:choose>
10723
+ </xsl:when>
10709
10724
  <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
10710
10725
  </xsl:choose>
10711
10726
  </xsl:variable>
@@ -10718,7 +10733,7 @@
10718
10733
  <!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
10719
10734
  <xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
10720
10735
  <xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
10721
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
10736
+ <xsl:variable name="scale" select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
10722
10737
  <xsl:value-of select="$scale"/>
10723
10738
  </xsl:template>
10724
10739
 
@@ -10737,7 +10752,14 @@
10737
10752
  <xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
10738
10753
  </xsl:when>
10739
10754
  <xsl:when test="not(starts-with(@src, 'data:'))">
10740
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
10755
+ <xsl:choose>
10756
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
10757
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
10758
+ </xsl:when>
10759
+ <xsl:otherwise>
10760
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
10761
+ </xsl:otherwise>
10762
+ </xsl:choose>
10741
10763
  </xsl:when>
10742
10764
  <xsl:otherwise>
10743
10765
  <xsl:value-of select="@src"/>
@@ -10759,7 +10781,14 @@
10759
10781
  </xsl:when>
10760
10782
  <xsl:when test="not(starts-with(@src, 'data:'))">
10761
10783
  <xsl:variable name="src">
10762
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
10784
+ <xsl:choose>
10785
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
10786
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
10787
+ </xsl:when>
10788
+ <xsl:otherwise>
10789
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
10790
+ </xsl:otherwise>
10791
+ </xsl:choose>
10763
10792
  </xsl:variable>
10764
10793
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
10765
10794
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
@@ -15505,6 +15534,39 @@
15505
15534
  </pdf:catalog>
15506
15535
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
15507
15536
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
15537
+ <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="">
15538
+ <pdfaExtension:schemas>
15539
+ <rdf:Bag>
15540
+ <rdf:li rdf:parseType="Resource">
15541
+ <pdfaSchema:namespaceURI>http://www.aiim.org/pdfua/ns/id/</pdfaSchema:namespaceURI>
15542
+ <pdfaSchema:prefix>pdfuaid</pdfaSchema:prefix>
15543
+ <pdfaSchema:schema>PDF/UA identification schema</pdfaSchema:schema>
15544
+ <pdfaSchema:property>
15545
+ <rdf:Seq>
15546
+ <rdf:li rdf:parseType="Resource">
15547
+ <pdfaProperty:category>internal</pdfaProperty:category>
15548
+ <pdfaProperty:description>PDF/UA version identifier</pdfaProperty:description>
15549
+ <pdfaProperty:name>part</pdfaProperty:name>
15550
+ <pdfaProperty:valueType>Integer</pdfaProperty:valueType>
15551
+ </rdf:li>
15552
+ <rdf:li rdf:parseType="Resource">
15553
+ <pdfaProperty:category>internal</pdfaProperty:category>
15554
+ <pdfaProperty:description>PDF/UA amendment identifier</pdfaProperty:description>
15555
+ <pdfaProperty:name>amd</pdfaProperty:name>
15556
+ <pdfaProperty:valueType>Text</pdfaProperty:valueType>
15557
+ </rdf:li>
15558
+ <rdf:li rdf:parseType="Resource">
15559
+ <pdfaProperty:category>internal</pdfaProperty:category>
15560
+ <pdfaProperty:description>PDF/UA corrigenda identifier</pdfaProperty:description>
15561
+ <pdfaProperty:name>corr</pdfaProperty:name>
15562
+ <pdfaProperty:valueType>Text</pdfaProperty:valueType>
15563
+ </rdf:li>
15564
+ </rdf:Seq>
15565
+ </pdfaSchema:property>
15566
+ </rdf:li>
15567
+ </rdf:Bag>
15568
+ </pdfaExtension:schemas>
15569
+ </rdf:Description>
15508
15570
  <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
15509
15571
  <!-- Dublin Core properties go here -->
15510
15572
  <dc:title>
@@ -15515,33 +15577,57 @@
15515
15577
 
15516
15578
  </xsl:for-each>
15517
15579
  </xsl:variable>
15518
- <xsl:choose>
15519
- <xsl:when test="normalize-space($title) != ''">
15520
- <xsl:value-of select="$title"/>
15521
- </xsl:when>
15522
- <xsl:otherwise>
15523
- <xsl:text> </xsl:text>
15524
- </xsl:otherwise>
15525
- </xsl:choose>
15580
+ <rdf:Alt>
15581
+ <rdf:li xml:lang="x-default">
15582
+ <xsl:choose>
15583
+ <xsl:when test="normalize-space($title) != ''">
15584
+ <xsl:value-of select="$title"/>
15585
+ </xsl:when>
15586
+ <xsl:otherwise>
15587
+ <xsl:text> </xsl:text>
15588
+ </xsl:otherwise>
15589
+ </xsl:choose>
15590
+ </rdf:li>
15591
+ </rdf:Alt>
15526
15592
  </dc:title>
15527
- <dc:creator>
15593
+ <xsl:variable name="dc_creator">
15528
15594
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
15529
15595
 
15530
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
15531
- <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
15532
- <xsl:if test="position() != last()">; </xsl:if>
15533
- </xsl:for-each>
15596
+ <rdf:Seq>
15597
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
15598
+ <rdf:li>
15599
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
15600
+ </rdf:li>
15601
+ <!-- <xsl:if test="position() != last()">; </xsl:if> -->
15602
+ </xsl:for-each>
15603
+ </rdf:Seq>
15534
15604
 
15535
15605
  </xsl:for-each>
15536
- </dc:creator>
15537
- <dc:description>
15606
+ </xsl:variable>
15607
+ <xsl:if test="normalize-space($dc_creator) != ''">
15608
+ <dc:creator>
15609
+ <xsl:copy-of select="$dc_creator"/>
15610
+ </dc:creator>
15611
+ </xsl:if>
15612
+
15613
+ <xsl:variable name="dc_description">
15538
15614
  <xsl:variable name="abstract">
15539
15615
 
15540
15616
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'title'])]"/>
15541
15617
 
15542
15618
  </xsl:variable>
15543
- <xsl:value-of select="normalize-space($abstract)"/>
15544
- </dc:description>
15619
+ <rdf:Alt>
15620
+ <rdf:li xml:lang="x-default">
15621
+ <xsl:value-of select="normalize-space($abstract)"/>
15622
+ </rdf:li>
15623
+ </rdf:Alt>
15624
+ </xsl:variable>
15625
+ <xsl:if test="normalize-space($dc_description)">
15626
+ <dc:description>
15627
+ <xsl:copy-of select="$dc_description"/>
15628
+ </dc:description>
15629
+ </xsl:if>
15630
+
15545
15631
  <pdf:Keywords>
15546
15632
  <xsl:call-template name="insertKeywords">
15547
15633
  <xsl:with-param name="meta">true</xsl:with-param>
@@ -15556,26 +15642,37 @@
15556
15642
  </x:xmpmeta>
15557
15643
  <!-- add attachments -->
15558
15644
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
15559
- <xsl:choose>
15560
- <xsl:when test="normalize-space() != ''">
15561
- <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
15562
- <pdf:embedded-file src="{$src_attachment}" filename="{@name}"/>
15563
- </xsl:when>
15564
- <xsl:otherwise>
15565
- <!-- _{filename}_attachments -->
15566
- <!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
15567
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
15568
- <pdf:embedded-file src="{$url}" filename="{@name}"/>
15569
- </xsl:otherwise>
15570
- </xsl:choose>
15645
+ <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
15646
+
15647
+ <pdf:embedded-file filename="{@name}">
15648
+ <xsl:attribute name="src">
15649
+ <xsl:choose>
15650
+ <xsl:when test="normalize-space() != ''">
15651
+ <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
15652
+ <xsl:value-of select="$src_attachment"/>
15653
+ </xsl:when>
15654
+ <xsl:otherwise>
15655
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
15656
+ <xsl:value-of select="$url"/>
15657
+ </xsl:otherwise>
15658
+ </xsl:choose>
15659
+ </xsl:attribute>
15660
+ <xsl:if test="$description != ''">
15661
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
15662
+ </xsl:if>
15663
+ </pdf:embedded-file>
15571
15664
  </xsl:for-each>
15572
15665
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
15573
15666
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
15574
15667
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
15575
15668
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
15576
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, $attachment_path, ')')"/>
15577
- <xsl:variable name="filename_embedded" select="substring-after($attachment_path, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
15578
- <pdf:embedded-file src="{$url}" filename="{$filename_embedded}"/>
15669
+ <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
15670
+ <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
15671
+ <pdf:embedded-file src="{$url}" filename="{$attachment_path}">
15672
+ <xsl:if test="$description != ''">
15673
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
15674
+ </xsl:if>
15675
+ </pdf:embedded-file>
15579
15676
  </xsl:for-each>
15580
15677
  </xsl:if>
15581
15678
  </xsl:template> <!-- addPDFUAmeta -->
@@ -15953,7 +16050,14 @@
15953
16050
  <xsl:value-of select="$src"/>
15954
16051
  </xsl:when>
15955
16052
  <xsl:otherwise>
15956
- <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
16053
+ <xsl:choose>
16054
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
16055
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
16056
+ </xsl:when>
16057
+ <xsl:otherwise>
16058
+ <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
16059
+ </xsl:otherwise>
16060
+ </xsl:choose>
15957
16061
  </xsl:otherwise>
15958
16062
  </xsl:choose>
15959
16063
  </xsl:template>
@@ -10025,6 +10025,12 @@
10025
10025
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
10026
10026
  <attachment filename="{@name}"/>
10027
10027
  </xsl:for-each>
10028
+ <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
10029
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
10030
+ <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
10031
+ <attachment filename="{$attachment_path}"/>
10032
+ </xsl:for-each>
10033
+ </xsl:if>
10028
10034
  </xsl:variable>
10029
10035
  <xsl:variable xmlns:redirect="http://xml.apache.org/xalan/redirect" name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
10030
10036
 
@@ -10037,7 +10043,7 @@
10037
10043
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
10038
10044
  </xsl:when>
10039
10045
  <!-- link to the PDF attachment -->
10040
- <xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
10046
+ <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
10041
10047
  <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
10042
10048
  </xsl:when>
10043
10049
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
@@ -10705,7 +10711,16 @@
10705
10711
  </xsl:variable>
10706
10712
  <xsl:variable name="img_src">
10707
10713
  <xsl:choose>
10708
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
10714
+ <xsl:when test="not(starts-with(@src, 'data:'))">
10715
+ <xsl:choose>
10716
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
10717
+ <xsl:value-of select="@src"/>
10718
+ </xsl:when>
10719
+ <xsl:otherwise>
10720
+ <xsl:value-of select="concat($basepath, @src)"/>
10721
+ </xsl:otherwise>
10722
+ </xsl:choose>
10723
+ </xsl:when>
10709
10724
  <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
10710
10725
  </xsl:choose>
10711
10726
  </xsl:variable>
@@ -10718,7 +10733,7 @@
10718
10733
  <!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
10719
10734
  <xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
10720
10735
  <xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
10721
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
10736
+ <xsl:variable name="scale" select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
10722
10737
  <xsl:value-of select="$scale"/>
10723
10738
  </xsl:template>
10724
10739
 
@@ -10737,7 +10752,14 @@
10737
10752
  <xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
10738
10753
  </xsl:when>
10739
10754
  <xsl:when test="not(starts-with(@src, 'data:'))">
10740
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
10755
+ <xsl:choose>
10756
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
10757
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
10758
+ </xsl:when>
10759
+ <xsl:otherwise>
10760
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
10761
+ </xsl:otherwise>
10762
+ </xsl:choose>
10741
10763
  </xsl:when>
10742
10764
  <xsl:otherwise>
10743
10765
  <xsl:value-of select="@src"/>
@@ -10759,7 +10781,14 @@
10759
10781
  </xsl:when>
10760
10782
  <xsl:when test="not(starts-with(@src, 'data:'))">
10761
10783
  <xsl:variable name="src">
10762
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
10784
+ <xsl:choose>
10785
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
10786
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
10787
+ </xsl:when>
10788
+ <xsl:otherwise>
10789
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
10790
+ </xsl:otherwise>
10791
+ </xsl:choose>
10763
10792
  </xsl:variable>
10764
10793
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
10765
10794
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
@@ -15505,6 +15534,39 @@
15505
15534
  </pdf:catalog>
15506
15535
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
15507
15536
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
15537
+ <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="">
15538
+ <pdfaExtension:schemas>
15539
+ <rdf:Bag>
15540
+ <rdf:li rdf:parseType="Resource">
15541
+ <pdfaSchema:namespaceURI>http://www.aiim.org/pdfua/ns/id/</pdfaSchema:namespaceURI>
15542
+ <pdfaSchema:prefix>pdfuaid</pdfaSchema:prefix>
15543
+ <pdfaSchema:schema>PDF/UA identification schema</pdfaSchema:schema>
15544
+ <pdfaSchema:property>
15545
+ <rdf:Seq>
15546
+ <rdf:li rdf:parseType="Resource">
15547
+ <pdfaProperty:category>internal</pdfaProperty:category>
15548
+ <pdfaProperty:description>PDF/UA version identifier</pdfaProperty:description>
15549
+ <pdfaProperty:name>part</pdfaProperty:name>
15550
+ <pdfaProperty:valueType>Integer</pdfaProperty:valueType>
15551
+ </rdf:li>
15552
+ <rdf:li rdf:parseType="Resource">
15553
+ <pdfaProperty:category>internal</pdfaProperty:category>
15554
+ <pdfaProperty:description>PDF/UA amendment identifier</pdfaProperty:description>
15555
+ <pdfaProperty:name>amd</pdfaProperty:name>
15556
+ <pdfaProperty:valueType>Text</pdfaProperty:valueType>
15557
+ </rdf:li>
15558
+ <rdf:li rdf:parseType="Resource">
15559
+ <pdfaProperty:category>internal</pdfaProperty:category>
15560
+ <pdfaProperty:description>PDF/UA corrigenda identifier</pdfaProperty:description>
15561
+ <pdfaProperty:name>corr</pdfaProperty:name>
15562
+ <pdfaProperty:valueType>Text</pdfaProperty:valueType>
15563
+ </rdf:li>
15564
+ </rdf:Seq>
15565
+ </pdfaSchema:property>
15566
+ </rdf:li>
15567
+ </rdf:Bag>
15568
+ </pdfaExtension:schemas>
15569
+ </rdf:Description>
15508
15570
  <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
15509
15571
  <!-- Dublin Core properties go here -->
15510
15572
  <dc:title>
@@ -15515,33 +15577,57 @@
15515
15577
 
15516
15578
  </xsl:for-each>
15517
15579
  </xsl:variable>
15518
- <xsl:choose>
15519
- <xsl:when test="normalize-space($title) != ''">
15520
- <xsl:value-of select="$title"/>
15521
- </xsl:when>
15522
- <xsl:otherwise>
15523
- <xsl:text> </xsl:text>
15524
- </xsl:otherwise>
15525
- </xsl:choose>
15580
+ <rdf:Alt>
15581
+ <rdf:li xml:lang="x-default">
15582
+ <xsl:choose>
15583
+ <xsl:when test="normalize-space($title) != ''">
15584
+ <xsl:value-of select="$title"/>
15585
+ </xsl:when>
15586
+ <xsl:otherwise>
15587
+ <xsl:text> </xsl:text>
15588
+ </xsl:otherwise>
15589
+ </xsl:choose>
15590
+ </rdf:li>
15591
+ </rdf:Alt>
15526
15592
  </dc:title>
15527
- <dc:creator>
15593
+ <xsl:variable name="dc_creator">
15528
15594
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
15529
15595
 
15530
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
15531
- <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
15532
- <xsl:if test="position() != last()">; </xsl:if>
15533
- </xsl:for-each>
15596
+ <rdf:Seq>
15597
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
15598
+ <rdf:li>
15599
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
15600
+ </rdf:li>
15601
+ <!-- <xsl:if test="position() != last()">; </xsl:if> -->
15602
+ </xsl:for-each>
15603
+ </rdf:Seq>
15534
15604
 
15535
15605
  </xsl:for-each>
15536
- </dc:creator>
15537
- <dc:description>
15606
+ </xsl:variable>
15607
+ <xsl:if test="normalize-space($dc_creator) != ''">
15608
+ <dc:creator>
15609
+ <xsl:copy-of select="$dc_creator"/>
15610
+ </dc:creator>
15611
+ </xsl:if>
15612
+
15613
+ <xsl:variable name="dc_description">
15538
15614
  <xsl:variable name="abstract">
15539
15615
 
15540
15616
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'title'])]"/>
15541
15617
 
15542
15618
  </xsl:variable>
15543
- <xsl:value-of select="normalize-space($abstract)"/>
15544
- </dc:description>
15619
+ <rdf:Alt>
15620
+ <rdf:li xml:lang="x-default">
15621
+ <xsl:value-of select="normalize-space($abstract)"/>
15622
+ </rdf:li>
15623
+ </rdf:Alt>
15624
+ </xsl:variable>
15625
+ <xsl:if test="normalize-space($dc_description)">
15626
+ <dc:description>
15627
+ <xsl:copy-of select="$dc_description"/>
15628
+ </dc:description>
15629
+ </xsl:if>
15630
+
15545
15631
  <pdf:Keywords>
15546
15632
  <xsl:call-template name="insertKeywords">
15547
15633
  <xsl:with-param name="meta">true</xsl:with-param>
@@ -15556,26 +15642,37 @@
15556
15642
  </x:xmpmeta>
15557
15643
  <!-- add attachments -->
15558
15644
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
15559
- <xsl:choose>
15560
- <xsl:when test="normalize-space() != ''">
15561
- <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
15562
- <pdf:embedded-file src="{$src_attachment}" filename="{@name}"/>
15563
- </xsl:when>
15564
- <xsl:otherwise>
15565
- <!-- _{filename}_attachments -->
15566
- <!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
15567
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
15568
- <pdf:embedded-file src="{$url}" filename="{@name}"/>
15569
- </xsl:otherwise>
15570
- </xsl:choose>
15645
+ <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
15646
+
15647
+ <pdf:embedded-file filename="{@name}">
15648
+ <xsl:attribute name="src">
15649
+ <xsl:choose>
15650
+ <xsl:when test="normalize-space() != ''">
15651
+ <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
15652
+ <xsl:value-of select="$src_attachment"/>
15653
+ </xsl:when>
15654
+ <xsl:otherwise>
15655
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
15656
+ <xsl:value-of select="$url"/>
15657
+ </xsl:otherwise>
15658
+ </xsl:choose>
15659
+ </xsl:attribute>
15660
+ <xsl:if test="$description != ''">
15661
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
15662
+ </xsl:if>
15663
+ </pdf:embedded-file>
15571
15664
  </xsl:for-each>
15572
15665
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
15573
15666
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
15574
15667
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
15575
15668
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
15576
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, $attachment_path, ')')"/>
15577
- <xsl:variable name="filename_embedded" select="substring-after($attachment_path, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
15578
- <pdf:embedded-file src="{$url}" filename="{$filename_embedded}"/>
15669
+ <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
15670
+ <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
15671
+ <pdf:embedded-file src="{$url}" filename="{$attachment_path}">
15672
+ <xsl:if test="$description != ''">
15673
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
15674
+ </xsl:if>
15675
+ </pdf:embedded-file>
15579
15676
  </xsl:for-each>
15580
15677
  </xsl:if>
15581
15678
  </xsl:template> <!-- addPDFUAmeta -->
@@ -15953,7 +16050,14 @@
15953
16050
  <xsl:value-of select="$src"/>
15954
16051
  </xsl:when>
15955
16052
  <xsl:otherwise>
15956
- <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
16053
+ <xsl:choose>
16054
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
16055
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
16056
+ </xsl:when>
16057
+ <xsl:otherwise>
16058
+ <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
16059
+ </xsl:otherwise>
16060
+ </xsl:choose>
15957
16061
  </xsl:otherwise>
15958
16062
  </xsl:choose>
15959
16063
  </xsl:template>