metanorma-cc 2.4.2 → 2.4.3

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: 9addb36ecc8d1ecba39442e834158ad429cd49fea376d5b8493898c1c5d2811a
4
- data.tar.gz: 299a019aaa48c9b41de0e09c5eaf9effe2da3b2f6712c010c1c54cfe86773d16
3
+ metadata.gz: 32bfaf3f86ecb540428f86505f79864dd157364fbeb6fccf10c181cbeb58b2be
4
+ data.tar.gz: adfd87a733968a6a3f6433819f1e525673fe269195cc3796053b29f7d6e30ee8
5
5
  SHA512:
6
- metadata.gz: 2cb26abbc7ca5b7539e5cefd4679a56d257438d1471d052a4ffc6c5d666f6f79cf7132ae96b03aa562e4a0611d08847314a506303e11bb3cc10ebb654f0467b7
7
- data.tar.gz: 73bacd9658eab6e13961d77b476fd021d37a3ac90cbf535684fa0d0031ea86e9ddde0d023e2bd55f3fe9e81b3f59e4b87cd5425e253d6f954337df1e24893d64
6
+ metadata.gz: '098d32219289258a4427b7f0f0b86c66086b49a0346465dd05081216a8bf788a93781a03af337029759fe579e266b2c51ed7c54ea90a3840f158e8d93470079a'
7
+ data.tar.gz: a1a92edfde8b3a32a187f3516c3092ff3527e459360aee45e9a4c82542bd16889434dea7c1015877f5de5565f9d8762f226895d43fe58af72896da12121f5bc4
@@ -586,6 +586,8 @@
586
586
  <xsl:param name="svg_images"/> <!-- svg images array -->
587
587
  <xsl:variable name="images" select="document($svg_images)"/>
588
588
  <xsl:param name="basepath"/> <!-- base path for images -->
589
+ <xsl:param name="inputxml_basepath"/> <!-- input xml file path -->
590
+ <xsl:param name="inputxml_filename"/> <!-- input xml file name -->
589
591
  <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
590
592
  <xsl:param name="syntax-highlight">false</xsl:param> <!-- syntax highlighting feature, default - off -->
591
593
  <xsl:param name="add_math_as_text">true</xsl:param> <!-- add math in text behind svg formula, to copy-paste formula from PDF as text -->
@@ -638,6 +640,20 @@
638
640
  <xsl:call-template name="getLang"/>
639
641
  </xsl:variable>
640
642
 
643
+ <xsl:variable name="inputxml_filename_prefix">
644
+ <xsl:choose>
645
+ <xsl:when test="contains($inputxml_filename, '.presentation.xml')">
646
+ <xsl:value-of select="substring-before($inputxml_filename, '.presentation.xml')"/>
647
+ </xsl:when>
648
+ <xsl:when test="contains($inputxml_filename, '.xml')">
649
+ <xsl:value-of select="substring-before($inputxml_filename, '.xml')"/>
650
+ </xsl:when>
651
+ <xsl:otherwise>
652
+ <xsl:value-of select="$inputxml_filename"/>
653
+ </xsl:otherwise>
654
+ </xsl:choose>
655
+ </xsl:variable>
656
+
641
657
  <!-- Note 1: Each xslt has declated variable `namespace` that allows to set some properties, processing logic, etc. for concrete xslt.
642
658
  You can put such conditions by using xslt construction `xsl:if test="..."` or <xsl:choose><xsl:when test=""></xsl:when><xsl:otherwiste></xsl:otherwiste></xsl:choose>,
643
659
  BUT DON'T put any another conditions together with $namespace = '...' (such conditions will be ignored). For another conditions, please use nested xsl:if or xsl:choose -->
@@ -1535,6 +1551,10 @@
1535
1551
 
1536
1552
  </xsl:attribute-set>
1537
1553
 
1554
+ <xsl:template name="refine_figure-block-style">
1555
+
1556
+ </xsl:template>
1557
+
1538
1558
  <xsl:attribute-set name="figure-style">
1539
1559
 
1540
1560
  </xsl:attribute-set>
