metanorma-bipm 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: 7eb602eb1e3a061cfb4595fa167cb556c7e3ad8213a2c0044f34d3bfa76bedbe
4
- data.tar.gz: ce8aa00ad79e0e9b56bdd7f5933940f80f83daca3b5358d6047b8e08d72fad97
3
+ metadata.gz: c92b447fed05f3f1010833af20204d74e0efa7581976afe50e21d23a1099485d
4
+ data.tar.gz: 84930ea5876e5b440e19223c31d6155511f2834a65063f0117bee76715c86dbb
5
5
  SHA512:
6
- metadata.gz: aa10225870f9a01af02fadaffe417cb8c55ad1f0f632599d1fb4fdb73b5b972349eaa7144cbd71064f35dfa5cc7b64fdf3ecfc032f7abd355a86a40dedd25ba9
7
- data.tar.gz: 4c67eb90acb6000ec849df193cb43bc943ddf2ad001ce55a9f779e81822fdb06290b42144c92e6ee97d1916132a2f97c1416a2fbdf5f1d1f99bacf27714bc86a
6
+ metadata.gz: fed5df6db6cb68cf1f811fff0334fc4d482b1f3afd17d7e737224dd8d547a431c834ee5803305683aeedddd84215f954699d6a1da80f062d6b8b2910a8bff7e6
7
+ data.tar.gz: 98fa8882dfcd832a9331267163c48c0a4df869935443229dfc35407679a932aaa8065f1a4cf3aff9a75217c4cedd67e668be620ce056e4a514a8b599bb6eef1b
@@ -3876,6 +3876,8 @@
3876
3876
  <xsl:param name="svg_images"/> <!-- svg images array -->
3877
3877
  <xsl:variable name="images" select="document($svg_images)"/>
3878
3878
  <xsl:param name="basepath"/> <!-- base path for images -->
3879
+ <xsl:param name="inputxml_basepath"/> <!-- input xml file path -->
3880
+ <xsl:param name="inputxml_filename"/> <!-- input xml file name -->
3879
3881
  <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
3880
3882
  <xsl:param name="syntax-highlight">false</xsl:param> <!-- syntax highlighting feature, default - off -->
3881
3883
  <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 -->
@@ -3928,6 +3930,20 @@
3928
3930
  <xsl:call-template name="getLang"/>
3929
3931
  </xsl:variable>
3930
3932
 
3933
+ <xsl:variable name="inputxml_filename_prefix">
3934
+ <xsl:choose>
3935
+ <xsl:when test="contains($inputxml_filename, '.presentation.xml')">
3936
+ <xsl:value-of select="substring-before($inputxml_filename, '.presentation.xml')"/>
3937
+ </xsl:when>
3938
+ <xsl:when test="contains($inputxml_filename, '.xml')">
3939
+ <xsl:value-of select="substring-before($inputxml_filename, '.xml')"/>
3940
+ </xsl:when>
3941
+ <xsl:otherwise>
3942
+ <xsl:value-of select="$inputxml_filename"/>
3943
+ </xsl:otherwise>
3944
+ </xsl:choose>
3945
+ </xsl:variable>
3946
+
3931
3947
  <!-- Note 1: Each xslt has declated variable `namespace` that allows to set some properties, processing logic, etc. for concrete xslt.
3932
3948
  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>,
3933
3949
  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 -->
@@ -4876,6 +4892,14 @@
4876
4892
 
4877
4893
  </xsl:attribute-set>
4878
4894
 
4895
+ <xsl:template name="refine_figure-block-style">
4896
+
4897
+ <xsl:if test="*[local-name() = 'name']">
4898
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
4899
+ </xsl:if>
4900
+
4901
+ </xsl:template>
4902
+
4879
4903
  <xsl:attribute-set name="figure-style">
4880
4904
 
4881
4905
  </xsl:attribute-set>
@@ -5805,7 +5829,7 @@
5805
5829
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
5806
5830
 
5807
5831
  <xsl:variable name="colwidths">
5808
- <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
5832
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col']) and not(@class = 'dl')">
5809
5833
  <xsl:call-template name="calculate-column-widths">
