metanorma-iso 2.8.3 → 2.8.5

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: 64e6eab706552443cde266e7b76a56dd9ff53d94a796df0c03d105fa7ec945f6
4
- data.tar.gz: 65fdb4f2385b6ab436e686688cf03bcd7c461bec73eb63eb802740257c7f296e
3
+ metadata.gz: 525e7cad657557889ef7e7d0037ed4bcb970b2e91e5a3465bf45ac61d58f6c7b
4
+ data.tar.gz: 0aa738216e65109474d230c7ecdfc6c5ec1a50486cad1a5dfe596af4cf461110
5
5
  SHA512:
6
- metadata.gz: 9db77b1df94eb6ed6a5736c52fe4be6d4948bb2c07cc429457bfed51b090580e79e9b708ee7df64cdcec875596e4f78d99f062864f6516c7715a2fc85ce8715d
7
- data.tar.gz: 725a406ca051536badb034f8035a7d2a61df84d3dd1422dcfb1d478f6e23cd659677dc7301e1442f756676b4c3c71f1c8c2fd12eb5b1f49d61259b5c9340b299
6
+ metadata.gz: 84bccd977d39af0e0dbd38baaaec0da6cfc0b40e0c38b18cd5f7dcff8ea10265e8f0db89cff04c650c947ab2d1fdb2f16ff45ab55503958f438615b6de88a4c2
7
+ data.tar.gz: 27909a356e4c8e1e35711ac4ebbbb160c38f8288d6f29782df97f845ca9379518334493b432b4a1927fd7e07181781a72d65c4586e89e7ed8e03cd6649ad3d1c
@@ -1,13 +1,9 @@
1
1
  term_def_boilerplate: |
2
- <p>ISO und IEC unterhalten Terminologiedatenbanken zur Verwendung in
3
- Standardisierung unter folgenden Adressen:</p>
2
+ ISO und IEC unterhalten Terminologiedatenbanken zur Verwendung in
3
+ Standardisierung unter folgenden Adressen:
4
4
 
5
- <ul>
6
- <li><p>Online-Browsing-Plattform: verfügbar unter
7
- <link target="https://www.iso.org/obp"/></p></li>
8
- <li><p>IEC Electropedia: verfügbar unter
9
- <link target="https://www.electropedia.org"/></p></li>
10
- </ul>
5
+ * Online-Browsing-Plattform: verfügbar unter https://www.iso.org/obp[]
6
+ * IEC Electropedia: verfügbar unter https://www.electropedia.org[]
11
7
  all_rights_reserved: Alle Rechte vorbehalten
12
8
  reference_number: Referenznummer
13
9
  reference_number_abbrev: Ref.nr
@@ -19,7 +15,7 @@ cancelled_and_replaced: Abgebrochen und ersetzt durch %.
19
15
  table_of_contents: Inhalt
20
16
  date: datum
21
17
  index: Index
22
- see: Schau
18
+ see: schau
23
19
  see_also: siehe auch
24
20
  secretariat: Sekretariat
25
21
  edition: Ausgabe
@@ -34,6 +30,7 @@ multiple_or: "%1 oder %2"
34
30
  classification-UDC: UDK
35
31
  edition_ordinal_old: "{{ var1 | ordinal_num: 'edition', '' }} AUSGABE"
36
32
  edition_replacement: "Diese {{ var1 | ordinal_word: 'edition', '' }} Ausgabe ersetzt die {{ var2 | ordinal_word: 'edition', '' }} Ausgabe"
33
+ website: Webseite
37
34
  doctype_dict:
38
35
  international-standard: Internationaler Standard
39
36
  technical-specification: Technische Spezifikation
@@ -1,13 +1,9 @@
1
1
  term_def_boilerplate: |
2
- <p>ISO and IEC maintain terminology databases for use in
3
- standardization at the following addresses:</p>
2
+ ISO and IEC maintain terminology databases for use in
3
+ standardization at the following addresses:
4
4
 
