metanorma-un 0.12.16 → 0.12.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a120825c98b7fc5972089995524436f6ddae471d46d1fc87437283a94623466e
4
- data.tar.gz: 28407ef4700990a45545fc019a270e27dc79e689b43c87c0828c674c6df26fa3
3
+ metadata.gz: d3ed809ee46234548dc735e697db8315a7670bee1d5e9aa62aa033b8a766820a
4
+ data.tar.gz: 1b116150e9b52db0e140c61ad0657939704ad4d52a82dd98ec7180b9e97e9a21
5
5
  SHA512:
6
- metadata.gz: 3f20bf9892286d35c707bdc4a5db907d57bca4b2b7448fa81b0f6ca1349cee3fb5a8063f9da770d2846c1ace9ff295d6810e4030fc7e6576a84df08c9578a0ba
7
- data.tar.gz: 6e3bd86f8fee8a0a2aca2eaa9aa55432c90d8f07303edd20974c212e5ec08b55acdd6a468afa650b50bb6a2ba743ee7098130d26c2db71902a618f5182306069
6
+ metadata.gz: f295ab7c71802e0255ad1b00d7933c0f96a30ebae17a2f64120451f10ce1773795dec033b817b052282a507757250a64803473329b1a13106ff35dda679a29d5
7
+ data.tar.gz: f0ca4c27ba5d075343656e1f2e34af7a9c7a940bece961d6b9a0dbd92c2d565f25668999ad6365bc7b26d561bd4b856a7d211c7dc3deede4114f668c66a5ed42
@@ -239,7 +239,7 @@ h6:hover > a.anchor,
239
239
  background-color: #777;
240
240
  color: white;
241
241
  cursor: pointer;
242
- padding: 12px 0;
242
+ padding: 3px 0;
243
243
  margin: 0;
244
244
  width: 100%;
245
245
  border: none;
@@ -6939,6 +6939,12 @@
6939
6939
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
6940
6940
  <attachment filename="{@name}"/>
6941
6941
  </xsl:for-each>
6942
+ <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
6943
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
6944
+ <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
6945
+ <attachment filename="{$attachment_path}"/>
6946
+ </xsl:for-each>
6947
+ </xsl:if>
6942
6948
  </xsl:variable>
6943
6949
  <xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
6944
6950
 
@@ -6951,7 +6957,7 @@
6951
6957
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
6952
6958
  </xsl:when>
6953
6959
  <!-- link to the PDF attachment -->
6954
- <xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
6960
+ <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
6955
6961
  <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
6956
6962
  </xsl:when>
6957
6963
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
@@ -7611,7 +7617,16 @@
7611
7617
  </xsl:variable>
7612
7618
  <xsl:variable name="img_src">
7613
7619
  <xsl:choose>
7614
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
7620
+ <xsl:when test="not(starts-with(@src, 'data:'))">
7621
+ <xsl:choose>
7622
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7623
+ <xsl:value-of select="@src"/>
7624
+ </xsl:when>
7625
+ <xsl:otherwise>
7626
+ <xsl:value-of select="concat($basepath, @src)"/>
7627
+ </xsl:otherwise>
7628
+ </xsl:choose>
7629
+ </xsl:when>
7615
7630
  <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7616
7631
  </xsl:choose>
7617
7632
  </xsl:variable>
@@ -7624,7 +7639,7 @@
7624
7639
  <!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
7625
7640
  <xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
7626
7641
  <xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
7627
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7642
+ <xsl:variable name="scale" select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7628
7643
  <xsl:value-of select="$scale"/>
7629
7644
  </xsl:template>
7630
7645
 
@@ -7643,7 +7658,14 @@
7643
7658
  <xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
7644
7659
  </xsl:when>
7645
7660
  <xsl:when test="not(starts-with(@src, 'data:'))">
7646
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7661
+ <xsl:choose>
7662
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7663
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
7664
+ </xsl:when>
7665
+ <xsl:otherwise>
7666
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7667
+ </xsl:otherwise>
7668
+ </xsl:choose>
7647
7669
  </xsl:when>
7648
7670
  <xsl:otherwise>
7649
7671
  <xsl:value-of select="@src"/>
@@ -7665,7 +7687,14 @@
7665
7687
  </xsl:when>
7666
7688
  <xsl:when test="not(starts-with(@src, 'data:'))">
7667
7689
  <xsl:variable name="src">
7668
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7690
+ <xsl:choose>
7691
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7692
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
7693
+ </xsl:when>
7694
+ <xsl:otherwise>
7695
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7696
+ </xsl:otherwise>
7697
+ </xsl:choose>
7669
7698
  </xsl:variable>