5810
5834
  <xsl:with-param name="cols-count" select="$cols-count"/>
5811
5835
  <xsl:with-param name="table" select="$simple-table"/>
@@ -5923,6 +5947,11 @@
5923
5947
  <fo:table-column column-width="{@width}"/>
5924
5948
  </xsl:for-each>
5925
5949
  </xsl:when>
5950
+ <xsl:when test="@class = 'dl'">
5951
+ <xsl:for-each select=".//*[local-name()='tr'][1]/*">
5952
+ <fo:table-column column-width="{@width}"/>
5953
+ </xsl:for-each>
5954
+ </xsl:when>
5926
5955
  <xsl:otherwise>
5927
5956
  <xsl:call-template name="insertTableColumnWidth">
5928
5957
  <xsl:with-param name="colwidths" select="$colwidths"/>
@@ -7249,6 +7278,7 @@
7249
7278
  <!-- ===================== -->
7250
7279
  <!-- Definition List -->
7251
7280
  <!-- ===================== -->
7281
+
7252
7282
  <xsl:template match="*[local-name()='dl']">
7253
7283
  <xsl:variable name="isAdded" select="@added"/>
7254
7284
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -7462,10 +7492,21 @@
7462
7492
  </xsl:variable>
7463
7493
 
7464
7494
  <xsl:variable name="colwidths">
7465
- <xsl:call-template name="calculate-column-widths">
7466
- <xsl:with-param name="cols-count" select="2"/>
7467
- <xsl:with-param name="table" select="$simple-table"/>
7468
- </xsl:call-template>
7495
+ <xsl:choose>
7496
+ <!-- dl from table[@class='dl'] -->
7497
+ <xsl:when test="*[local-name() = 'colgroup']">
7498
+ <autolayout/>
7499
+ <xsl:for-each select="*[local-name() = 'colgroup']/*[local-name() = 'col']">
7500
+ <column><xsl:value-of select="translate(@width,'%m','')"/></column>
7501
+ </xsl:for-each>
7502
+ </xsl:when>
7503
+ <xsl:otherwise>
7504
+ <xsl:call-template name="calculate-column-widths">
7505
+ <xsl:with-param name="cols-count" select="2"/>
7506
+ <xsl:with-param name="table" select="$simple-table"/>
7507
+ </xsl:call-template>
7508
+ </xsl:otherwise>
7509
+ </xsl:choose>
7469
7510
  </xsl:variable>
7470
7511
 
7471
7512
  <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text>
@@ -9591,6 +9632,12 @@
9591
9632
  <xsl:when test="@updatetype = 'true'">
9592
9633
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
9593
9634
  </xsl:when>
9635
+ <xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
9636
+ <!-- link to the PDF attachment -->
9637
+ <xsl:variable name="target_" select="translate(@target, '\', '/')"/>
9638
+ <xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
9639
+ <xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
9640
+ </xsl:when>
9594
9641
  <xsl:otherwise>
9595
9642
  <xsl:value-of select="normalize-space(@target)"/>
9596
9643
  </xsl:otherwise>
@@ -10017,10 +10064,7 @@
10017
10064
  <xsl:variable name="isAdded" select="@added"/>
10018
10065
  <xsl:variable name="isDeleted" select="@deleted"/>
10019
10066
  <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
10020
-
10021
- <xsl:if test="*[local-name() = 'name']">
10022
- <xsl:attribute name="space-after">12pt</xsl:attribute>
10023
- </xsl:if>
10067
+ <xsl:call-template name="refine_figure-block-style"/>
10024
10068
 
10025
10069
  <xsl:call-template name="setTrackChangesStyles">
10026
10070
  <xsl:with-param name="isAdded" select="$isAdded"/>
@@ -14395,10 +14439,10 @@
14395
14439
 
14396
14440
  <xsl:template name="addPDFUAmeta">
14397
14441
  <pdf:catalog>