5
- <ul>
6
- <li><p>ISO Online browsing platform: available at
7
- <link target="https://www.iso.org/obp"/></p></li>
8
- <li><p>IEC Electropedia: available at
9
- <link target="https://www.electropedia.org"/></p></li>
10
- </ul>
5
+ * ISO Online browsing platform: available at https://www.iso.org/obp[]
6
+ * IEC Electropedia: available at https://www.electropedia.org[]
11
7
  all_rights_reserved: All rights reserved
12
8
  reference_number: Reference number
13
9
  reference_number_abbrev: Ref. No.
@@ -37,6 +33,7 @@ fast-track-procedure: Fast track procedure
37
33
  multiple_and: "%1 and %2"
38
34
  multiple_or: "%1 or %2"
39
35
  classification-UDC: UDC
36
+ website: website
40
37
  doctype_dict:
41
38
  international-standard: International Standard
42
39
  technical-specification: Technical Specification
@@ -49,6 +46,7 @@ doctype_dict:
49
46
  directive: Directive
50
47
  committee-document: Committee Document
51
48
  recommendation: ISO Recommendation
49
+ addendum: Addendum
52
50
  stage_dict:
53
51
  "00": Preliminary work item
54
52
  "10": New work item proposal
@@ -1,13 +1,10 @@
1
1
  term_def_boilerplate: |
2
- <p>L'ISO et l'IEC tiennent à jour des bases de données terminologiques
2
+ L'ISO et l'IEC tiennent à jour des bases de données terminologiques
3
3
  destinées à être utilisées en normalisation, consultables aux adresses
4
- suivantes:</p>
5
- <ul>
6
- <li> <p>ISO Online browsing platform: disponible à l'adresse
7
- <link target="https://www.iso.org/obp"/></p></li>
8
- <li> <p>IEC Electropedia: disponible à l'adresse
9
- <link target="https://www.electropedia.org"/>
10
- </p> </li> </ul>
4
+ suivantes:
5
+
6
+ * ISO Online browsing platform: disponible à l'adresse https://www.iso.org/obp[]
7
+ * IEC Electropedia: disponible à l'adresse https://www.electropedia.org[]
11
8
  all_rights_reserved: Tous droits réservés
12
9
  reference_number: Numéro de référence
13
10
  reference_number_abbrev: Réf. №
@@ -34,6 +31,7 @@ voting_terminates_on: Le vote se termine le
34
31
  corrected_version: Version corrigée
35
32
  fast-track-procedure: Procédure accélérée
36
33
  classification-UDC: CDU
34
+ website: site web
37
35
  doctype_dict:
38
36
  international-standard: Norme internationale
39
37
  technical-specification: Spécification technique
@@ -46,6 +44,7 @@ doctype_dict:
46
44
  directive: Directive
47
45
  committee-document: Document du comité
48
46
  recommendation: Recommandation ISO
47
+ addendum: Additif
49
48
  stage_dict:
50
49
  "00": Élément de travail préliminaire
51
50
  "10": Nouvelle proposition d'élément de travail
@@ -1,6 +1,9 @@
1
1
  descriptor: 記述子
2
2
  fast-track-procedure: ファストトラック手順
3
- availablefrom: 入手可能
3
+ availablefrom: 入手先
4
+ website: ウェブサイト
5
+ see: 参照
6
+ see_also: 第参照
4
7
  stage_dict:
5
8
  "00": Preliminary work item
6
9
  "10": New work item proposal
@@ -1,14 +1,10 @@
1
1
  term_def_boilerplate: |
2
- <p>ИСО и МЭК поддерживают терминологические базы данных для использования в стандартизации по следующим адресам:</p>
2
+ ИСО и МЭК поддерживают терминологические базы данных для использования в стандартизации по следующим адресам:
3
3
 
4
- <ul>
5
- <li> <p>ИСО, Интернет-онлайн-платформа: доступна на
6
- <link target="https://www.iso.org/obp"/></p></li>
7
- <li> <p>МЭК Electropedia: доступна на
8
- <link target="https://www.electropedia.org"/>
9
- </p> </li> </ul>
4
+ * ИСО, Интернет-онлайн-платформа: доступна на https://www.iso.org/obp[]
5
+ * МЭК Electropedia: доступна на https://www.electropedia.org[]
10
6
  all_rights_reserved: Все права защищены
