metanorma-ribose 2.5.0 → 2.5.1

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: a585eb3c6e6911e374a2f56a8aee8951388e1ab2810eb6034d216a6dcc978635
4
+ data.tar.gz: 806f318cc8c824e4647e10dc78fe0377db3b03bb29ec419d870335a1f2bc69fe
5
5
  SHA512:
6
- metadata.gz: 9196ee05f5e746185b80db74ca6ebb7a2ce0b58487a1e11de20ab4a7012bfbedd9213fb5a72687e37f1ffeccdc1084199c101c77d178777ef42e90a2b7cc9ea7
7
- data.tar.gz: cfb292071e9ae8a2c5384b413438a5c24d9dadd2ccf9a565533c3be527cf722139c6f41433265f883de5bb9e158612de2d89f94563338bb150e7a5e8d475e7f1
6
+ metadata.gz: d15596b24bf061829be99da2547d9584cdd32f597484021bedf0169ba72e29c227bf0dd52ef81861ee16fab97a67b58e6e55295121e5e840b3965a08d5804ef0
7
+ data.tar.gz: 0cde58ef6d4647aca47451564ffb12c12c2fc5e9f9ac1893aa48375b7e25f72056a37030fea1bfd4344bfa20ad5fd67fb6c54abc1b327351e3b14aee7a8cbabb
@@ -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)"/>
@@ -12944,26 +12973,37 @@
12944
12973
  </x:xmpmeta>
12945
12974
  <!-- add attachments -->
12946
12975
  <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>
12976
+ <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
12977
+
12978
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{@name}">
12979
+ <xsl:attribute name="src">
12980
+ <xsl:choose>
12981
+ <xsl:when test="normalize-space() != ''">
12982
+ <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
12983
+ <xsl:value-of select="$src_attachment"/>
12984
+ </xsl:when>
12985
+ <xsl:otherwise>
12986
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
12987
+ <xsl:value-of select="$url"/>
12988
+ </xsl:otherwise>
12989
+ </xsl:choose>
12990
+ </xsl:attribute>
12991
+ <xsl:if test="$description != ''">
12992
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
12993
+ </xsl:if>
12994
+ </pdf:embedded-file>
12959
12995
  </xsl:for-each>
12960
12996
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
12961
12997
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
12962
12998
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
12963
12999
  <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}"/>
13000
+ <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
13001
+ <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
13002
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_path}">
13003
+ <xsl:if test="$description != ''">
13004
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
13005
+ </xsl:if>
13006
+ </pdf:embedded-file>
12967
13007
  </xsl:for-each>
12968
13008
  </xsl:if>
12969
13009
  </xsl:template> <!-- addPDFUAmeta -->
@@ -13341,7 +13381,14 @@
13341
13381
  <xsl:value-of select="$src"/>
13342
13382
  </xsl:when>
13343
13383
  <xsl:otherwise>
13344
- <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
13384
+ <xsl:choose>
13385
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
13386
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
13387
+ </xsl:when>
13388
+ <xsl:otherwise>
13389
+ <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
13390
+ </xsl:otherwise>
13391
+ </xsl:choose>
13345
13392
  </xsl:otherwise>
13346
13393
  </xsl:choose>
13347
13394
  </xsl:template>
@@ -1000,14 +1000,14 @@
1000
1000
  <define name="PureTextElement">
1001
1001
  <choice>
1002
1002
  <text/>
1003
- <ref name="em"/>
1004
- <ref name="strong"/>
1003
+ <ref name="pure_em"/>
1004
+ <ref name="pure_strong"/>
1005
1005
  <ref name="sub"/>
1006
1006
  <ref name="sup"/>
1007
- <ref name="tt"/>
1008
- <ref name="underline"/>
1009
- <ref name="strike"/>
1010
- <ref name="smallcap"/>
1007
+ <ref name="pure_tt"/>
1008
+ <ref name="pure_underline"/>
1009
+ <ref name="pure_strike"/>
1010
+ <ref name="pure_smallcap"/>
1011
1011
  <ref name="br"/>
1012
1012
  </choice>
1013
1013
  </define>
@@ -1031,6 +1031,13 @@
1031
1031
  </zeroOrMore>
1032
1032
  </element>
1033
1033
  </define>
1034
+ <define name="pure_em">
1035
+ <element name="em">
1036
+ <zeroOrMore>
1037
+ <ref name="PureTextElement"/>
1038
+ </zeroOrMore>
1039
+ </element>
1040
+ </define>
1034
1041
  <define name="strong">
1035
1042
  <element name="strong">
1036
1043
  <zeroOrMore>
@@ -1046,6 +1053,13 @@
1046
1053
  </zeroOrMore>