14398
- <pdf:dictionary type="normal" key="ViewerPreferences">
14399
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
14400
- </pdf:dictionary>
14401
- </pdf:catalog>
14442
+ <pdf:dictionary type="normal" key="ViewerPreferences">
14443
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
14444
+ </pdf:dictionary>
14445
+ </pdf:catalog>
14402
14446
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
14403
14447
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
14404
14448
  <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
@@ -14450,6 +14494,19 @@
14450
14494
  </rdf:Description>
14451
14495
  </rdf:RDF>
14452
14496
  </x:xmpmeta>
14497
+ <!-- add attachments -->
14498
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
14499
+ <xsl:choose>
14500
+ <xsl:when test="normalize-space() != ''">
14501
+ <pdf:embedded-file src="{.}" filename="{@name}"/>
14502
+ </xsl:when>
14503
+ <xsl:otherwise>
14504
+ <!-- _{filename}_attachments -->
14505
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
14506
+ <pdf:embedded-file src="{$url}" filename="{@name}"/>
14507
+ </xsl:otherwise>
14508
+ </xsl:choose>
14509
+ </xsl:for-each>
14453
14510
  </xsl:template> <!-- addPDFUAmeta -->
14454
14511
 
14455
14512
  <xsl:template name="getId">
@@ -3876,6 +3876,8 @@
3876
3876
  <xsl:param name="svg_images"/> <!-- svg images array -->
3877
3877
  <xsl:variable name="images" select="document($svg_images)"/>
3878
3878
  <xsl:param name="basepath"/> <!-- base path for images -->
3879
+ <xsl:param name="inputxml_basepath"/> <!-- input xml file path -->
3880
+ <xsl:param name="inputxml_filename"/> <!-- input xml file name -->
3879
3881
  <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
3880
3882
  <xsl:param name="syntax-highlight">false</xsl:param> <!-- syntax highlighting feature, default - off -->
3881
3883
  <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 -->
@@ -3928,6 +3930,20 @@
3928
3930
  <xsl:call-template name="getLang"/>
3929
3931
  </xsl:variable>
3930
3932
 
3933
+ <xsl:variable name="inputxml_filename_prefix">
3934
+ <xsl:choose>
3935
+ <xsl:when test="contains($inputxml_filename, '.presentation.xml')">
3936
+ <xsl:value-of select="substring-before($inputxml_filename, '.presentation.xml')"/>
3937
+ </xsl:when>
3938
+ <xsl:when test="contains($inputxml_filename, '.xml')">
3939
+ <xsl:value-of select="substring-before($inputxml_filename, '.xml')"/>
3940
+ </xsl:when>
3941
+ <xsl:otherwise>
3942
+ <xsl:value-of select="$inputxml_filename"/>
3943
+ </xsl:otherwise>
3944
+ </xsl:choose>
3945
+ </xsl:variable>
3946
+
3931
3947
  <!-- Note 1: Each xslt has declated variable `namespace` that allows to set some properties, processing logic, etc. for concrete xslt.
3932
3948
  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>,
3933
3949
  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 -->
@@ -4876,6 +4892,14 @@
4876
4892
 
4877
4893
  </xsl:attribute-set>
4878
4894
 
4895
+ <xsl:template name="refine_figure-block-style">
4896
+
4897
+ <xsl:if test="*[local-name() = 'name']">
4898
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
4899
+ </xsl:if>
4900
+
4901
+ </xsl:template>
4902
+
4879
4903
  <xsl:attribute-set name="figure-style">
4880
4904
 
4881
4905
  </xsl:attribute-set>
@@ -5805,7 +5829,7 @@
5805
5829
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
5806
5830
 
5807
5831
  <xsl:variable name="colwidths">
5808
- <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
5832
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col']) and not(@class = 'dl')">
5809
5833
  <xsl:call-template name="calculate-column-widths">
5810
5834
  <xsl:with-param name="cols-count" select="$cols-count"/>
5811
5835
  <xsl:with-param name="table" select="$simple-table"/>
@@ -5923,6 +5947,11 @@
5923
5947
  <fo:table-column column-width="{@width}"/>
5924
5948
  </xsl:for-each>
5925
5949
  </xsl:when>