11
- reference_number: Ссылочный номерS
7
+ reference_number: Ссылочный номер
12
8
  reference_number_abbrev: Исх. №
13
9
  descriptor: Дескриптор
14
10
  price_based_on: Цена рассчитана на % стр.
@@ -35,6 +31,7 @@ voting_terminates_on: Голосование заканчивается в
35
31
  corrected_version: Исправленная версия
36
32
  fast-track-procedure: Ускоренная процедура
37
33
  classification-UDC: УДК
34
+ website: веб-сайт
38
35
  doctype_dict:
39
36
  international-standard: Международный Стандарт
40
37
  technical-specification: Техническая Спецификация
@@ -47,6 +44,7 @@ doctype_dict:
47
44
  directive: Директива
48
45
  committee-document: Документ комитета
49
46
  recommendation: Рекомендации ИСО
47
+ addendum: Дополнение
50
48
  stage_dict:
51
49
  "00": Предварительный рабочий элемент
52
50
  "10": Предложение нового рабочего элемента
@@ -1,11 +1,8 @@
1
1
  term_def_boilerplate: |
2
- <p>ISO和IEC用于标准化的术语数据库地址如下:</p>
3
- <ul>
4
- <li> <p>ISO在线浏览平台:
5
- 位于<link target="https://www.iso.org/obp"/></p></li>
6
- <li> <p>IEC Electropedia:
7
- 位于<link target="https://www.electropedia.org"/>
8
- </p> </li> </ul>
2
+ ISO和IEC用于标准化的术语数据库地址如下:
3
+
4
+ * ISO在线浏览平台: 位于{blank}https://www.iso.org/obp[]
5
+ * IEC Electropedia: 位于{blank}https://www.electropedia.org[]
9
6
  all_rights_reserved: 版权所有
10
7
  reference_number: 参考编号
11
8
  reference_number_abbrev: 参考编号
@@ -27,6 +24,7 @@ voting_terminates_on: 投票终止于
27
24
  corrected_version: 修正版本
28
25
  fast-track-procedure: 快速通道程序
29
26
  classification-UDC: 通用十进制图书分类法
27
+ website: 网站
30
28
  doctype_dict:
31
29
  international-standard: 国际标准
32
30
  technical-specification: 技术规格
@@ -64,7 +64,7 @@ module IsoDoc
64
64
 
65
65
  def std_docid_semantic1(id)
66
66
  ids = id.split(/(\p{Zs})/)
67
- agency?(ids[0].sub(/\/.*$/, "")) or return id
67
+ agency?(ids[0].sub(%r{^([^/]+)/.*$}, "\\1")) or return id
68
68
  ids.map! do |i|
69
69
  if %w(GUIDE TR TS DIR).include?(i)
70
70
  "<span class='stddocNumber'>#{i}</span>"
@@ -11545,6 +11545,12 @@
11545
11545
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
11546
11546
  <attachment filename="{@name}"/>
11547
11547
  </xsl:for-each>
11548
+ <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
11549
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
11550
+ <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
11551
+ <attachment filename="{$attachment_path}"/>
11552
+ </xsl:for-each>
11553
+ </xsl:if>
11548
11554
  </xsl:variable>
11549
11555
  <xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
11550
11556
 
@@ -11557,7 +11563,7 @@
11557
11563
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
11558
11564
  </xsl:when>
11559
11565
  <!-- link to the PDF attachment -->
11560
- <xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
11566
+ <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
11561
11567
  <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
11562
11568
  </xsl:when>
11563
11569
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
@@ -12225,7 +12231,16 @@
12225
12231
  </xsl:variable>
12226
12232
  <xsl:variable name="img_src">
12227
12233
  <xsl:choose>
12228
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
12234
+ <xsl:when test="not(starts-with(@src, 'data:'))">
12235
+ <xsl:choose>
12236
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
12237
+ <xsl:value-of select="@src"/>
12238
+ </xsl:when>
12239
+ <xsl:otherwise>
12240
+ <xsl:value-of select="concat($basepath, @src)"/>
12241
+ </xsl:otherwise>
12242
+ </xsl:choose>
12243
+ </xsl:when>
12229
12244
  <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