7670
7699
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
7671
7700
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
@@ -12384,6 +12413,39 @@
12384
12413
  </pdf:catalog>
12385
12414
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
12386
12415
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
12416
+ <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="">
12417
+ <pdfaExtension:schemas>
12418
+ <rdf:Bag>
12419
+ <rdf:li rdf:parseType="Resource">
12420
+ <pdfaSchema:namespaceURI>http://www.aiim.org/pdfua/ns/id/</pdfaSchema:namespaceURI>
12421
+ <pdfaSchema:prefix>pdfuaid</pdfaSchema:prefix>
12422
+ <pdfaSchema:schema>PDF/UA identification schema</pdfaSchema:schema>
12423
+ <pdfaSchema:property>
12424
+ <rdf:Seq>
12425
+ <rdf:li rdf:parseType="Resource">
12426
+ <pdfaProperty:category>internal</pdfaProperty:category>
12427
+ <pdfaProperty:description>PDF/UA version identifier</pdfaProperty:description>
12428
+ <pdfaProperty:name>part</pdfaProperty:name>
12429
+ <pdfaProperty:valueType>Integer</pdfaProperty:valueType>
12430
+ </rdf:li>
12431
+ <rdf:li rdf:parseType="Resource">
12432
+ <pdfaProperty:category>internal</pdfaProperty:category>
12433
+ <pdfaProperty:description>PDF/UA amendment identifier</pdfaProperty:description>
12434
+ <pdfaProperty:name>amd</pdfaProperty:name>
12435
+ <pdfaProperty:valueType>Text</pdfaProperty:valueType>
12436
+ </rdf:li>
12437
+ <rdf:li rdf:parseType="Resource">
12438
+ <pdfaProperty:category>internal</pdfaProperty:category>
12439
+ <pdfaProperty:description>PDF/UA corrigenda identifier</pdfaProperty:description>
12440
+ <pdfaProperty:name>corr</pdfaProperty:name>
12441
+ <pdfaProperty:valueType>Text</pdfaProperty:valueType>
12442
+ </rdf:li>
12443
+ </rdf:Seq>
12444
+ </pdfaSchema:property>
12445
+ </rdf:li>
12446
+ </rdf:Bag>
12447
+ </pdfaExtension:schemas>
12448
+ </rdf:Description>
12387
12449
  <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
12388
12450
  <!-- Dublin Core properties go here -->
12389
12451
  <dc:title>
@@ -12394,33 +12456,57 @@
12394
12456
 
12395
12457
  </xsl:for-each>
12396
12458
  </xsl:variable>
12397
- <xsl:choose>
12398
- <xsl:when test="normalize-space($title) != ''">
12399
- <xsl:value-of select="$title"/>
12400
- </xsl:when>
12401
- <xsl:otherwise>
12402
- <xsl:text> </xsl:text>
12403
- </xsl:otherwise>
12404
- </xsl:choose>
12459
+ <rdf:Alt>
12460
+ <rdf:li xml:lang="x-default">
12461
+ <xsl:choose>
12462
+ <xsl:when test="normalize-space($title) != ''">
12463
+ <xsl:value-of select="$title"/>
12464
+ </xsl:when>
12465
+ <xsl:otherwise>
12466
+ <xsl:text> </xsl:text>
12467
+ </xsl:otherwise>
12468
+ </xsl:choose>
12469
+ </rdf:li>
12470
+ </rdf:Alt>
12405
12471
  </dc:title>
12406
- <dc:creator>
12472
+ <xsl:variable name="dc_creator">
12407
12473
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
12408
12474
 
12409
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
12410
- <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
12411
- <xsl:if test="position() != last()">; </xsl:if>
12412
- </xsl:for-each>
12475
+ <rdf:Seq>
12476
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
12477
+ <rdf:li>
12478
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
12479
+ </rdf:li>
12480
+ <!-- <xsl:if test="position() != last()">; </xsl:if> -->
12481
+ </xsl:for-each>
12482
+ </rdf:Seq>
12413
12483
 
12414
12484
  </xsl:for-each>
12415
- </dc:creator>
12416
- <dc:description>
12485
+ </xsl:variable>
12486
+ <xsl:if test="normalize-space($dc_creator) != ''">
12487
+ <dc:creator>
12488
+ <xsl:copy-of select="$dc_creator"/>
12489
+ </dc:creator>
12490
+ </xsl:if>
12491
+
12492
+ <xsl:variable name="dc_description">
12417
12493
  <xsl:variable name="abstract">
12418
12494
 
12419
12495
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'title'])]"/>
12420
12496
 
12421
12497
  </xsl:variable>