5950
+ <xsl:when test="@class = 'dl'">
5951
+ <xsl:for-each select=".//*[local-name()='tr'][1]/*">
5952
+ <fo:table-column column-width="{@width}"/>
5953
+ </xsl:for-each>
5954
+ </xsl:when>
5926
5955
  <xsl:otherwise>
5927
5956
  <xsl:call-template name="insertTableColumnWidth">
5928
5957
  <xsl:with-param name="colwidths" select="$colwidths"/>
@@ -7249,6 +7278,7 @@
7249
7278
  <!-- ===================== -->
7250
7279
  <!-- Definition List -->
7251
7280
  <!-- ===================== -->
7281
+
7252
7282
  <xsl:template match="*[local-name()='dl']">
7253
7283
  <xsl:variable name="isAdded" select="@added"/>
7254
7284
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -7462,10 +7492,21 @@
7462
7492
  </xsl:variable>
7463
7493
 
7464
7494
  <xsl:variable name="colwidths">
7465
- <xsl:call-template name="calculate-column-widths">
7466
- <xsl:with-param name="cols-count" select="2"/>
7467
- <xsl:with-param name="table" select="$simple-table"/>
7468
- </xsl:call-template>
7495
+ <xsl:choose>
7496
+ <!-- dl from table[@class='dl'] -->
7497
+ <xsl:when test="*[local-name() = 'colgroup']">
7498
+ <autolayout/>
7499
+ <xsl:for-each select="*[local-name() = 'colgroup']/*[local-name() = 'col']">
7500
+ <column><xsl:value-of select="translate(@width,'%m','')"/></column>
7501
+ </xsl:for-each>
7502
+ </xsl:when>
7503
+ <xsl:otherwise>
7504
+ <xsl:call-template name="calculate-column-widths">
7505
+ <xsl:with-param name="cols-count" select="2"/>
7506
+ <xsl:with-param name="table" select="$simple-table"/>
7507
+ </xsl:call-template>
7508
+ </xsl:otherwise>
7509
+ </xsl:choose>
7469
7510
  </xsl:variable>
7470
7511
 
7471
7512
  <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text>
@@ -9591,6 +9632,12 @@
9591
9632
  <xsl:when test="@updatetype = 'true'">
9592
9633
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
9593
9634
  </xsl:when>
9635
+ <xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
9636
+ <!-- link to the PDF attachment -->
9637
+ <xsl:variable name="target_" select="translate(@target, '\', '/')"/>
9638
+ <xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
9639
+ <xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
9640
+ </xsl:when>
9594
9641
  <xsl:otherwise>
9595
9642
  <xsl:value-of select="normalize-space(@target)"/>
9596
9643
  </xsl:otherwise>
@@ -10017,10 +10064,7 @@
10017
10064
  <xsl:variable name="isAdded" select="@added"/>
10018
10065
  <xsl:variable name="isDeleted" select="@deleted"/>
10019
10066
  <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
10020
-
10021
- <xsl:if test="*[local-name() = 'name']">
10022
- <xsl:attribute name="space-after">12pt</xsl:attribute>
10023
- </xsl:if>
10067
+ <xsl:call-template name="refine_figure-block-style"/>
10024
10068
 
10025
10069
  <xsl:call-template name="setTrackChangesStyles">
10026
10070
  <xsl:with-param name="isAdded" select="$isAdded"/>
@@ -14395,10 +14439,10 @@
14395
14439
 
14396
14440
  <xsl:template name="addPDFUAmeta">
14397
14441
  <pdf:catalog>
14398
- <pdf:dictionary type="normal" key="ViewerPreferences">
14399
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
14400
- </pdf:dictionary>
14401
- </pdf:catalog>
14442
+ <pdf:dictionary type="normal" key="ViewerPreferences">
14443
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
14444
+ </pdf:dictionary>
14445
+ </pdf:catalog>
14402
14446
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
14403
14447
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
14404
14448
  <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
@@ -14450,6 +14494,19 @@
14450
14494
  </rdf:Description>
14451
14495
  </rdf:RDF>
14452
14496
  </x:xmpmeta>