12230
12245
  </xsl:choose>
12231
12246
  </xsl:variable>
@@ -12238,7 +12253,7 @@
12238
12253
  <!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
12239
12254
  <xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
12240
12255
  <xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
12241
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
12256
+ <xsl:variable name="scale" select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
12242
12257
  <xsl:value-of select="$scale"/>
12243
12258
  </xsl:template>
12244
12259
 
@@ -12257,7 +12272,14 @@
12257
12272
  <xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
12258
12273
  </xsl:when>
12259
12274
  <xsl:when test="not(starts-with(@src, 'data:'))">
12260
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
12275
+ <xsl:choose>
12276
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
12277
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
12278
+ </xsl:when>
12279
+ <xsl:otherwise>
12280
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
12281
+ </xsl:otherwise>
12282
+ </xsl:choose>
12261
12283
  </xsl:when>
12262
12284
  <xsl:otherwise>
12263
12285
  <xsl:value-of select="@src"/>
@@ -12279,7 +12301,14 @@
12279
12301
  </xsl:when>
12280
12302
  <xsl:when test="not(starts-with(@src, 'data:'))">
12281
12303
  <xsl:variable name="src">
12282
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
12304
+ <xsl:choose>
12305
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
12306
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
12307
+ </xsl:when>
12308
+ <xsl:otherwise>
12309
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
12310
+ </xsl:otherwise>
12311
+ </xsl:choose>
12283
12312
  </xsl:variable>
12284
12313
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
12285
12314
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
@@ -17207,26 +17236,37 @@
17207
17236
  </x:xmpmeta>
17208
17237
  <!-- add attachments -->
17209
17238
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
17210
- <xsl:choose>
17211
- <xsl:when test="normalize-space() != ''">
17212
- <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
17213
- <pdf:embedded-file src="{$src_attachment}" filename="{@name}"/>
17214
- </xsl:when>
17215
- <xsl:otherwise>
17216
- <!-- _{filename}_attachments -->
17217
- <!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
17218
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
17219
- <pdf:embedded-file src="{$url}" filename="{@name}"/>
17220
- </xsl:otherwise>
17221
- </xsl:choose>
17239
+ <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
17240
+
17241
+ <pdf:embedded-file filename="{@name}">
17242
+ <xsl:attribute name="src">
17243
+ <xsl:choose>
17244
+ <xsl:when test="normalize-space() != ''">
17245
+ <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
17246
+ <xsl:value-of select="$src_attachment"/>
17247
+ </xsl:when>
17248
+ <xsl:otherwise>
17249
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
17250
+ <xsl:value-of select="$url"/>
17251
+ </xsl:otherwise>
17252
+ </xsl:choose>
17253
+ </xsl:attribute>
17254
+ <xsl:if test="$description != ''">
17255
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
17256
+ </xsl:if>
17257
+ </pdf:embedded-file>
17222
17258
  </xsl:for-each>
17223
17259
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
17224
17260
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
17225
17261
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
17226
17262
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
17227
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, $attachment_path, ')')"/>
17228
- <xsl:variable name="filename_embedded" select="substring-after($attachment_path, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
17229
- <pdf:embedded-file src="{$url}" filename="{$filename_embedded}"/>
17263
+ <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
17264
+ <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
17265
+ <pdf:embedded-file src="{$url}" filename="{$attachment_path}">
17266
+ <xsl:if test="$description != ''">
17267
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
17268
+ </xsl:if>
17269
+ </pdf:embedded-file>
17230
17270
  </xsl:for-each>
17231
17271
  </xsl:if>
17232
17272
  </xsl:template> <!-- addPDFUAmeta -->
@@ -17604,7 +17644,14 @@
17604
17644
  <xsl:value-of select="$src"/>
17605
17645
  </xsl:when>
17606
17646
  <xsl:otherwise>
17607
- <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
17647
+ <xsl:choose>
17648
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
17649
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
17650
+ </xsl:when>
17651
+ <xsl:otherwise>
17652
+ <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
17653
+ </xsl:otherwise>
17654
+ </xsl:choose>
17608
17655
  </xsl:otherwise>
