metanorma-ribose 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: 6870f076ae8e391de38bef5ec500f584ddcafc218734c371e2ee60c9ee06d76a
4
- data.tar.gz: 29b9819b5bd291e1c9cffc0f954fc49873fd1d00e349ec9ee86703f82b6286e8
3
+ metadata.gz: edac65eda4eb9b0bbe575ac4770019b2f4e65fd77c626b97caa74af6a6187d78
4
+ data.tar.gz: f3589092a64694540b3160ab7c66b8342beb3bf1279bff17927126a904dae8bc
5
5
  SHA512:
6
- metadata.gz: 9196ee05f5e746185b80db74ca6ebb7a2ce0b58487a1e11de20ab4a7012bfbedd9213fb5a72687e37f1ffeccdc1084199c101c77d178777ef42e90a2b7cc9ea7
7
- data.tar.gz: cfb292071e9ae8a2c5384b413438a5c24d9dadd2ccf9a565533c3be527cf722139c6f41433265f883de5bb9e158612de2d89f94563338bb150e7a5e8d475e7f1
6
+ metadata.gz: 9532a580feb0eafd71645919b0faf9d9e8aafdb071f112b1ac342e610362241f2cd87fbf87058782e44eaafd804393e20cda801953788f266eb05fe05b9aaa96
7
+ data.tar.gz: 21f16a4cf1ac78a424add2d0736cba58f12cf6f02c09f0a9fa9cdc0e3d56714be44902519139282f596e97be8e4dc98160328c2478a33f1811a40fc8a629320c
@@ -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;
@@ -7445,6 +7445,12 @@
7445
7445
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
7446
7446
  <attachment filename="{@name}"/>
7447
7447
  </xsl:for-each>
7448
+ <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
7449
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
7450
+ <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
7451
+ <attachment filename="{$attachment_path}"/>
7452
+ </xsl:for-each>
7453
+ </xsl:if>
7448
7454
  </xsl:variable>
7449
7455
  <xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
7450
7456
 
@@ -7457,7 +7463,7 @@
7457
7463
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
7458
7464
  </xsl:when>
7459
7465
  <!-- link to the PDF attachment -->
7460
- <xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
7466
+ <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
7461
7467
  <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
7462
7468
  </xsl:when>
7463
7469
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
@@ -8109,7 +8115,16 @@
8109
8115
  </xsl:variable>
8110
8116
  <xsl:variable name="img_src">
8111
8117
  <xsl:choose>
8112
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
8118
+ <xsl:when test="not(starts-with(@src, 'data:'))">
8119
+ <xsl:choose>
8120
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
8121
+ <xsl:value-of select="@src"/>
8122
+ </xsl:when>
8123
+ <xsl:otherwise>
8124
+ <xsl:value-of select="concat($basepath, @src)"/>
8125
+ </xsl:otherwise>
8126
+ </xsl:choose>
8127
+ </xsl:when>
8113
8128
  <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
8114
8129
  </xsl:choose>
8115
8130
  </xsl:variable>
@@ -8122,7 +8137,7 @@
8122
8137
  <!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
8123
8138
  <xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
8124
8139
  <xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
8125
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
8140
+ <xsl:variable name="scale" select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
8126
8141
  <xsl:value-of select="$scale"/>
8127
8142
  </xsl:template>
8128
8143
 
@@ -8141,7 +8156,14 @@
8141
8156
  <xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
8142
8157
  </xsl:when>
8143
8158
  <xsl:when test="not(starts-with(@src, 'data:'))">
8144
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
8159
+ <xsl:choose>
8160
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
8161
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
8162
+ </xsl:when>
8163
+ <xsl:otherwise>
8164
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
8165
+ </xsl:otherwise>
8166
+ </xsl:choose>
8145
8167
  </xsl:when>
8146
8168
  <xsl:otherwise>
8147
8169
  <xsl:value-of select="@src"/>
@@ -8163,7 +8185,14 @@
8163
8185
  </xsl:when>
8164
8186
  <xsl:when test="not(starts-with(@src, 'data:'))">
8165
8187
  <xsl:variable name="src">