14497
+ <!-- add attachments -->
14498
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
14499
+ <xsl:choose>
14500
+ <xsl:when test="normalize-space() != ''">
14501
+ <pdf:embedded-file src="{.}" filename="{@name}"/>
14502
+ </xsl:when>
14503
+ <xsl:otherwise>
14504
+ <!-- _{filename}_attachments -->
14505
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
14506
+ <pdf:embedded-file src="{$url}" filename="{@name}"/>
14507
+ </xsl:otherwise>
14508
+ </xsl:choose>
14509
+ </xsl:for-each>
14453
14510
  </xsl:template> <!-- addPDFUAmeta -->
14454
14511
 
14455
14512
  <xsl:template name="getId">
@@ -3876,6 +3876,8 @@
3876
3876
  <xsl:param name="svg_images"/> <!-- svg images array -->
3877
3877
  <xsl:variable name="images" select="document($svg_images)"/>
3878
3878
  <xsl:param name="basepath"/> <!-- base path for images -->
3879
+ <xsl:param name="inputxml_basepath"/> <!-- input xml file path -->
3880
+ <xsl:param name="inputxml_filename"/> <!-- input xml file name -->
3879
3881
  <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
3880
3882
  <xsl:param name="syntax-highlight">false</xsl:param> <!-- syntax highlighting feature, default - off -->
3881
3883
  <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 -->
@@ -3928,6 +3930,20 @@
3928
3930
  <xsl:call-template name="getLang"/>
3929
3931
  </xsl:variable>
3930
3932
 
3933
+ <xsl:variable name="inputxml_filename_prefix">
3934
+ <xsl:choose>
3935
+ <xsl:when test="contains($inputxml_filename, '.presentation.xml')">
3936
+ <xsl:value-of select="substring-before($inputxml_filename, '.presentation.xml')"/>
3937
+ </xsl:when>
3938
+ <xsl:when test="contains($inputxml_filename, '.xml')">
3939
+ <xsl:value-of select="substring-before($inputxml_filename, '.xml')"/>
3940
+ </xsl:when>
3941
+ <xsl:otherwise>
3942
+ <xsl:value-of select="$inputxml_filename"/>
3943
+ </xsl:otherwise>
3944
+ </xsl:choose>
3945
+ </xsl:variable>
3946
+
3931
3947
  <!-- Note 1: Each xslt has declated variable `namespace` that allows to set some properties, processing logic, etc. for concrete xslt.
3932
3948
  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>,
3933
3949
  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 -->
@@ -4876,6 +4892,14 @@
4876
4892
 
4877
4893
  </xsl:attribute-set>
4878
4894
 
4895
+ <xsl:template name="refine_figure-block-style">
4896
+
4897
+ <xsl:if test="*[local-name() = 'name']">
4898
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
4899
+ </xsl:if>
4900
+
4901
+ </xsl:template>
4902
+
4879
4903
  <xsl:attribute-set name="figure-style">
4880
4904
 
4881
4905
  </xsl:attribute-set>
@@ -5805,7 +5829,7 @@
5805
5829
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
5806
5830
 
5807
5831
  <xsl:variable name="colwidths">
5808
- <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
5832
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col']) and not(@class = 'dl')">
5809
5833
  <xsl:call-template name="calculate-column-widths">
5810
5834
  <xsl:with-param name="cols-count" select="$cols-count"/>
5811
5835
  <xsl:with-param name="table" select="$simple-table"/>
@@ -5923,6 +5947,11 @@
5923
5947
  <fo:table-column column-width="{@width}"/>
5924
5948
  </xsl:for-each>
5925
5949
  </xsl:when>
5950
+ <xsl:when test="@class = 'dl'">
5951
+ <xsl:for-each select=".//*[local-name()='tr'][1]/*">
5952
+ <fo:table-column column-width="{@width}"/>
5953
+ </xsl:for-each>
5954
+ </xsl:when>
5926
5955
  <xsl:otherwise>
5927
5956
  <xsl:call-template name="insertTableColumnWidth">
5928
5957
  <xsl:with-param name="colwidths" select="$colwidths"/>
