metanorma-cc 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: 666df502f026573721a3c2207bf91d92f4b1da3e2a1e5efe6414f428bbda79bc
4
- data.tar.gz: e64eb03f34664c9d0a843b926b3c215b69e0e61fa6cd0d58c34f93db5092caa8
3
+ metadata.gz: 820b6db3e2d0068fc87e7d9c4c4ad947ae57af096a8d0055ebaf1921efac88ed
4
+ data.tar.gz: 07567b955252c1b3e1d9fb71bf77abf96ab166c1d96bfc11cc5efc9d575053eb
5
5
  SHA512:
6
- metadata.gz: 1f9cc2d751b5a75d0031e0d4d8c52c7854f679c802dc0d091ec6f377e38030a36825eff425742adf1bb368d1915a61e434c162e22ae374a548c39e39f19f714e
7
- data.tar.gz: 89039c710247e68dcd23cd7c49153734e5d3acc8f96ee2d87e3e939dcc187c37e5c0e32333b0018f273f2cf7b5e5a96344e134d3b7bfc63a0c46dc4e29b37c3c
6
+ metadata.gz: 0f3a39ec99fc3fb236c2ec6336bf47818c3bfd1ff6ae5811b58e85df95032ca25cfe61ff92ada506e4e8fc49ffcfa1556f83eaa0f5c0be570ef541b8c483d5df
7
+ data.tar.gz: 1907f98e71ce5518cc2e2c880bec5efc338f70893e67cef68ed43d9af6aca73289f2b4c6b0264ede0bebfbad9f07635d70a77413b08a5f48ed0febdb20c7fc4a
@@ -6661,6 +6661,12 @@
6661
6661
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
6662
6662
  <attachment filename="{@name}"/>
6663
6663
  </xsl:for-each>
6664
+ <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
6665
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
6666
+ <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
6667
+ <attachment filename="{$attachment_path}"/>
6668
+ </xsl:for-each>
6669
+ </xsl:if>
6664
6670
  </xsl:variable>
6665
6671
  <xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
6666
6672
 
@@ -6673,7 +6679,7 @@
6673
6679
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
6674
6680
  </xsl:when>
6675
6681
  <!-- link to the PDF attachment -->
6676
- <xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
6682
+ <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
6677
6683
  <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
6678
6684
  </xsl:when>
6679
6685
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
@@ -7320,7 +7326,16 @@
7320
7326
  </xsl:variable>
7321
7327
  <xsl:variable name="img_src">
7322
7328
  <xsl:choose>
7323
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
7329
+ <xsl:when test="not(starts-with(@src, 'data:'))">
7330
+ <xsl:choose>
7331
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7332
+ <xsl:value-of select="@src"/>
7333
+ </xsl:when>
7334
+ <xsl:otherwise>
7335
+ <xsl:value-of select="concat($basepath, @src)"/>
7336
+ </xsl:otherwise>
7337
+ </xsl:choose>
7338
+ </xsl:when>
7324
7339
  <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7325
7340
  </xsl:choose>
7326
7341
  </xsl:variable>
@@ -7333,7 +7348,7 @@
7333
7348
  <!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
7334
7349
  <xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
7335
7350
  <xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
7336
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7351
+ <xsl:variable name="scale" select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7337
7352
  <xsl:value-of select="$scale"/>
7338
7353
  </xsl:template>
7339
7354
 
@@ -7352,7 +7367,14 @@
7352
7367
  <xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
7353
7368
  </xsl:when>
7354
7369
  <xsl:when test="not(starts-with(@src, 'data:'))">
7355
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7370
+ <xsl:choose>
7371
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7372
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
7373
+ </xsl:when>
7374
+ <xsl:otherwise>
7375
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7376
+ </xsl:otherwise>
7377
+ </xsl:choose>
7356
7378
  </xsl:when>
7357
7379
  <xsl:otherwise>
7358
7380
  <xsl:value-of select="@src"/>
@@ -7374,7 +7396,14 @@
7374
7396
  </xsl:when>
7375
7397
  <xsl:when test="not(starts-with(@src, 'data:'))">
7376
7398
  <xsl:variable name="src">
7377
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7399
+ <xsl:choose>
7400
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7401
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
7402
+ </xsl:when>
7403
+ <xsl:otherwise>
7404
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7405
+ </xsl:otherwise>
7406
+ </xsl:choose>
7378
7407
  </xsl:variable>
7379
7408
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
7380
7409
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
@@ -12165,26 +12194,37 @@
12165
12194
  </x:xmpmeta>
12166
12195
  <!-- add attachments -->
12167
12196
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
12168
- <xsl:choose>
12169
- <xsl:when test="normalize-space() != ''">
12170
- <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
12171
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$src_attachment}" filename="{@name}"/>
12172
- </xsl:when>
12173
- <xsl:otherwise>
12174
- <!-- _{filename}_attachments -->
12175
- <!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
12176
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
12177
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
12178
- </xsl:otherwise>
12179
- </xsl:choose>
12197
+ <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
12198
+
12199
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{@name}">
12200
+ <xsl:attribute name="src">
12201
+ <xsl:choose>
12202
+ <xsl:when test="normalize-space() != ''">
12203
+ <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
12204
+ <xsl:value-of select="$src_attachment"/>
12205
+ </xsl:when>
12206
+ <xsl:otherwise>
12207
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
12208
+ <xsl:value-of select="$url"/>
12209
+ </xsl:otherwise>
12210
+ </xsl:choose>
12211
+ </xsl:attribute>
12212
+ <xsl:if test="$description != ''">
12213
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
12214
+ </xsl:if>
12215
+ </pdf:embedded-file>
12180
12216
  </xsl:for-each>
12181
12217
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
12182
12218
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
12183
12219
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
12184
12220
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
12185
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, $attachment_path, ')')"/>
12186
- <xsl:variable name="filename_embedded" select="substring-after($attachment_path, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
12187
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$filename_embedded}"/>
12221
+ <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
12222
+ <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
12223
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_path}">
12224
+ <xsl:if test="$description != ''">
12225
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
12226
+ </xsl:if>
12227
+ </pdf:embedded-file>
12188
12228
  </xsl:for-each>
12189
12229
  </xsl:if>
12190
12230
  </xsl:template> <!-- addPDFUAmeta -->
@@ -12562,7 +12602,14 @@
12562
12602
  <xsl:value-of select="$src"/>
12563
12603
  </xsl:when>
12564
12604
  <xsl:otherwise>
12565
- <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
12605
+ <xsl:choose>
12606
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
12607
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
12608
+ </xsl:when>
12609
+ <xsl:otherwise>
12610
+ <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
12611
+ </xsl:otherwise>
12612
+ </xsl:choose>
12566
12613
  </xsl:otherwise>
12567
12614
  </xsl:choose>
12568
12615
  </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 CC
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-cc
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