17609
17656
  </xsl:choose>
17610
17657
  </xsl:template>
@@ -11545,6 +11545,12 @@
11545
11545
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
11546
11546
  <attachment filename="{@name}"/>
11547
11547
  </xsl:for-each>
11548
+ <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
11549
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
11550
+ <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
11551
+ <attachment filename="{$attachment_path}"/>
11552
+ </xsl:for-each>
11553
+ </xsl:if>
11548
11554
  </xsl:variable>
11549
11555
  <xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
11550
11556
 
@@ -11557,7 +11563,7 @@
11557
11563
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
11558
11564
  </xsl:when>
11559
11565
  <!-- link to the PDF attachment -->
11560
- <xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
11566
+ <xsl:when test="@attachment = 'true' and $pdfAttachmentsList//attachment[@filename = current()/@target]">
11561
11567
  <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
11562
11568
  </xsl:when>
11563
11569
  <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
@@ -12225,7 +12231,16 @@
12225
12231
  </xsl:variable>
12226
12232
  <xsl:variable name="img_src">
12227
12233
  <xsl:choose>
12228
- <xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
12234
+ <xsl:when test="not(starts-with(@src, 'data:'))">
12235
+ <xsl:choose>
12236
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
12237
+ <xsl:value-of select="@src"/>
12238
+ </xsl:when>
12239
+ <xsl:otherwise>
12240
+ <xsl:value-of select="concat($basepath, @src)"/>
12241
+ </xsl:otherwise>
12242
+ </xsl:choose>
12243
+ </xsl:when>
12229
12244
  <xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
12230
12245
  </xsl:choose>
12231
12246
  </xsl:variable>
@@ -12238,7 +12253,7 @@
12238
12253
  <!-- <xsl:message>width_effective=<xsl:value-of select="$width_effective"/></xsl:message>
12239
12254
  <xsl:message>indent_left=<xsl:value-of select="$indent_left"/></xsl:message>
12240
12255
  <xsl:message>image_width_effective=<xsl:value-of select="$image_width_effective"/> for <xsl:value-of select="ancestor::ogc:p[1]/@id"/></xsl:message> -->
12241
- <xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $image_width_effective, $height_effective)"/>
12256
+ <xsl:variable name="scale" select="java:org.metanorma.fop.utils.ImageUtils.getImageScale($img_src, $image_width_effective, $height_effective)"/>
12242
12257
  <xsl:value-of select="$scale"/>
12243
12258
  </xsl:template>
12244
12259
 
@@ -12257,7 +12272,14 @@
12257
12272
  <xsl:value-of select="concat('url(file:///',$basepath, $src_png, ')')"/>
12258
12273
  </xsl:when>
12259
12274
  <xsl:when test="not(starts-with(@src, 'data:'))">
12260
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
12275
+ <xsl:choose>
12276
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
12277
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
12278
+ </xsl:when>
12279
+ <xsl:otherwise>
12280
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
12281
+ </xsl:otherwise>
12282
+ </xsl:choose>
12261
12283
  </xsl:when>
12262
12284
  <xsl:otherwise>
12263
12285
  <xsl:value-of select="@src"/>
@@ -12279,7 +12301,14 @@
12279
12301
  </xsl:when>
12280
12302
  <xsl:when test="not(starts-with(@src, 'data:'))">
12281
12303
  <xsl:variable name="src">
12282
- <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
12304
+ <xsl:choose>
12305
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
12306
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
12307
+ </xsl:when>
12308
+ <xsl:otherwise>
12309
+ <xsl:value-of select="concat('url(file:///',$basepath, @src, ')')"/>
12310
+ </xsl:otherwise>
12311
+ </xsl:choose>
12283
12312
  </xsl:variable>
12284
12313
  <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
12285
12314
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
@@ -17207,26 +17236,37 @@
17207
17236
  </x:xmpmeta>
17208
17237
  <!-- add attachments -->