@@ -7249,6 +7278,7 @@
7249
7278
  <!-- ===================== -->
7250
7279
  <!-- Definition List -->
7251
7280
  <!-- ===================== -->
7281
+
7252
7282
  <xsl:template match="*[local-name()='dl']">
7253
7283
  <xsl:variable name="isAdded" select="@added"/>
7254
7284
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -7462,10 +7492,21 @@
7462
7492
  </xsl:variable>
7463
7493
 
7464
7494
  <xsl:variable name="colwidths">
7465
- <xsl:call-template name="calculate-column-widths">
7466
- <xsl:with-param name="cols-count" select="2"/>
7467
- <xsl:with-param name="table" select="$simple-table"/>
7468
- </xsl:call-template>
7495
+ <xsl:choose>
7496
+ <!-- dl from table[@class='dl'] -->
7497
+ <xsl:when test="*[local-name() = 'colgroup']">
7498
+ <autolayout/>
7499
+ <xsl:for-each select="*[local-name() = 'colgroup']/*[local-name() = 'col']">
7500
+ <column><xsl:value-of select="translate(@width,'%m','')"/></column>
7501
+ </xsl:for-each>
7502
+ </xsl:when>
7503
+ <xsl:otherwise>
7504
+ <xsl:call-template name="calculate-column-widths">
7505
+ <xsl:with-param name="cols-count" select="2"/>
7506
+ <xsl:with-param name="table" select="$simple-table"/>
7507
+ </xsl:call-template>
7508
+ </xsl:otherwise>
7509
+ </xsl:choose>
7469
7510
  </xsl:variable>
7470
7511
 
7471
7512
  <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text>
@@ -9591,6 +9632,12 @@
9591
9632
  <xsl:when test="@updatetype = 'true'">
9592
9633
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
9593
9634
  </xsl:when>
9635
+ <xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
9636
+ <!-- link to the PDF attachment -->
9637
+ <xsl:variable name="target_" select="translate(@target, '\', '/')"/>
9638
+ <xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
9639
+ <xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
9640
+ </xsl:when>
9594
9641
  <xsl:otherwise>
9595
9642
  <xsl:value-of select="normalize-space(@target)"/>
9596
9643
  </xsl:otherwise>
@@ -10017,10 +10064,7 @@
10017
10064
  <xsl:variable name="isAdded" select="@added"/>
10018
10065
  <xsl:variable name="isDeleted" select="@deleted"/>
10019
10066
  <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
10020
-
10021
- <xsl:if test="*[local-name() = 'name']">
10022
- <xsl:attribute name="space-after">12pt</xsl:attribute>
10023
- </xsl:if>
10067
+ <xsl:call-template name="refine_figure-block-style"/>
10024
10068
 
10025
10069
  <xsl:call-template name="setTrackChangesStyles">
10026
10070
  <xsl:with-param name="isAdded" select="$isAdded"/>
@@ -14395,10 +14439,10 @@
14395
14439
 
14396
14440
  <xsl:template name="addPDFUAmeta">
14397
14441
  <pdf:catalog>
14398
- <pdf:dictionary type="normal" key="ViewerPreferences">
14399
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
14400
- </pdf:dictionary>
14401
- </pdf:catalog>
14442
+ <pdf:dictionary type="normal" key="ViewerPreferences">
14443
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
14444
+ </pdf:dictionary>
14445
+ </pdf:catalog>
14402
14446
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
14403
14447
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
14404
14448
  <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
@@ -14450,6 +14494,19 @@
14450
14494
  </rdf:Description>
14451
14495
  </rdf:RDF>
14452
14496
  </x:xmpmeta>
14497
+ <!-- add attachments -->
14498
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
14499
+ <xsl:choose>
14500
+ <xsl:when test="normalize-space() != ''">
14501
+ <pdf:embedded-file src="{.}" filename="{@name}"/>
14502
+ </xsl:when>
14503
+ <xsl:otherwise>
14504
+ <!-- _{filename}_attachments -->
14505
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
14506
+ <pdf:embedded-file src="{$url}" filename="{@name}"/>
14507
+ </xsl:otherwise>
14508
+ </xsl:choose>
14509
+ </xsl:for-each>
14453
14510
  </xsl:template> <!-- addPDFUAmeta -->