1047
1054
  </element>
1048
1055
  </define>
1056
+ <define name="pure_strong">
1057
+ <element name="strong">
1058
+ <zeroOrMore>
1059
+ <ref name="PureTextElement"/>
1060
+ </zeroOrMore>
1061
+ </element>
1062
+ </define>
1049
1063
  <define name="tt">
1050
1064
  <element name="tt">
1051
1065
  <zeroOrMore>
@@ -1060,6 +1074,13 @@
1060
1074
  </zeroOrMore>
1061
1075
  </element>
1062
1076
  </define>
1077
+ <define name="pure_tt">
1078
+ <element name="tt">
1079
+ <zeroOrMore>
1080
+ <ref name="PureTextElement"/>
1081
+ </zeroOrMore>
1082
+ </element>
1083
+ </define>
1063
1084
  <define name="keyword">
1064
1085
  <element name="keyword">
1065
1086
  <zeroOrMore>
@@ -1090,13 +1111,42 @@
1090
1111
  <zeroOrMore>
1091
1112
  <choice>
1092
1113
  <ref name="PureTextElement"/>
1114
+ <ref name="stem"/>
1115
+ <ref name="eref"/>
1116
+ <ref name="xref"/>
1117
+ <ref name="hyperlink"/>
1093
1118
  <ref name="index"/>
1094
1119
  <ref name="index-xref"/>
1095
1120
  </choice>
1096
1121
  </zeroOrMore>
1097
1122
  </element>
1098
1123
  </define>
1124
+ <define name="pure_strike">
1125
+ <element name="strike">
1126
+ <zeroOrMore>
1127
+ <ref name="PureTextElement"/>
1128
+ </zeroOrMore>
1129
+ </element>
1130
+ </define>
1099
1131
  <define name="underline">
1132
+ <element name="underline">
1133
+ <optional>
1134
+ <attribute name="style"/>
1135
+ </optional>
1136
+ <zeroOrMore>
1137
+ <choice>
1138
+ <ref name="PureTextElement"/>
1139
+ <ref name="stem"/>
1140
+ <ref name="eref"/>
1141
+ <ref name="xref"/>
1142
+ <ref name="hyperlink"/>
1143
+ <ref name="index"/>
1144
+ <ref name="index-xref"/>
1145
+ </choice>
1146
+ </zeroOrMore>
1147
+ </element>
1148
+ </define>
1149
+ <define name="pure_underline">
1100
1150
  <element name="underline">
1101
1151
  <optional>
1102
1152
  <attribute name="style"/>
@@ -1107,6 +1157,21 @@
1107
1157
  </element>
1108
1158
  </define>
1109
1159
  <define name="smallcap">
1160
+ <element name="smallcap">
1161
+ <zeroOrMore>
1162
+ <choice>
1163
+ <ref name="PureTextElement"/>
1164
+ <ref name="stem"/>
1165
+ <ref name="eref"/>
1166
+ <ref name="xref"/>
1167
+ <ref name="hyperlink"/>
1168
+ <ref name="index"/>
1169
+ <ref name="index-xref"/>
1170
+ </choice>
1171
+ </zeroOrMore>
1172
+ </element>
1173
+ </define>
1174
+ <define name="pure_smallcap">
1110
1175
  <element name="smallcap">
1111
1176
  <zeroOrMore>
1112
1177
  <ref name="PureTextElement"/>
@@ -1204,7 +1204,9 @@
1204
1204
  <optional>
1205
1205
  <ref name="formattedref"/>
1206
1206
  </optional>
1207
- <ref name="btitle"/>
1207
+ <oneOrMore>
1208
+ <ref name="btitle"/>
1209
+ </oneOrMore>
1208
1210
  <optional>
1209
1211
  <ref name="bplace"/>
1210
1212
  </optional>
@@ -662,6 +662,9 @@
662
662
  <value>LatexMath</value>
663
663
  </choice>
664
664
  </attribute>
665
+ <optional>
666
+ <attribute name="number-format"/>
667
+ </optional>
665
668
  <attribute name="block">
666
669
  <data type="boolean"/>
667
670
  </attribute>
@@ -66,6 +66,9 @@
66
66
  <ref name="MultilingualRenderingType"/>
67
67
  </attribute>
68
68
  </optional>
69
+ <optional>
70
+ <attribute name="class"/>
71
+ </optional>
69
72
  <optional>
70
73
  <ref name="reqtitle"/>
71
74
  </optional>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ribose
3
- VERSION = "2.5.0".freeze
3
+ VERSION = "2.5.1".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ribose
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.5.0
4
+ version: 2.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2024-08-19 00:00:00.000000000 Z
11
+ date: 2024-09-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic