metanorma-iso 2.8.1 → 2.8.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: a6e0b6a830efd1aaae7f0e44e2b5a7a747abc2b5df2ae94b946e778e629953f6
4
- data.tar.gz: 45c75e889df0012ca3daf28393985ead88559e1e60fbc1e1fc23ee7ef1b4e9d5
3
+ metadata.gz: 45add77cdb8b13df6e89dd7b66bf52bf94dfc2b7d6ac3c2c2f5f1fd7cbbd2e84
4
+ data.tar.gz: bd4b6b09d4a17130b7cda4c171569f5ad3635cdcf526b5ec6b0d60e9abfc76d3
5
5
  SHA512:
6
- metadata.gz: c029eb5f8ca02cbfb752915add6560a60c1ef19d612b7ac48bbd17eae814c71472a2c718e516f18351cdf633a7039d916670bbcd2debc7fdfc42b7d507bee8e3
7
- data.tar.gz: 6ed7c39aa0b27503d8f4fa6dc07dbadbd2b8c0c6afc36e47059cf5e82239363966257b7909a2cd1bd51796cfbe6c2d1403da257db61c45d6a9149ca04f5b74a2
6
+ metadata.gz: d572ea00343fd042be81986ba99c1858e2219880743e7db3e67a3dce7bfb3bed23cefcda83cf5de0cb2f63606d35078936755e7ddfdc17aee4d251b22da22b85
7
+ data.tar.gz: e1c7eee7693c31956bb10f66fa837cffbf9ff853cb20e4e8804e9170d843573db8457f4a121117d6698ce610e5d920bf3db8b0c594dea55f2e1ce6f7e40af2d5
@@ -14,6 +14,7 @@ reference_number_abbrev: Ref. No.
14
14
  price_based_on: Price based on % pages
15
15
  price: Price
16
16
  date_first_printing: Date of the first printing
17
+ date_printing: Date of the % printing
17
18
  descriptor: Descriptor
18
19
  under_preparation: Under preparation. (Stage at the time of publication %).
19
20
  withdrawn: Withdrawn.
@@ -14,6 +14,7 @@ reference_number_abbrev: Réf. №
14
14
  price_based_on: Prix basé sur % pages
15
15
  price: Prix
16
16
  date_first_printing: Date de la première impression
17
+ date_printing: Date de la % impression
17
18
  descriptor: Descripteur
18
19
  under_preparation: En cours d'élaboration. (Stade au moment de la publication %).
19
20
  withdrawn: Retiré.
@@ -14,6 +14,7 @@ descriptor: Дескриптор
14
14
  price_based_on: Цена рассчитана на % стр.
15
15
  price: Цена
16
16
  date_first_printing: Дата первой печати
17
+ date_printing: Дата % печати
17
18
  under_preparation: В стадии подготовки. (Стадия на момент публикации %).
18
19
  withdrawn: Отозван.
19
20
  cancelled_and_replaced: Отменено и заменено на %.
@@ -11519,18 +11519,33 @@
11519
11519
 
11520
11520
  <xsl:template match="*[local-name()='localityStack']"/>
11521
11521
 
11522
+ <xsl:variable name="pdfAttachmentsList_">
11523
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
11524
+ <attachment filename="{@name}"/>
11525
+ </xsl:for-each>
11526
+ </xsl:variable>
11527
+ <xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
11528
+
11522
11529
  <xsl:template match="*[local-name()='link']" name="link">
11530
+ <xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
11531
+ <xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
11523
11532
  <xsl:variable name="target">
11524
11533
  <xsl:choose>
11525
11534
  <xsl:when test="@updatetype = 'true'">
11526
11535
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
11527
11536
  </xsl:when>
11537
+ <!-- link to the PDF attachment -->
11538
+ <xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
11539
+ <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
11540
+ </xsl:when>
11541
+ <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
11542
+ <xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
11543
+ </xsl:when>
11528
11544
  <xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
11529
- <!-- link to the PDF attachment -->
11530
11545
  <xsl:variable name="target_" select="translate(@target, '\', '/')"/>
11531
11546
  <xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
11532
11547
  <xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
11533
- </xsl:when>
11548
+ </xsl:when> -->
11534
11549
  <xsl:otherwise>
11535
11550
  <xsl:value-of select="normalize-space(@target)"/>
11536
11551
  </xsl:otherwise>
@@ -16162,6 +16177,17 @@
16162
16177
  <xsl:copy-of select="."/>
16163
16178
  </xsl:template>
16164
16179
 
16180
+ <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
16181
+ <xsl:copy>
16182
+ <xsl:copy-of select="@*"/>
16183
+ <xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
16184
+ <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
16185
+ <xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
16186
+ <xsl:value-of select="."/>
16187
+ </xsl:if>
16188
+ </xsl:copy>
16189
+ </xsl:template>
16190
+
16165
16191
  <!-- add @id, mandatory for table auto-layout algorithm -->