17209
17238
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
17210
- <xsl:choose>
17211
- <xsl:when test="normalize-space() != ''">
17212
- <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
17213
- <pdf:embedded-file src="{$src_attachment}" filename="{@name}"/>
17214
- </xsl:when>
17215
- <xsl:otherwise>
17216
- <!-- _{filename}_attachments -->
17217
- <!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
17218
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
17219
- <pdf:embedded-file src="{$url}" filename="{@name}"/>
17220
- </xsl:otherwise>
17221
- </xsl:choose>
17239
+ <xsl:variable name="description" select="normalize-space(//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment'] = current()/@name]/*[local-name() = 'formattedref'])"/>
17240
+
17241
+ <pdf:embedded-file filename="{@name}">
17242
+ <xsl:attribute name="src">
17243
+ <xsl:choose>
17244
+ <xsl:when test="normalize-space() != ''">
17245
+ <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
17246
+ <xsl:value-of select="$src_attachment"/>
17247
+ </xsl:when>
17248
+ <xsl:otherwise>
17249
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
17250
+ <xsl:value-of select="$url"/>
17251
+ </xsl:otherwise>
17252
+ </xsl:choose>
17253
+ </xsl:attribute>
17254
+ <xsl:if test="$description != ''">
17255
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
17256
+ </xsl:if>
17257
+ </pdf:embedded-file>
17222
17258
  </xsl:for-each>
17223
17259
  <!-- references to external attachments (no binary-encoded within the Metanorma XML file) -->
17224
17260
  <xsl:if test="not(//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment'])">
17225
17261
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden = 'true'][*[local-name() = 'uri'][@type = 'attachment']]">
17226
17262
  <xsl:variable name="attachment_path" select="*[local-name() = 'uri'][@type = 'attachment']"/>
17227
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, $attachment_path, ')')"/>
17228
- <xsl:variable name="filename_embedded" select="substring-after($attachment_path, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
17229
- <pdf:embedded-file src="{$url}" filename="{$filename_embedded}"/>
17263
+ <xsl:variable name="url" select="concat('url(file:///',$basepath, $attachment_path, ')')"/>
17264
+ <xsl:variable name="description" select="normalize-space(*[local-name() = 'formattedref'])"/>
17265
+ <pdf:embedded-file src="{$url}" filename="{$attachment_path}">
17266
+ <xsl:if test="$description != ''">
17267
+ <xsl:attribute name="description"><xsl:value-of select="$description"/></xsl:attribute>
17268
+ </xsl:if>
17269
+ </pdf:embedded-file>
17230
17270
  </xsl:for-each>
17231
17271
  </xsl:if>
17232
17272
  </xsl:template> <!-- addPDFUAmeta -->
@@ -17604,7 +17644,14 @@
17604
17644
  <xsl:value-of select="$src"/>
17605
17645
  </xsl:when>
17606
17646
  <xsl:otherwise>
17607
- <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
17647
+ <xsl:choose>
17648
+ <xsl:when test="@extracted = 'true'"> <!-- added in mn2pdf v1.97 -->
17649
+ <xsl:value-of select="concat('url(file:///', @src, ')')"/>
17650
+ </xsl:when>
17651
+ <xsl:otherwise>
17652
+ <xsl:value-of select="concat('url(file:///',$basepath, $src, ')')"/>
17653
+ </xsl:otherwise>
17654
+ </xsl:choose>
17608
17655
  </xsl:otherwise>
17609
17656
  </xsl:choose>
17610
17657
  </xsl:template>
@@ -77,7 +77,7 @@ module IsoDoc
77
77
  end
78
78
 
79
79
  def edition_printing_date(bibdata)
80
- @i18n.date_printing &&
80
+ @i18n.get["date_printing"] &&
81
81
  pd = bibdata.at(ns("//metanorma-extension/presentation-metadata/" \
82
82
  "printing-date[1]")) or return
83
83
  x = @i18n.populate("date_printing", { "var1" => pd.text.to_i })
@@ -32,10 +32,11 @@ module IsoDoc
32
32
  ret = resolve_eref_connectives(eref_locality_stacks(refs, target,
33
33
  node))
34
34
  node["droploc"] = droploc