8166
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
8188
+ <xsl:choose>
8189
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
8190
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
8191
+ </xsl:when>
8192
+ <xsl:otherwise>
8193
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
8194
+ </xsl:otherwise>
8195
+ </xsl:choose>
8167
8196
  </xsl:variable>
8168
8197
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
8169
8198
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
@@ -12893,6 +12922,39 @@
12893
12922
  </pdf:catalog>
12894
12923
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
12895
12924
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
12925
+ <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="">
12926
+ <pdfaExtension:schemas>
12927
+ <rdf:Bag>
12928
+ <rdf:li rdf:parseType="Resource">
12929
+ <pdfaSchema:namespaceURI>http://www.aiim.org/pdfua/ns/id/</pdfaSchema:namespaceURI>
12930
+ <pdfaSchema:prefix>pdfuaid</pdfaSchema:prefix>
12931
+ <pdfaSchema:schema>PDF/UA identification schema</pdfaSchema:schema>
12932
+ <pdfaSchema:property>
12933
+ <rdf:Seq>
12934
+ <rdf:li rdf:parseType="Resource">
12935
+ <pdfaProperty:category>internal</pdfaProperty:category>
12936
+ <pdfaProperty:description>PDF/UA version identifier</pdfaProperty:description>
12937
+ <pdfaProperty:name>part</pdfaProperty:name>
12938
+ <pdfaProperty:valueType>Integer</pdfaProperty:valueType>
12939
+ </rdf:li>
12940
+ <rdf:li rdf:parseType="Resource">
12941
+ <pdfaProperty:category>internal</pdfaProperty:category>
12942
+ <pdfaProperty:description>PDF/UA amendment identifier</pdfaProperty:description>
12943
+ <pdfaProperty:name>amd</pdfaProperty:name>
12944
+ <pdfaProperty:valueType>Text</pdfaProperty:valueType>
12945
+ </rdf:li>
12946
+ <rdf:li rdf:parseType="Resource">
12947
+ <pdfaProperty:category>internal</pdfaProperty:category>
12948
+ <pdfaProperty:description>PDF/UA corrigenda identifier</pdfaProperty:description>
12949
+ <pdfaProperty:name>corr</pdfaProperty:name>
12950
+ <pdfaProperty:valueType>Text</pdfaProperty:valueType>
12951
+ </rdf:li>
12952
+ </rdf:Seq>
12953
+ </pdfaSchema:property>
12954
+ </rdf:li>
12955
+ </rdf:Bag>
12956
+ </pdfaExtension:schemas>
12957
+ </rdf:Description>
12896
12958
  <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
12897
12959
  <!-- Dublin Core properties go here -->
12898
12960
  <dc:title>
@@ -12903,33 +12965,57 @@
12903
12965
 
12904
12966
  </xsl:for-each>
12905
12967
  </xsl:variable>
12906
- <xsl:choose>
12907
- <xsl:when test="normalize-space($title) != ''">
12908
- <xsl:value-of select="$title"/>
12909
- </xsl:when>
12910
- <xsl:otherwise>
12911
- <xsl:text> </xsl:text>
12912
- </xsl:otherwise>
12913
- </xsl:choose>
12968
+ <rdf:Alt>
12969
+ <rdf:li xml:lang="x-default">
12970
+ <xsl:choose>
12971
+ <xsl:when test="normalize-space($title) != ''">
12972
+ <xsl:value-of select="$title"/>
12973
+ </xsl:when>
12974
+ <xsl:otherwise>
12975
+ <xsl:text> </xsl:text>
12976
+ </xsl:otherwise>
12977
+ </xsl:choose>
12978
+ </rdf:li>
12979
+ </rdf:Alt>
12914
12980
  </dc:title>
12915
- <dc:creator>
12981
+ <xsl:variable name="dc_creator">
12916
12982
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
12917
12983
 
12918
- <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
12919
- <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
12920
- <xsl:if test="position() != last()">; </xsl:if>
12921
- </xsl:for-each>
12984
+ <rdf:Seq>
12985
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
12986
+ <rdf:li>
12987
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
12988
+ </rdf:li>
12989
+ <!-- <xsl:if test="position() != last()">; </xsl:if> -->
12990
+ </xsl:for-each>
12991
+ </rdf:Seq>
12922
12992
 