14454
14511
 
14455
14512
  <xsl:template name="getId">
@@ -3876,6 +3876,8 @@
3876
3876
  <xsl:param name="svg_images"/> <!-- svg images array -->
3877
3877
  <xsl:variable name="images" select="document($svg_images)"/>
3878
3878
  <xsl:param name="basepath"/> <!-- base path for images -->
3879
+ <xsl:param name="inputxml_basepath"/> <!-- input xml file path -->
3880
+ <xsl:param name="inputxml_filename"/> <!-- input xml file name -->
3879
3881
  <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
3880
3882
  <xsl:param name="syntax-highlight">false</xsl:param> <!-- syntax highlighting feature, default - off -->
3881
3883
  <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 -->
@@ -3928,6 +3930,20 @@
3928
3930
  <xsl:call-template name="getLang"/>
3929
3931
  </xsl:variable>
3930
3932
 
3933
+ <xsl:variable name="inputxml_filename_prefix">
3934
+ <xsl:choose>
3935
+ <xsl:when test="contains($inputxml_filename, '.presentation.xml')">
3936
+ <xsl:value-of select="substring-before($inputxml_filename, '.presentation.xml')"/>
3937
+ </xsl:when>
3938
+ <xsl:when test="contains($inputxml_filename, '.xml')">
3939
+ <xsl:value-of select="substring-before($inputxml_filename, '.xml')"/>
3940
+ </xsl:when>
3941
+ <xsl:otherwise>
3942
+ <xsl:value-of select="$inputxml_filename"/>
3943
+ </xsl:otherwise>
3944
+ </xsl:choose>
3945
+ </xsl:variable>
3946
+
3931
3947
  <!-- Note 1: Each xslt has declated variable `namespace` that allows to set some properties, processing logic, etc. for concrete xslt.
3932
3948
  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>,
3933
3949
  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 -->
@@ -4876,6 +4892,14 @@
4876
4892
 
4877
4893
  </xsl:attribute-set>
4878
4894
 
4895
+ <xsl:template name="refine_figure-block-style">
4896
+
4897
+ <xsl:if test="*[local-name() = 'name']">
4898
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
4899
+ </xsl:if>
4900
+
4901
+ </xsl:template>
4902
+
4879
4903
  <xsl:attribute-set name="figure-style">
4880
4904
 
4881
4905
  </xsl:attribute-set>
@@ -5805,7 +5829,7 @@
5805
5829
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
5806
5830
 
5807
5831
  <xsl:variable name="colwidths">
5808
- <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
5832
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col']) and not(@class = 'dl')">
5809
5833
  <xsl:call-template name="calculate-column-widths">
5810
5834
  <xsl:with-param name="cols-count" select="$cols-count"/>
5811
5835
  <xsl:with-param name="table" select="$simple-table"/>
@@ -5923,6 +5947,11 @@
5923
5947
  <fo:table-column column-width="{@width}"/>
5924
5948
  </xsl:for-each>
5925
5949
  </xsl:when>
5950
+ <xsl:when test="@class = 'dl'">
5951
+ <xsl:for-each select=".//*[local-name()='tr'][1]/*">
5952
+ <fo:table-column column-width="{@width}"/>
5953
+ </xsl:for-each>
5954
+ </xsl:when>
5926
5955
  <xsl:otherwise>
5927
5956
  <xsl:call-template name="insertTableColumnWidth">
5928
5957
  <xsl:with-param name="colwidths" select="$colwidths"/>
@@ -7249,6 +7278,7 @@
7249
7278
  <!-- ===================== -->
7250
7279
  <!-- Definition List -->
7251
7280
  <!-- ===================== -->
7281
+
7252
7282
  <xsl:template match="*[local-name()='dl']">
7253
7283
  <xsl:variable name="isAdded" select="@added"/>
7254
7284
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -7462,10 +7492,21 @@
7462
7492
  </xsl:variable>