@@ -2430,7 +2450,7 @@
2430
2450
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
2431
2451
 
2432
2452
  <xsl:variable name="colwidths">
2433
- <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
2453
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col']) and not(@class = 'dl')">
2434
2454
  <xsl:call-template name="calculate-column-widths">
2435
2455
  <xsl:with-param name="cols-count" select="$cols-count"/>
2436
2456
  <xsl:with-param name="table" select="$simple-table"/>
@@ -2542,6 +2562,11 @@
2542
2562
  <fo:table-column column-width="{@width}"/>
2543
2563
  </xsl:for-each>
2544
2564
  </xsl:when>
2565
+ <xsl:when test="@class = 'dl'">
2566
+ <xsl:for-each select=".//*[local-name()='tr'][1]/*">
2567
+ <fo:table-column column-width="{@width}"/>
2568
+ </xsl:for-each>
2569
+ </xsl:when>
2545
2570
  <xsl:otherwise>
2546
2571
  <xsl:call-template name="insertTableColumnWidth">
2547
2572
  <xsl:with-param name="colwidths" select="$colwidths"/>
@@ -3817,6 +3842,7 @@
3817
3842
  <!-- ===================== -->
3818
3843
  <!-- Definition List -->
3819
3844
  <!-- ===================== -->
3845
+
3820
3846
  <xsl:template match="*[local-name()='dl']">
3821
3847
  <xsl:variable name="isAdded" select="@added"/>
3822
3848
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -4029,10 +4055,21 @@
4029
4055
  </xsl:variable>
4030
4056
 
4031
4057
  <xsl:variable name="colwidths">
4032
- <xsl:call-template name="calculate-column-widths">
4033
- <xsl:with-param name="cols-count" select="2"/>
4034
- <xsl:with-param name="table" select="$simple-table"/>
4035
- </xsl:call-template>
4058
+ <xsl:choose>
4059
+ <!-- dl from table[@class='dl'] -->
4060
+ <xsl:when test="*[local-name() = 'colgroup']">
4061
+ <autolayout/>
4062
+ <xsl:for-each select="*[local-name() = 'colgroup']/*[local-name() = 'col']">
4063
+ <column><xsl:value-of select="translate(@width,'%m','')"/></column>
4064
+ </xsl:for-each>
4065
+ </xsl:when>
4066
+ <xsl:otherwise>
4067
+ <xsl:call-template name="calculate-column-widths">
4068
+ <xsl:with-param name="cols-count" select="2"/>
4069
+ <xsl:with-param name="table" select="$simple-table"/>
4070
+ </xsl:call-template>
4071
+ </xsl:otherwise>
4072
+ </xsl:choose>
4036
4073
  </xsl:variable>
4037
4074
 
4038
4075
  <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text>
@@ -6129,6 +6166,12 @@
6129
6166
  <xsl:when test="@updatetype = 'true'">
6130
6167
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
6131
6168
  </xsl:when>
6169
+ <xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
6170
+ <!-- link to the PDF attachment -->
6171
+ <xsl:variable name="target_" select="translate(@target, '\', '/')"/>
6172
+ <xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
6173
+ <xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
6174
+ </xsl:when>
6132
6175
  <xsl:otherwise>
6133
6176
  <xsl:value-of select="normalize-space(@target)"/>
6134
6177
  </xsl:otherwise>
@@ -6534,6 +6577,7 @@
6534
6577
  <xsl:variable name="isAdded" select="@added"/>
6535
6578
  <xsl:variable name="isDeleted" select="@deleted"/>
6536
6579
  <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
6580
+ <xsl:call-template name="refine_figure-block-style"/>
6537
6581
 
6538
6582
  <xsl:call-template name="setTrackChangesStyles">
6539
6583
  <xsl:with-param name="isAdded" select="$isAdded"/>
@@ -10902,10 +10946,10 @@
10902
10946
 
10903
10947
  <xsl:template name="addPDFUAmeta">
10904
10948
  <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