35
- eref_localities1({ target: target, number: "pl",
36
- type: prefix_clause(target, refs.first.at(ns("./locality"))),
37
- from: l10n(ret[1..-1].join),
38
- node: node, lang: @lang })
35
+ eref_localities1({ target:, number: "pl",
36
+ type: prefix_clause(target,
37
+ refs.first.at(ns("./locality"))),
38
+ from: l10n(ret[1..].join),
39
+ node:, lang: @lang })
39
40
  end
40
41
 
41
42
  def prefix_clause(target, loc)
@@ -51,10 +52,11 @@ module IsoDoc
51
52
  def subclause?(target, type, from)
52
53
  (from&.match?(/\./) && type == "clause") ||
53
54
  type == "list" ||
54
- target&.gsub(/<[^>]+>/, "")&.match(/^IEV$|^IEC 60050-/)
55
+ target&.gsub(/<[^<>]+>/, "")&.match(/^IEV$|^IEC 60050-/)
55
56
  end
56
57
 
57
- # ISO has not bothered to communicate to us what most of these span classes mean
58
+ # ISO has not bothered to communicate to us what most of these
59
+ # span classes mean
58
60
  LOCALITY2SPAN = {
59
61
  annex: "citeapp",
60
62
  dunno: "citebase",
@@ -72,7 +74,7 @@ module IsoDoc
72
74
 
73
75
  def locality_span_wrap(ret, type)
74
76
  type or return ret
75
- m = /^(\s*)(.+?)(\s*)$/.match(ret) or return ret
77
+ m = /^(\s*)(?=\S)(.+?)(\s*)$/.match(ret) or return ret
76
78
  ret = [m[1], m[2], m[3]]
77
79
  spanclass = LOCALITY2SPAN[type.to_sym] and
78
80
  ret[1] = "<span class='#{spanclass}'>#{ret[1]}</span>"
@@ -119,11 +121,10 @@ module IsoDoc
119
121
  def prefix_container_template(container, node, target)
120
122
  nested_xref = @i18n.nested_xref
121
123
  container_label = anchor_xref(node, container)
122
- if @xrefs.anchor(target, :type) == "listitem"
123
- if !@xrefs.anchor(target, :refer_list)
124
+ if @xrefs.anchor(target, :type) == "listitem" &&
125
+ !@xrefs.anchor(target, :refer_list)
124
126
  nested_xref = "%1 %2"
125
127
  # n = @xrefs.anchor(container, :label) and container_label = n
126
- end
127
128
  end
128
129
  [nested_xref, container_label]
129
130
  end
@@ -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>
@@ -90,7 +90,7 @@ module Metanorma
90
90
  super
91
91
  end
92
92
 
93
- def term_children_cleanup(xmldoc)
93
+ def terms_terms_cleanup(xmldoc)
94
94
  @vocab and return
95
95
  super
96
96
  end
@@ -111,7 +111,7 @@ module Metanorma
111
111
  def editorial_groups_agency(xmldoc)
112
112
  pubs = extract_publishers(xmldoc)
113
113
  xmldoc.xpath("//bibdata/ext/editorialgroup").each do |e|
114
- pubs.reverse.each do |p|
114
+ pubs.reverse_each do |p|
115
115
  if e.children.empty? then e << "<agency>#{p}</agency>"
116
116
  else e.children.first.previous = "<agency>#{p}</agency>"
117
117
  end
@@ -87,7 +87,7 @@ module Metanorma
87
87
  type: get_typeabbr(node),
88
88
  publisher: pub[0],
89
89
  unpublished: /^[0-5]/.match?(get_stage(node)),
90
- copublisher: pub[1..-1] }
90
+ copublisher: pub[1..] }
91
91
  ret[:copublisher].empty? and ret.delete(:copublisher)
92
92
  compact_blank(ret)
93
93
  end
@@ -166,19 +166,19 @@ module Metanorma
166
166
  end
167
167
 
168
168
  def iso_id_out_common(xml, params, with_prf)
169
- xml.docidentifier iso_id_default(params).to_s(with_prf: with_prf),
169
+ xml.docidentifier iso_id_default(params).to_s(with_prf:),
170
170
  **attr_code(type: "ISO", primary: "true")