7463
7493
 
7464
7494
  <xsl:variable name="colwidths">
7465
- <xsl:call-template name="calculate-column-widths">
7466
- <xsl:with-param name="cols-count" select="2"/>
7467
- <xsl:with-param name="table" select="$simple-table"/>
7468
- </xsl:call-template>
7495
+ <xsl:choose>
7496
+ <!-- dl from table[@class='dl'] -->
7497
+ <xsl:when test="*[local-name() = 'colgroup']">
7498
+ <autolayout/>
7499
+ <xsl:for-each select="*[local-name() = 'colgroup']/*[local-name() = 'col']">
7500
+ <column><xsl:value-of select="translate(@width,'%m','')"/></column>
7501
+ </xsl:for-each>
7502
+ </xsl:when>
7503
+ <xsl:otherwise>
7504
+ <xsl:call-template name="calculate-column-widths">
7505
+ <xsl:with-param name="cols-count" select="2"/>
7506
+ <xsl:with-param name="table" select="$simple-table"/>
7507
+ </xsl:call-template>
7508
+ </xsl:otherwise>
7509
+ </xsl:choose>
7469
7510
  </xsl:variable>
7470
7511
 
7471
7512
  <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text>
@@ -9591,6 +9632,12 @@
9591
9632
  <xsl:when test="@updatetype = 'true'">
9592
9633
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
9593
9634
  </xsl:when>
9635
+ <xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
9636
+ <!-- link to the PDF attachment -->
9637
+ <xsl:variable name="target_" select="translate(@target, '\', '/')"/>
9638
+ <xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
9639
+ <xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
9640
+ </xsl:when>
9594
9641
  <xsl:otherwise>
9595
9642
  <xsl:value-of select="normalize-space(@target)"/>
9596
9643
  </xsl:otherwise>
@@ -10017,10 +10064,7 @@
10017
10064
  <xsl:variable name="isAdded" select="@added"/>
10018
10065
  <xsl:variable name="isDeleted" select="@deleted"/>
10019
10066
  <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
10020
-
10021
- <xsl:if test="*[local-name() = 'name']">
10022
- <xsl:attribute name="space-after">12pt</xsl:attribute>
10023
- </xsl:if>
10067
+ <xsl:call-template name="refine_figure-block-style"/>
10024
10068
 
10025
10069
  <xsl:call-template name="setTrackChangesStyles">
10026
10070
  <xsl:with-param name="isAdded" select="$isAdded"/>
@@ -14395,10 +14439,10 @@
14395
14439
 
14396
14440
  <xsl:template name="addPDFUAmeta">
14397
14441
  <pdf:catalog>
14398
- <pdf:dictionary type="normal" key="ViewerPreferences">
14399
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
14400
- </pdf:dictionary>
14401
- </pdf:catalog>
14442
+ <pdf:dictionary type="normal" key="ViewerPreferences">
14443
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
14444
+ </pdf:dictionary>
14445
+ </pdf:catalog>
14402
14446
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
14403
14447
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
14404
14448
  <rdf:Description xmlns:pdf="http://ns.adobe.com/pdf/1.3/" xmlns:dc="http://purl.org/dc/elements/1.1/" rdf:about="">
@@ -14450,6 +14494,19 @@
14450
14494
  </rdf:Description>
14451
14495
  </rdf:RDF>
14452
14496
  </x:xmpmeta>
14497
+ <!-- add attachments -->
14498
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
14499
+ <xsl:choose>
14500
+ <xsl:when test="normalize-space() != ''">
14501
+ <pdf:embedded-file src="{.}" filename="{@name}"/>
14502
+ </xsl:when>
14503
+ <xsl:otherwise>
14504
+ <!-- _{filename}_attachments -->
14505
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
14506
+ <pdf:embedded-file src="{$url}" filename="{@name}"/>
14507
+ </xsl:otherwise>
14508
+ </xsl:choose>
14509
+ </xsl:for-each>
14453
14510
  </xsl:template> <!-- addPDFUAmeta -->
14454
14511
 
14455
14512
  <xsl:template name="getId">