12422
- <xsl:value-of select="normalize-space($abstract)"/>
12423
- </dc:description>
12498
+ <rdf:Alt>
12499
+ <rdf:li xml:lang="x-default">
12500
+ <xsl:value-of select="normalize-space($abstract)"/>
12501
+ </rdf:li>
12502
+ </rdf:Alt>
12503
+ </xsl:variable>
12504
+ <xsl:if test="normalize-space($dc_description)">
12505
+ <dc:description>
12506
+ <xsl:copy-of select="$dc_description"/>
12507
+ </dc:description>
12508
+ </xsl:if>
12509
+
12424
12510
  <pdf:Keywords>
12425
12511
  <xsl:call-template name="insertKeywords">
12426
12512
  <xsl:with-param name="meta">true</xsl:with-param>
@@ -12435,26 +12521,37 @@
12435
12521
  </x:xmpmeta>
12436
12522
  <!-- add attachments -->
12437
12523
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
12438
- <xsl:choose>
12439
- <xsl:when test="normalize-space() != ''">
12440
- <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
12441
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$src_attachment}" filename="{@name}"/>
12442
- </xsl:when>
12443
- <xsl:otherwise>
12444
- <!-- _{filename}_attachments -->
12445
- <!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
12446
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
12447
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
12448
- </xsl:otherwise>
12449
- </xsl:choose>
12524
+ <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
12525
+
12526
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{@name}">
12527
+ <xsl:attribute name="src">
12528
+ <xsl:choose>
12529
+ <xsl:when test="normalize-space() != ''">
12530
+ <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
12531
+ <xsl:value-of select="$src_attachment"/>
12532
+ </xsl:when>
12533
+ <xsl:otherwise>
12534
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
12535
+ <xsl:value-of select="$url"/>
12536
+ </xsl:otherwise>
12537
+ </xsl:choose>
12538
+ </xsl:attribute>
12539
+ <xsl:if test="$description != ''">
12540
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
12541
+ </xsl:if>
12542
+ </pdf:embedded-file>
12450
12543
  </xsl:for-each>
12451
12544
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
12452
12545
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
12453
12546
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
12454
12547
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
12455
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, $attachment_path, ')')"/>
12456
- <xsl:variable name="filename_embedded" select="substring-after($attachment_path, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
12457
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$filename_embedded}"/>
12548
+ <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
12549
+ <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
12550
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_path}">
12551
+ <xsl:if test="$description != ''">
12552
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
12553
+ </xsl:if>
12554
+ </pdf:embedded-file>
12458
12555
  </xsl:for-each>
12459
12556
  </xsl:if>
12460
12557
  </xsl:template> <!-- addPDFUAmeta -->
@@ -12832,7 +12929,14 @@
12832
12929
  <xsl:value-of select="$src"/>
12833
12930
  </xsl:when>
12834
12931
  <xsl:otherwise>
12835
- <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
12932
+ <xsl:choose>
12933
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
12934
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
12935
+ </xsl:when>
12936
+ <xsl:otherwise>
12937
+ <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
12938
+ </xsl:otherwise>
12939
+ </xsl:choose>
12836
12940
  </xsl:otherwise>
12837
12941
  </xsl:choose>
12838
12942
  </xsl:template>
@@ -6939,6 +6939,12 @@
6939
6939
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
6940
6940
  <attachment filename="{@name}"/>
6941
6941
  </xsl:for-each>
6942
+ <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
6943
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
6944
+ <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
6945
+ <attachment filename="{$attachment_path}"/>
6946
+ </xsl:for-each>
6947
+ </xsl:if>
6942
6948
  </xsl:variable>
6943
6949
  <xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
6944
6950
 
@@ -6951,7 +6957,7 @@
6951
6957
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
6952
6958
  </xsl:when>
6953
6959
  <!-- link to the PDF attachment -->
6954
- <xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
6960
+ <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
6955
6961
  <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
6956
6962
  </xsl:when>
6957
6963
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
@@ -7611,7 +7617,16 @@
7611
7617
  </xsl:variable>
7612
7618
  <xsl:variable name="img_src">
7613
7619
  <xsl:choose>
7614
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
7620
+ <xsl:when test="not(starts-with(@src, 'data:'))">
7621
+ <xsl:choose>
7622
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7623
+ <xsl:value-of select="@src"/>
7624
+ </xsl:when>
7625
+ <xsl:otherwise>
7626
+ <xsl:value-of select="concat($basepath, @src)"/>
7627
+ </xsl:otherwise>
7628
+ </xsl:choose>
7629
+ </xsl:when>
7615
7630
  <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7616