16166
16192
  <xsl:template match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
16167
16193
  <xsl:copy>
@@ -17163,7 +17189,8 @@
17163
17189
  </xsl:when>
17164
17190
  <xsl:otherwise>
17165
17191
  <!-- _{filename}_attachments -->
17166
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
17192
+ <!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
17193
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
17167
17194
  <pdf:embedded-file src="{$url}" filename="{@name}"/>
17168
17195
  </xsl:otherwise>
17169
17196
  </xsl:choose>
@@ -11519,18 +11519,33 @@
11519
11519
 
11520
11520
  <xsl:template match="*[local-name()='localityStack']"/>
11521
11521
 
11522
+ <xsl:variable name="pdfAttachmentsList_">
11523
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
11524
+ <attachment filename="{@name}"/>
11525
+ </xsl:for-each>
11526
+ </xsl:variable>
11527
+ <xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
11528
+
11522
11529
  <xsl:template match="*[local-name()='link']" name="link">
11530
+ <xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
11531
+ <xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
11523
11532
  <xsl:variable name="target">
11524
11533
  <xsl:choose>
11525
11534
  <xsl:when test="@updatetype = 'true'">
11526
11535
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
11527
11536
  </xsl:when>
11537
+ <!-- link to the PDF attachment -->
11538
+ <xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
11539
+ <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
11540
+ </xsl:when>
11541
+ <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
11542
+ <xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
11543
+ </xsl:when>
11528
11544
  <xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
11529
- <!-- link to the PDF attachment -->
11530
11545
  <xsl:variable name="target_" select="translate(@target, '\', '/')"/>
11531
11546
  <xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
11532
11547
  <xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
11533
- </xsl:when>
11548
+ </xsl:when> -->
11534
11549
  <xsl:otherwise>
11535
11550
  <xsl:value-of select="normalize-space(@target)"/>
11536
11551
  </xsl:otherwise>
@@ -16162,6 +16177,17 @@
16162
16177
  <xsl:copy-of select="."/>
16163
16178
  </xsl:template>
16164
16179
 
16180
+ <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
16181
+ <xsl:copy>
16182
+ <xsl:copy-of select="@*"/>
16183
+ <xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
16184
+ <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
16185
+ <xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
16186
+ <xsl:value-of select="."/>
16187
+ </xsl:if>
16188
+ </xsl:copy>
16189
+ </xsl:template>
16190
+
16165
16191
  <!-- add @id, mandatory for table auto-layout algorithm -->
16166
16192
  <xsl:template match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
16167
16193
  <xsl:copy>
@@ -17163,7 +17189,8 @@
17163
17189
  </xsl:when>
17164
17190
  <xsl:otherwise>
17165
17191
  <!-- _{filename}_attachments -->
17166
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
17192
+ <!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
17193
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
17167
17194
  <pdf:embedded-file src="{$url}" filename="{@name}"/>
17168
17195
  </xsl:otherwise>
17169
17196
  </xsl:choose>
@@ -56,7 +56,7 @@ module Metanorma
56
56
  cen?(orig) and return Pubid::Cen::Identifier::Base.parse(orig)
57
57
  ret = case orig
58
58
  when /^ISO/ then Pubid::Iso::Identifier::Base.parse(orig)
59
- when /^IEC/ then Pubid::Iec::Identifier::Base.parse(orig)
59
+ when /^IEC/ then Pubid::Iec::Identifier.parse(orig)
60
60
  else base_pubid::Base.parse(orig)
61
61
  end
62
62
  ret.edition ||= 1
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module ISO
3
- VERSION = "2.8.1".freeze
3
+ VERSION = "2.8.2".freeze
4
4
  end
5
5
  end
@@ -50,4 +50,5 @@ Gem::Specification.new do |spec|
50
50
  spec.add_development_dependency "timecop", "~> 0.9"
51
51
  spec.add_development_dependency "vcr", "~> 6.1.0"
52
52
  spec.add_development_dependency "webmock"
53
+ spec.add_development_dependency "xml-c14n"
53
54
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iso
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.8.1
4
+ version: 2.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-07-22 00:00:00.000000000 Z
11
+ date: 2024-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc
@@ -248,6 +248,20 @@ dependencies:
248
248
  - - ">="
249
249
  - !ruby/object:Gem::Version
250
250
  version: '0'
251
+ - !ruby/object:Gem::Dependency
252
+ name: xml-c14n
253
+ requirement: !ruby/object:Gem::Requirement
254
+ requirements:
255
+ - - ">="
256
+ - !ruby/object:Gem::Version
257
+ version: '0'
258
+ type: :development
259
+ prerelease: false
260
+ version_requirements: !ruby/object:Gem::Requirement
261
+ requirements:
262
+ - - ">="
263
+ - !ruby/object:Gem::Version
264
+ version: '0'
251
265
  description: |
252
266
  metanorma-iso lets you write ISO standards in AsciiDoc syntax.
253
267