12923
12993
  </xsl:for-each>
12924
- </dc:creator>
12925
- <dc:description>
12994
+ </xsl:variable>
12995
+ <xsl:if test="normalize-space($dc_creator) != ''">
12996
+ <dc:creator>
12997
+ <xsl:copy-of select="$dc_creator"/>
12998
+ </dc:creator>
12999
+ </xsl:if>
13000
+
13001
+ <xsl:variable name="dc_description">
12926
13002
  <xsl:variable name="abstract">
12927
13003
 
12928
13004
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()[not(ancestor::*[local-name() = 'title'])]"/>
12929
13005
 
12930
13006
  </xsl:variable>
12931
- <xsl:value-of select="normalize-space($abstract)"/>
12932
- </dc:description>
13007
+ <rdf:Alt>
13008
+ <rdf:li xml:lang="x-default">
13009
+ <xsl:value-of select="normalize-space($abstract)"/>
13010
+ </rdf:li>
13011
+ </rdf:Alt>
13012
+ </xsl:variable>
13013
+ <xsl:if test="normalize-space($dc_description)">
13014
+ <dc:description>
13015
+ <xsl:copy-of select="$dc_description"/>
13016
+ </dc:description>
13017
+ </xsl:if>
13018
+
12933
13019
  <pdf:Keywords>
12934
13020
  <xsl:call-template name="insertKeywords">
12935
13021
  <xsl:with-param name="meta">true</xsl:with-param>
@@ -12944,26 +13030,37 @@
12944
13030
  </x:xmpmeta>
12945
13031
  <!-- add attachments -->
12946
13032
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
12947
- <xsl:choose>
12948
- <xsl:when test="normalize-space() != ''">
12949
- <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
12950
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$src_attachment}" filename="{@name}"/>
12951
- </xsl:when>
12952
- <xsl:otherwise>
12953
- <!-- _{filename}_attachments -->
12954
- <!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
12955
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
12956
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
12957
- </xsl:otherwise>
12958
- </xsl:choose>
13033
+ <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
13034
+
13035
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{@name}">
13036
+ <xsl:attribute name="src">
13037
+ <xsl:choose>
13038
+ <xsl:when test="normalize-space() != ''">
13039
+ <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
13040
+ <xsl:value-of select="$src_attachment"/>
13041
+ </xsl:when>
13042
+ <xsl:otherwise>
13043
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
13044
+ <xsl:value-of select="$url"/>
13045
+ </xsl:otherwise>
13046
+ </xsl:choose>
13047
+ </xsl:attribute>
13048
+ <xsl:if test="$description != ''">
13049
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
13050
+ </xsl:if>
13051
+ </pdf:embedded-file>
12959
13052
  </xsl:for-each>
12960
13053
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
12961
13054
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
12962
13055
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
12963
13056
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
12964
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, $attachment_path, ')')"/>
12965
- <xsl:variable name="filename_embedded" select="substring-after($attachment_path, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
12966
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$filename_embedded}"/>
13057
+ <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
13058
+ <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
13059
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_path}">
13060
+ <xsl:if test="$description != ''">
13061
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
13062
+ </xsl:if>
13063
+ </pdf:embedded-file>
12967
13064
  </xsl:for-each>
12968
13065
  </xsl:if>
12969
13066
  </xsl:template> <!-- addPDFUAmeta -->
@@ -13341,7 +13438,14 @@
13341
13438
  <xsl:value-of select="$src"/>
13342
13439
  </xsl:when>
13343
13440
  <xsl:otherwise>
13344
- <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
13441
+ <xsl:choose>
13442
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
13443
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
13444
+ </xsl:when>
13445
+ <xsl:otherwise>
13446
+ <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
13447
+ </xsl:otherwise>
13448
+ </xsl:choose>
13345
13449
  </xsl:otherwise>
13346
13450
  </xsl:choose>
13347
13451
  </xsl:template>