7631
  </xsl:choose>
7617
7632
  </xsl:variable>
@@ -7624,7 +7639,7 @@
7624
7639
  <!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
7625
7640
  <xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
7626
7641
  <xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
7627
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7642
+ <xsl:variable name="scale" select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7628
7643
  <xsl:value-of select="$scale"/>
7629
7644
  </xsl:template>
7630
7645
 
@@ -7643,7 +7658,14 @@
7643
7658
  <xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
7644
7659
  </xsl:when>
7645
7660
  <xsl:when test="not(starts-with(@src, 'data:'))">
7646
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7661
+ <xsl:choose>
7662
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7663
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
7664
+ </xsl:when>
7665
+ <xsl:otherwise>
7666
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7667
+ </xsl:otherwise>
7668
+ </xsl:choose>
7647
7669
  </xsl:when>
7648
7670
  <xsl:otherwise>
7649
7671
  <xsl:value-of select="@src"/>
@@ -7665,7 +7687,14 @@
7665
7687
  </xsl:when>
7666
7688
  <xsl:when test="not(starts-with(@src, 'data:'))">
7667
7689
  <xsl:variable name="src">
7668
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7690
+ <xsl:choose>
7691
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7692
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
7693
+ </xsl:when>
7694
+ <xsl:otherwise>
7695
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7696
+ </xsl:otherwise>
7697
+ </xsl:choose>
7669
7698
  </xsl:variable>
7670
7699
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
7671
7700
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
@@ -12384,6 +12413,39 @@
12384
12413
  </pdf:catalog>
12385
12414
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
12386
12415
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
12416
+ <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="">
12417
+ <pdfaExtension:schemas>
12418
+ <rdf:Bag>
12419
+ <rdf:li rdf:parseType="Resource">
12420
+ <pdfaSchema:namespaceURI>http://www.aiim.org/pdfua/ns/id/</pdfaSchema:namespaceURI>
12421
+ <pdfaSchema:prefix>pdfuaid</pdfaSchema:prefix>
12422
+ <pdfaSchema:schema>PDF/UA identification schema</pdfaSchema:schema>
12423
+ <pdfaSchema:property>
12424
+ <rdf:Seq>
12425
+ <rdf:li rdf:parseType="Resource">
12426
+ <pdfaProperty:category>internal</pdfaProperty:category>
12427
+ <pdfaProperty:description>PDF/UA version identifier</pdfaProperty:description>
12428
+ <pdfaProperty:name>part</pdfaProperty:name>
12429
+ <pdfaProperty:valueType>Integer</pdfaProperty:valueType>
12430
+ </rdf:li>
12431
+ <rdf:li rdf:parseType="Resource">
12432
+ <pdfaProperty:category>internal</pdfaProperty:category>
12433
+ <pdfaProperty:description>PDF/UA amendment identifier</pdfaProperty:description>
12434
+ <pdfaProperty:name>amd</pdfaProperty:name>
12435
+ <pdfaProperty:valueType>Text</pdfaProperty:valueType>
12436
+ </rdf:li>
12437
+ <rdf:li rdf:parseType="Resource">
12438
+ <pdfaProperty:category>internal</pdfaProperty:category>
12439
+ <pdfaProperty:description>PDF/UA corrigenda identifier</pdfaProperty:description>
12440
+ <pdfaProperty:name>corr</pdfaProperty:name>
12441
+ <pdfaProperty:valueType>Text</pdfaProperty:valueType>
12442
+ </rdf:li>
12443
+ </rdf:Seq>
12444
+ </pdfaSchema:property>
12445
+ </rdf:li>
12446
+ </rdf:Bag>
12447
+ </pdfaExtension:schemas>
12448
+ </rdf:Description>
12387
12449
  <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
12388
12450
  <!-- Dublin Core properties go here -->
12389
12451
  <dc:title>
@@ -12394,33 +12456,57 @@
12394
12456
 
12395
12457
  </xsl:for-each>
12396
12458
  </xsl:variable>
12397
- <xsl:choose>
12398
- <xsl:when test="normalize-space($title) != ''">
12399
- <xsl:value-of select="$title"/>
12400
- </xsl:when>
12401
- <xsl:otherwise>
12402
- <xsl:text> </xsl:text>
12403
- </xsl:otherwise>
12404
- </xsl:choose>
12459
+ <rdf:Alt>
12460
+ <rdf:li xml:lang="x-default">
12461
+ <xsl:choose>
12462
+ <xsl:when test="normalize-space($title) != ''">
12463
+ <xsl:value-of select="$title"/>
12464
+ </xsl:when>
12465
+ <xsl:otherwise>
12466
+ <xsl:text> </xsl:text>
12467
+ </xsl:otherwise>
12468
+ </xsl:choose>
12469
+ </rdf:li>
12470
+ </rdf:Alt>
12405
12471
  </dc:title>