10905
- <pdf:dictionary type="normal" key="ViewerPreferences">
10906
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
10907
- </pdf:dictionary>
10908
- </pdf:catalog>
10949
+ <pdf:dictionary type="normal" key="ViewerPreferences">
10950
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
10951
+ </pdf:dictionary>
10952
+ </pdf:catalog>
10909
10953
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
10910
10954
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
10911
10955
  <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
@@ -10957,6 +11001,19 @@
10957
11001
  </rdf:Description>
10958
11002
  </rdf:RDF>
10959
11003
  </x:xmpmeta>
11004
+ <!-- add attachments -->
11005
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
11006
+ <xsl:choose>
11007
+ <xsl:when test="normalize-space() != ''">
11008
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{.}" filename="{@name}"/>
11009
+ </xsl:when>
11010
+ <xsl:otherwise>
11011
+ <!-- _{filename}_attachments -->
11012
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
11013
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
11014
+ </xsl:otherwise>
11015
+ </xsl:choose>
11016
+ </xsl:for-each>
10960
11017
  </xsl:template> <!-- addPDFUAmeta -->
10961
11018
 
10962
11019
  <xsl:template name="getId">
@@ -338,29 +338,32 @@
338
338
  </define>
339
339
  <define name="organization">
340
340
  <element name="organization">
341
- <oneOrMore>
342
- <ref name="orgname"/>
343
- </oneOrMore>
344
- <zeroOrMore>
345
- <ref name="subdivision"/>
346
- </zeroOrMore>
347
- <optional>
348
- <ref name="abbreviation"/>
349
- </optional>
350
- <zeroOrMore>
351
- <ref name="uri"/>
352
- </zeroOrMore>
353
- <zeroOrMore>
354
- <ref name="org-identifier"/>
355
- </zeroOrMore>
356
- <zeroOrMore>
357
- <ref name="contact"/>
358
- </zeroOrMore>
359
- <optional>
360
- <ref name="logo"/>
361
- </optional>
341
+ <ref name="OrganizationType"/>
362
342
  </element>
363
343
  </define>
344
+ <define name="OrganizationType">
345
+ <oneOrMore>
346
+ <ref name="orgname"/>
347
+ </oneOrMore>
348
+ <zeroOrMore>
349
+ <ref name="subdivision"/>
350
+ </zeroOrMore>
351
+ <optional>
352
+ <ref name="abbreviation"/>
353
+ </optional>
354
+ <zeroOrMore>
355
+ <ref name="uri"/>
356
+ </zeroOrMore>
357
+ <zeroOrMore>
358
+ <ref name="org-identifier"/>
359
+ </zeroOrMore>
360
+ <zeroOrMore>
361
+ <ref name="contact"/>
362
+ </zeroOrMore>
363
+ <optional>
364
+ <ref name="logo"/>
365
+ </optional>
366
+ </define>
364
367
  <define name="orgname">
365
368
  <element name="name">
366
369
  <choice>
@@ -371,10 +374,10 @@
371
374
  </define>
372
375
  <define name="subdivision">
373
376
  <element name="subdivision">
374
- <choice>
375
- <ref name="LocalizedString"/>
376
- <ref name="NameWithVariants"/>
377
- </choice>
377
+ <optional>
378
+ <attribute name="type"/>
379
+ </optional>
380
+ <ref name="OrganizationType"/>
378
381
  </element>
379
382
  </define>
380
383
  <define name="logo">
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module CC
3
- VERSION = "2.4.2".freeze
3
+ VERSION = "2.4.3".freeze
4
4
  end
5
5
  end
data/metanorma-cc.gemspec CHANGED
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.require_paths = ["lib"]
30
30
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
31
31
 
32
- spec.add_dependency "metanorma-generic", "~> 2.6.0"
32
+ spec.add_dependency "metanorma-generic", "~> 2.6.2"
33
33
 
34
34
  spec.add_development_dependency "debug"
35
35
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
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.4.2
4
+ version: 2.4.3
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-02-19 00:00:00.000000000 Z
11
+ date: 2024-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 2.6.0
19
+ version: 2.6.2
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 2.6.0
26
+ version: 2.6.2
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: debug
29
29
  requirement: !ruby/object:Gem::Requirement