metanorma-csa 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: d7c765f707e3838f49083d78a1c49a1821fdbcfe7e25a9f21306b0b6adbb4511
4
- data.tar.gz: ffe390ab5accb247bd72220bc8b43898bdd5247dfffa1f3dbdebda9a716022c7
3
+ metadata.gz: dc7f3e19db0e8f8ac36c850c107dc38e455cb9ac8ea4b2fcde699a8f6c982fb0
4
+ data.tar.gz: af551eebc94bbdbe65eecc474b5252937e912ef704d954bc5d774f9a204df95d
5
5
  SHA512:
6
- metadata.gz: 94f56e6d4e2471ea54ac1742cd8472e11e8378ce60b40e771e87c74ee55ec4ce99c435dd55a542e97b9d472704590fb9b52ffc973f4d5c7e62ffde55023cd651
7
- data.tar.gz: 4836233b4f7243987e27045f8c7e965a005f85cd5ca7f0f280fe9a419d0254c6eddb1eb6234c4a9442e1d64fc7502e609336da56f1a3aae0f100a49f4ea4ae09
6
+ metadata.gz: e8f9d11ebee9473e46cb0a45a553ef5758bb53a1a7d67ff45230d1e7bd970e5b11ea6356a3552a4b37828821c5be8277f644187ab052e77a63a36536c9366633
7
+ data.tar.gz: 8ec46ad091ee729cf444720580ca2efbc546d9a7462b04bd605d7f6ec5037e25db13c5a5b6470e04a9423ee14ecaf639bea518fe25730768fda7481b32bae167
@@ -6673,6 +6673,12 @@
6673
6673
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
6674
6674
  <attachment filename="{@name}"/>
6675
6675
  </xsl:for-each>
6676
+ <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
6677
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
6678
+ <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
6679
+ <attachment filename="{$attachment_path}"/>
6680
+ </xsl:for-each>
6681
+ </xsl:if>
6676
6682
  </xsl:variable>
6677
6683
  <xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
6678
6684
 
@@ -6685,7 +6691,7 @@
6685
6691
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
6686
6692
  </xsl:when>
6687
6693
  <!-- link to the PDF attachment -->
6688
- <xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
6694
+ <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
6689
6695
  <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
6690
6696
  </xsl:when>
6691
6697
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
@@ -7336,7 +7342,16 @@
7336
7342
  </xsl:variable>
7337
7343
  <xsl:variable name="img_src">
7338
7344
  <xsl:choose>
7339
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
7345
+ <xsl:when test="not(starts-with(@src, 'data:'))">
7346
+ <xsl:choose>
7347
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7348
+ <xsl:value-of select="@src"/>
7349
+ </xsl:when>
7350
+ <xsl:otherwise>
7351
+ <xsl:value-of select="concat($basepath, @src)"/>
7352
+ </xsl:otherwise>
7353
+ </xsl:choose>
7354
+ </xsl:when>
7340
7355
  <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
7341
7356
  </xsl:choose>
7342
7357
  </xsl:variable>
@@ -7349,7 +7364,7 @@
7349
7364
  <!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
7350
7365
  <xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
7351
7366
  <xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
7352
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7367
+ <xsl:variable name="scale" select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
7353
7368
  <xsl:value-of select="$scale"/>
7354
7369
  </xsl:template>
7355
7370
 
@@ -7368,7 +7383,14 @@
7368
7383
  <xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
7369
7384
  </xsl:when>
7370
7385
  <xsl:when test="not(starts-with(@src, 'data:'))">
7371
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7386
+ <xsl:choose>
7387
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7388
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
7389
+ </xsl:when>
7390
+ <xsl:otherwise>
7391
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7392
+ </xsl:otherwise>
7393
+ </xsl:choose>
7372
7394
  </xsl:when>
7373
7395
  <xsl:otherwise>
7374
7396
  <xsl:value-of select="@src"/>
@@ -7390,7 +7412,14 @@
7390
7412
  </xsl:when>
7391
7413
  <xsl:when test="not(starts-with(@src, 'data:'))">
7392
7414
  <xsl:variable name="src">
7393
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7415
+ <xsl:choose>
7416
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
7417
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
7418
+ </xsl:when>
7419
+ <xsl:otherwise>
7420
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
7421
+ </xsl:otherwise>
7422
+ </xsl:choose>
7394
7423
  </xsl:variable>
7395
7424
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
7396
7425
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
@@ -12149,26 +12178,37 @@
12149
12178
  </x:xmpmeta>
12150
12179
  <!-- add attachments -->
12151
12180
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
12152
- <xsl:choose>
12153
- <xsl:when test="normalize-space() != ''">
12154
- <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
12155
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$src_attachment}" filename="{@name}"/>
12156
- </xsl:when>
12157
- <xsl:otherwise>
12158
- <!-- _{filename}_attachments -->
12159
- <!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
12160
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
12161
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
12162
- </xsl:otherwise>
12163
- </xsl:choose>
12181
+ <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
12182
+
12183
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" filename="{@name}">
12184
+ <xsl:attribute name="src">
12185
+ <xsl:choose>
12186
+ <xsl:when test="normalize-space() != ''">
12187
+ <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
12188
+ <xsl:value-of select="$src_attachment"/>
12189
+ </xsl:when>
12190
+ <xsl:otherwise>
12191
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
12192
+ <xsl:value-of select="$url"/>
12193
+ </xsl:otherwise>
12194
+ </xsl:choose>
12195
+ </xsl:attribute>
12196
+ <xsl:if test="$description != ''">
12197
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
12198
+ </xsl:if>
12199
+ </pdf:embedded-file>
12164
12200
  </xsl:for-each>
12165
12201
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
12166
12202
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
12167
12203
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
12168
12204
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
12169
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, $attachment_path, ')')"/>
12170
- <xsl:variable name="filename_embedded" select="substring-after($attachment_path, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
12171
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$filename_embedded}"/>
12205
+ <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
12206
+ <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
12207
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{$attachment_path}">
12208
+ <xsl:if test="$description != ''">
12209
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
12210
+ </xsl:if>
12211
+ </pdf:embedded-file>
12172
12212
  </xsl:for-each>
12173
12213
  </xsl:if>
12174
12214
  </xsl:template> <!-- addPDFUAmeta -->
@@ -12546,7 +12586,14 @@
12546
12586
  <xsl:value-of select="$src"/>
12547
12587
  </xsl:when>
12548
12588
  <xsl:otherwise>
12549
- <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
12589
+ <xsl:choose>
12590
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
12591
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
12592
+ </xsl:when>
12593
+ <xsl:otherwise>
12594
+ <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
12595
+ </xsl:otherwise>
12596
+ </xsl:choose>
12550
12597
  </xsl:otherwise>
12551
12598
  </xsl:choose>
12552
12599
  </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 Csa
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-csa
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