12406
- <dc:creator>
12472
+ <xsl:variable name="dc_creator">
12407
12473
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
12408
12474
 
12409
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
12410
- <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
12411
- <xsl:if test="position() != last()">; </xsl:if>
12412
- </xsl:for-each>
12475
+ <rdf:Seq>
12476
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
12477
+ <rdf:li>
12478
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
12479
+ </rdf:li>
12480
+ <!-- <xsl:if test="position() != last()">; </xsl:if> -->
12481
+ </xsl:for-each>
12482
+ </rdf:Seq>
12413
12483
 
12414
12484
  </xsl:for-each>
12415
- </dc:creator>
12416
- <dc:description>
12485
+ </xsl:variable>
12486
+ <xsl:if test="normalize-space($dc_creator) != ''">
12487
+ <dc:creator>
12488
+ <xsl:copy-of select="$dc_creator"/>
12489
+ </dc:creator>
12490
+ </xsl:if>
12491
+
12492
+ <xsl:variable name="dc_description">
12417
12493
  <xsl:variable name="abstract">
12418
12494
 
12419
12495
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'title'])]"/>
12420
12496
 
12421
12497
  </xsl:variable>
12422
- <xsl:value-of select="normalize-space($abstract)"/>
12423
- </dc:description>
12498
+ <rdf:Alt>
12499
+ <rdf:li xml:lang="x-default">
12500
+ <xsl:value-of select="normalize-space($abstract)"/>
12501
+ </rdf:li>
12502
+ </rdf:Alt>
12503
+ </xsl:variable>
12504
+ <xsl:if test="normalize-space($dc_description)">
12505
+ <dc:description>
12506
+ <xsl:copy-of select="$dc_description"/>
12507
+ </dc:description>
12508
+ </xsl:if>
12509
+
12424
12510
  <pdf:Keywords>
12425
12511
  <xsl:call-template name="insertKeywords">
12426
12512
  <xsl:with-param name="meta">true</xsl:with-param>
@@ -12435,26 +12521,37 @@
12435
12521
  </x:xmpmeta>
12436
12522
  <!-- add attachments -->
12437
12523
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
12438
- <xsl:choose>
12439
- <xsl:when test="normalize-space() != ''">
12440
- <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
12441
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$src_attachment}" filename="{@name}"/>
12442
- </xsl:when>
12443
- <xsl:otherwise>
12444
- <!-- _{filename}_attachments -->
12445
- <!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
12446
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
12447
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
12448
- </xsl:otherwise>
12449
- </xsl:choose>
12524
+ <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
12525
+
12526
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{@name}">
12527
+ <xsl:attribute name="src">
12528
+ <xsl:choose>
12529
+ <xsl:when test="normalize-space() != ''">
12530
+ <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
12531
+ <xsl:value-of select="$src_attachment"/>
12532
+ </xsl:when>
12533
+ <xsl:otherwise>
12534
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
12535
+ <xsl:value-of select="$url"/>
12536
+ </xsl:otherwise>
12537
+ </xsl:choose>
12538
+ </xsl:attribute>
12539
+ <xsl:if test="$description != ''">
12540
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
12541
+ </xsl:if>
12542
+ </pdf:embedded-file>
12450
12543
  </xsl:for-each>
12451
12544
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
12452
12545
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
12453
12546
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
12454
12547
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
12455
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, $attachment_path, ')')"/>
12456
- <xsl:variable name="filename_embedded" select="substring-after($attachment_path, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
12457
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$filename_embedded}"/>
12548
+ <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
12549
+ <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
12550
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_path}">
12551
+ <xsl:if test="$description != ''">
12552
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
12553
+ </xsl:if>
12554
+ </pdf:embedded-file>
12458
12555
  </xsl:for-each>
12459
12556
  </xsl:if>
12460
12557
  </xsl:template> <!-- addPDFUAmeta -->
@@ -12832,7 +12929,14 @@
12832
12929
  <xsl:value-of select="$src"/>
12833
12930
  </xsl:when>
12834
12931
  <xsl:otherwise>
12835
- <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
12932
+ <xsl:choose>
12933
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
12934
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
12935
+ </xsl:when>
12936
+ <xsl:otherwise>
12937
+ <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
12938
+ </xsl:otherwise>
12939
+ </xsl:choose>
12836
12940
  </xsl:otherwise>
12837
12941
  </xsl:choose>
12838
12942
  </xsl:template>