171
171
  xml.docidentifier iso_id_reference(params)
172
- .to_s(format: :ref_num_short, with_prf: with_prf),
172
+ .to_s(format: :ref_num_short, with_prf:),
173
173
  **attr_code(type: "iso-reference")
174
174
  xml.docidentifier iso_id_reference(params).urn, **attr_code(type: "URN")
175
175
  end
176
176
 
177
177
  def iso_id_out_non_amd(xml, params, with_prf)
178
- xml.docidentifier iso_id_undated(params).to_s(with_prf: with_prf),
178
+ xml.docidentifier iso_id_undated(params).to_s(with_prf:),
179
179
  **attr_code(type: "iso-undated")
180
180
  xml.docidentifier iso_id_with_lang(params)
181
- .to_s(format: :ref_num_long, with_prf: with_prf),
181
+ .to_s(format: :ref_num_long, with_prf:),
182
182
  **attr_code(type: "iso-with-lang")
183
183
  end
184
184
 
@@ -218,7 +218,7 @@ module Metanorma
218
218
  part, subpart = node&.attr("partnumber")&.split("-")
219
219
  xml.structuredidentifier do |i|
220
220
  i.project_number(node.attr("docnumber"), **attr_code(
221
- part: part, subpart: subpart,
221
+ part:, subpart:,
222
222
  amendment: node.attr("amendment-number"),
223
223
  corrigendum: node.attr("corrigendum-number"),
224
224
  origyr: node.attr("created-date")
@@ -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 ISO
3
- VERSION = "2.8.3".freeze
3
+ VERSION = "2.8.5".freeze
4
4
  end
5
5
  end
@@ -19,7 +19,7 @@ journaltemplate: "<em>{% if series_abbr %}{{series_abbr}}{% else %}{{series_titl
19
19
  template:
20
20
  # skip standardidentifier, it is inserted in front of formattedref within metanorma
21
21
  standard: "{% if home_standard %}<em><span_class='stddocTitle'>{{ title }}</span></em> ,_{{ extent }}{% else %}<smallcap>{{ creatornames }}</smallcap>. <em><span_class='stddocTitle'>{{ title }}</span></em> ,_{{ extent }} . {{ labels['version'] | capitalize }}_{{ edition_raw }}. {{labels['updated'] | capitalize }}_{{date_updated}}. {{status | capitalize}}. {{ authorizer }}. {{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>.{% endif %}"
22
- website: "<smallcap>{{ creatornames }}</smallcap> ({{ role }}) . <em><span_class='stddocTitle'>{{ title }}</span></em> [website]. {{ labels['version'] | capitalize }}_{{ edition_raw }}. {{place}}: {{ publisher }}. {{date}}. {{ labels['updated'] | capitalize }}:_{{date_updated}}. ._{{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>. [{{ labels['viewed'] }}:_{{date_accessed}}]. "
22
+ website: "<smallcap>{{ creatornames }}</smallcap> ({{ role }}) . <em><span_class='stddocTitle'>{{ title }}</span></em> [{{ labels['website'] }}]. {{ labels['version'] | capitalize }}_{{ edition_raw }}. {{place}}: {{ publisher }}. {{date}}. {{ labels['updated'] | capitalize }}:_{{date_updated}}. ._{{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>. [{{ labels['viewed'] }}:_{{date_accessed}}]. "
23
23
  book: "<smallcap>{{ creatornames }}</smallcap> ({{role}}) . <em>{{ title }}</em> . {{ edition | capitalize_first }}. ({{ series }}). {% if place %}{{place}}{%else%}{{ labels['no_place']}}{%endif%}: {{publisher}}. {{date}}. {{size}}. {{extent}}. ._{{ labels['availablefrom'] }}:_<span_class='biburl'>{{ uri }}</span>. {{ labels['at'] | capitalize}}:_{{ access_location }}. [{{ labels['viewed'] }}:_{{date_accessed}}]."
24
24
  booklet: book
25
25
  manual: book
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.3
4
+ version: 2.8.5
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-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-standoc