metanorma-un 0.12.14 → 0.12.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 608ff96a451a25fcf3dbd20023d7c3ce1d5e68fa0a7f0d4950698879919525dd
4
- data.tar.gz: d37eb52c955f549428383103337e7ee8ed48c45ff540090225c1d0ce67b5c305
3
+ metadata.gz: a120825c98b7fc5972089995524436f6ddae471d46d1fc87437283a94623466e
4
+ data.tar.gz: 28407ef4700990a45545fc019a270e27dc79e689b43c87c0828c674c6df26fa3
5
5
  SHA512:
6
- metadata.gz: 64f84bcabd48d7ca9c4d67d91158dc6ad66cd001df767e4e901207516a383e94ceee48be0ba65f9f786f65c1fe1d769e816d1f4e6713a32ad7bb3f927cdb3664
7
- data.tar.gz: ddccafd416bc040e09b637632247081fcadc9d19e8d2bb6fdc42f8b071d8342566700cbee0b6b985d5373a27a2427bcceee61707f0350a423b8cac9e245b8009
6
+ metadata.gz: 3f20bf9892286d35c707bdc4a5db907d57bca4b2b7448fa81b0f6ca1349cee3fb5a8063f9da770d2846c1ace9ff295d6810e4030fc7e6576a84df08c9578a0ba
7
+ data.tar.gz: 6e3bd86f8fee8a0a2aca2eaa9aa55432c90d8f07303edd20974c212e5ec08b55acdd6a468afa650b50bb6a2ba743ee7098130d26c2db71902a618f5182306069
@@ -229,6 +229,46 @@ h6:hover > a.anchor,
229
229
  .inline-header:hover > a.anchor {
230
230
  visibility: visible; }
231
231
 
232
+ /* collapsible snippets: collapsible before hidable */
233
+ .hidable {
234
+ max-height: 0;
235
+ overflow: hidden;
236
+ transition: max-height 0.2s ease-out; }
237
+
238
+ .collapsible {
239
+ background-color: #777;
240
+ color: white;
241
+ cursor: pointer;
242
+ padding: 12px 0;
243
+ margin: 0;
244
+ width: 100%;
245
+ border: none;
246
+ text-align: left;
247
+ outline: none;
248
+ font-size: 15px; }
249
+
250
+ .active, .collapsible:hover {
251
+ background-color: #555; }
252
+
253
+ .collapsible:after {
254
+ content: '\25bc';
255
+ color: white;
256
+ font-weight: bold;
257
+ float: right;
258
+ margin-left: 12px;
259
+ margin-right: 12px; }
260
+
261
+ .active:after {
262
+ content: "\25b2"; }
263
+
264
+ /* collapsible: */
265
+ .collapsible + .hidable {
266
+ margin-top: 0; }
267
+
268
+ .collapsible:not(.active) + .hidable {
269
+ overflow: hidden;
270
+ padding: 0; }
271
+
232
272
  #standard-band {
233
273
  background-color: #0AC442; }
234
274
 
@@ -2720,13 +2720,35 @@
2720
2720
  </xsl:for-each>
2721
2721
  </xsl:element>
2722
2722
 
2723
- <xsl:call-template name="insertAnnexInSeparatePageSequences"/>
2723
+ <xsl:call-template name="insertAnnexAndBibliographyInSeparatePageSequences"/>
2724
2724
 
2725
- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/>
2725
+ <!-- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/> -->
2726
2726
 
2727
2727
  <!-- <xsl:call-template name="insertIndexInSeparatePageSequences"/> -->
2728
2728
  </xsl:template> <!-- END: insertMainSectionsInSeparatePageSequences -->
2729
2729
 
2730
+ <xsl:template name="insertAnnexAndBibliographyInSeparatePageSequences">
2731
+ <xsl:for-each select="/*/*[local-name()='annex'] | /*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]] | /*/*[local-name()='indexsect']">
2732
+ <xsl:sort select="@displayorder" data-type="number"/>
2733
+ <xsl:choose>
2734
+ <xsl:when test="local-name() = 'annex' or local-name() = 'indexsect'">
2735
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
2736
+ <xsl:attribute name="main_page_sequence"/>
2737
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
2738
+ </xsl:element>
2739
+ </xsl:when>
2740
+ <xsl:otherwise> <!-- bibliography -->
2741
+ <xsl:element name="bibliography" namespace="{$namespace_full}"> <!-- save context element -->
2742
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
2743
+ <xsl:attribute name="main_page_sequence"/>
2744
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
2745
+ </xsl:element>
2746
+ </xsl:element>
2747
+ </xsl:otherwise>
2748
+ </xsl:choose>
2749
+ </xsl:for-each>
2750
+ </xsl:template>
2751
+
2730
2752
  <xsl:template name="insertAnnexInSeparatePageSequences">
2731
2753
  <xsl:for-each select="/*/*[local-name()='annex']">
2732
2754
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -6913,18 +6935,33 @@
6913
6935
 
6914
6936
  <xsl:template match="*[local-name()='localityStack']"/>
6915
6937
 
6938
+ <xsl:variable name="pdfAttachmentsList_">
6939
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
6940
+ <attachment filename="{@name}"/>
6941
+ </xsl:for-each>
6942
+ </xsl:variable>
6943
+ <xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
6944
+
6916
6945
  <xsl:template match="*[local-name()='link']" name="link">
6946
+ <xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
6947
+ <xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
6917
6948
  <xsl:variable name="target">
6918
6949
  <xsl:choose>
6919
6950
  <xsl:when test="@updatetype = 'true'">
6920
6951
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
6921
6952
  </xsl:when>
6953
+ <!-- link to the PDF attachment -->
6954
+ <xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
6955
+ <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
6956
+ </xsl:when>
6957
+ <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
6958
+ <xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
6959
+ </xsl:when>
6922
6960
  <xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
6923
- <!-- link to the PDF attachment -->
6924
6961
  <xsl:variable name="target_" select="translate(@target, '\', '/')"/>
6925
6962
  <xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
6926
6963
  <xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
6927
- </xsl:when>
6964
+ </xsl:when> -->
6928
6965
  <xsl:otherwise>
6929
6966
  <xsl:value-of select="normalize-space(@target)"/>
6930
6967
  </xsl:otherwise>
@@ -11517,6 +11554,19 @@
11517
11554
  <xsl:copy-of select="."/>
11518
11555
  </xsl:template>
11519
11556
 
11557
+ <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
11558
+ <xsl:copy>
11559
+ <xsl:copy-of select="@*"/>
11560
+ <xsl:if test="1 = 2"> <!-- remove attachment/text(), because attachments added in the template 'addPDFUAmeta' before applying 'update_xml_step1' -->
11561
+ <xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
11562
+ <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
11563
+ <xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
11564
+ <xsl:value-of select="normalize-space(.)"/>
11565
+ </xsl:if>
11566
+ </xsl:if>
11567
+ </xsl:copy>
11568
+ </xsl:template>
11569
+
11520
11570
  <!-- add @id, mandatory for table auto-layout algorithm -->
11521
11571
  <xsl:template match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
11522
11572
  <xsl:copy>
@@ -12387,11 +12437,13 @@
12387
12437
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
12388
12438
  <xsl:choose>
12389
12439
  <xsl:when test="normalize-space() != ''">
12390
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{.}" filename="{@name}"/>
12440
+ <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
12441
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$src_attachment}" filename="{@name}"/>
12391
12442
  </xsl:when>
12392
12443
  <xsl:otherwise>
12393
12444
  <!-- _{filename}_attachments -->
12394
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
12445
+ <!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
12446
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
12395
12447
  <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
12396
12448
  </xsl:otherwise>
12397
12449
  </xsl:choose>
@@ -2720,13 +2720,35 @@
2720
2720
  </xsl:for-each>
2721
2721
  </xsl:element>
2722
2722
 
2723
- <xsl:call-template name="insertAnnexInSeparatePageSequences"/>
2723
+ <xsl:call-template name="insertAnnexAndBibliographyInSeparatePageSequences"/>
2724
2724
 
2725
- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/>
2725
+ <!-- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/> -->
2726
2726
 
2727
2727
  <!-- <xsl:call-template name="insertIndexInSeparatePageSequences"/> -->
2728
2728
  </xsl:template> <!-- END: insertMainSectionsInSeparatePageSequences -->
2729
2729
 
2730
+ <xsl:template name="insertAnnexAndBibliographyInSeparatePageSequences">
2731
+ <xsl:for-each select="/*/*[local-name()='annex'] | /*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]] | /*/*[local-name()='indexsect']">
2732
+ <xsl:sort select="@displayorder" data-type="number"/>
2733
+ <xsl:choose>
2734
+ <xsl:when test="local-name() = 'annex' or local-name() = 'indexsect'">
2735
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
2736
+ <xsl:attribute name="main_page_sequence"/>
2737
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
2738
+ </xsl:element>
2739
+ </xsl:when>
2740
+ <xsl:otherwise> <!-- bibliography -->
2741
+ <xsl:element name="bibliography" namespace="{$namespace_full}"> <!-- save context element -->
2742
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
2743
+ <xsl:attribute name="main_page_sequence"/>
2744
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
2745
+ </xsl:element>
2746
+ </xsl:element>
2747
+ </xsl:otherwise>
2748
+ </xsl:choose>
2749
+ </xsl:for-each>
2750
+ </xsl:template>
2751
+
2730
2752
  <xsl:template name="insertAnnexInSeparatePageSequences">
2731
2753
  <xsl:for-each select="/*/*[local-name()='annex']">
2732
2754
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -6913,18 +6935,33 @@
6913
6935
 
6914
6936
  <xsl:template match="*[local-name()='localityStack']"/>
6915
6937
 
6938
+ <xsl:variable name="pdfAttachmentsList_">
6939
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
6940
+ <attachment filename="{@name}"/>
6941
+ </xsl:for-each>
6942
+ </xsl:variable>
6943
+ <xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
6944
+
6916
6945
  <xsl:template match="*[local-name()='link']" name="link">
6946
+ <xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
6947
+ <xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
6917
6948
  <xsl:variable name="target">
6918
6949
  <xsl:choose>
6919
6950
  <xsl:when test="@updatetype = 'true'">
6920
6951
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
6921
6952
  </xsl:when>
6953
+ <!-- link to the PDF attachment -->
6954
+ <xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
6955
+ <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
6956
+ </xsl:when>
6957
+ <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
6958
+ <xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
6959
+ </xsl:when>
6922
6960
  <xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
6923
- <!-- link to the PDF attachment -->
6924
6961
  <xsl:variable name="target_" select="translate(@target, '\', '/')"/>
6925
6962
  <xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
6926
6963
  <xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
6927
- </xsl:when>
6964
+ </xsl:when> -->
6928
6965
  <xsl:otherwise>
6929
6966
  <xsl:value-of select="normalize-space(@target)"/>
6930
6967
  </xsl:otherwise>
@@ -11517,6 +11554,19 @@
11517
11554
  <xsl:copy-of select="."/>
11518
11555
  </xsl:template>
11519
11556
 
11557
+ <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
11558
+ <xsl:copy>
11559
+ <xsl:copy-of select="@*"/>
11560
+ <xsl:if test="1 = 2"> <!-- remove attachment/text(), because attachments added in the template 'addPDFUAmeta' before applying 'update_xml_step1' -->
11561
+ <xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
11562
+ <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
11563
+ <xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
11564
+ <xsl:value-of select="normalize-space(.)"/>
11565
+ </xsl:if>
11566
+ </xsl:if>
11567
+ </xsl:copy>
11568
+ </xsl:template>
11569
+
11520
11570
  <!-- add @id, mandatory for table auto-layout algorithm -->
11521
11571
  <xsl:template match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
11522
11572
  <xsl:copy>
@@ -12387,11 +12437,13 @@
12387
12437
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
12388
12438
  <xsl:choose>
12389
12439
  <xsl:when test="normalize-space() != ''">
12390
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{.}" filename="{@name}"/>
12440
+ <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
12441
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$src_attachment}" filename="{@name}"/>
12391
12442
  </xsl:when>
12392
12443
  <xsl:otherwise>
12393
12444
  <!-- _{filename}_attachments -->
12394
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
12445
+ <!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
12446
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
12395
12447
  <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
12396
12448
  </xsl:otherwise>
12397
12449
  </xsl:choose>
@@ -2823,13 +2823,35 @@
2823
2823
  </xsl:for-each>
2824
2824
  </xsl:element>
2825
2825
 
2826
- <xsl:call-template name="insertAnnexInSeparatePageSequences"/>
2826
+ <xsl:call-template name="insertAnnexAndBibliographyInSeparatePageSequences"/>
2827
2827
 
2828
- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/>
2828
+ <!-- <xsl:call-template name="insertBibliographyInSeparatePageSequences"/> -->
2829
2829
 
2830
2830
  <!-- <xsl:call-template name="insertIndexInSeparatePageSequences"/> -->
2831
2831
  </xsl:template> <!-- END: insertMainSectionsInSeparatePageSequences -->
2832
2832
 
2833
+ <xsl:template name="insertAnnexAndBibliographyInSeparatePageSequences">
2834
+ <xsl:for-each select="/*/*[local-name()='annex'] | /*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]] | /*/*[local-name()='indexsect']">
2835
+ <xsl:sort select="@displayorder" data-type="number"/>
2836
+ <xsl:choose>
2837
+ <xsl:when test="local-name() = 'annex' or local-name() = 'indexsect'">
2838
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
2839
+ <xsl:attribute name="main_page_sequence"/>
2840
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
2841
+ </xsl:element>
2842
+ </xsl:when>
2843
+ <xsl:otherwise> <!-- bibliography -->
2844
+ <xsl:element name="bibliography" namespace="{$namespace_full}"> <!-- save context element -->
2845
+ <xsl:element name="page_sequence" namespace="{$namespace_full}">
2846
+ <xsl:attribute name="main_page_sequence"/>
2847
+ <xsl:apply-templates select="." mode="update_xml_step_move_pagebreak"/>
2848
+ </xsl:element>
2849
+ </xsl:element>
2850
+ </xsl:otherwise>
2851
+ </xsl:choose>
2852
+ </xsl:for-each>
2853
+ </xsl:template>
2854
+
2833
2855
  <xsl:template name="insertAnnexInSeparatePageSequences">
2834
2856
  <xsl:for-each select="/*/*[local-name()='annex']">
2835
2857
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -7012,18 +7034,33 @@
7012
7034
 
7013
7035
  <xsl:template match="*[local-name()='localityStack']"/>
7014
7036
 
7037
+ <xsl:variable name="pdfAttachmentsList_">
7038
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
7039
+ <attachment filename="{@name}"/>
7040
+ </xsl:for-each>
7041
+ </xsl:variable>
7042
+ <xsl:variable name="pdfAttachmentsList" select="xalan:nodeset($pdfAttachmentsList_)"/>
7043
+
7015
7044
  <xsl:template match="*[local-name()='link']" name="link">
7045
+ <xsl:variable name="target_normalized" select="translate(@target, '\', '/')"/>
7046
+ <xsl:variable name="target_attachment_name" select="substring-after($target_normalized, '_attachments/')"/>
7016
7047
  <xsl:variable name="target">
7017
7048
  <xsl:choose>
7018
7049
  <xsl:when test="@updatetype = 'true'">
7019
7050
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
7020
7051
  </xsl:when>
7052
+ <!-- link to the PDF attachment -->
7053
+ <xsl:when test="$pdfAttachmentsList//attachment[@filename = current()/@target]">
7054
+ <xsl:value-of select="concat('url(embedded-file:', @target, ')')"/>
7055
+ </xsl:when>
7056
+ <!-- <xsl:when test="starts-with($target_normalized, '_') and contains($target_normalized, '_attachments/') and $pdfAttachmentsList//attachment[@filename = $target_attachment_name]">
7057
+ <xsl:value-of select="concat('url(embedded-file:', $target_attachment_name, ')')"/>
7058
+ </xsl:when>
7021
7059
  <xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
7022
- <!-- link to the PDF attachment -->
7023
7060
  <xsl:variable name="target_" select="translate(@target, '\', '/')"/>
7024
7061
  <xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
7025
7062
  <xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
7026
- </xsl:when>
7063
+ </xsl:when> -->
7027
7064
  <xsl:otherwise>
7028
7065
  <xsl:value-of select="normalize-space(@target)"/>
7029
7066
  </xsl:otherwise>
@@ -11617,6 +11654,19 @@
11617
11654
  <xsl:copy-of select="."/>
11618
11655
  </xsl:template>
11619
11656
 
11657
+ <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
11658
+ <xsl:copy>
11659
+ <xsl:copy-of select="@*"/>
11660
+ <xsl:if test="1 = 2"> <!-- remove attachment/text(), because attachments added in the template 'addPDFUAmeta' before applying 'update_xml_step1' -->
11661
+ <xsl:variable name="name_filepath" select="concat($inputxml_basepath, @name)"/>
11662
+ <xsl:variable name="file_exists" select="normalize-space(java:exists(java:java.io.File.new($name_filepath)))"/>
11663
+ <xsl:if test="$file_exists = 'false'"> <!-- copy attachment content only if file on disk doesnt exist -->
11664
+ <xsl:value-of select="normalize-space(.)"/>
11665
+ </xsl:if>
11666
+ </xsl:if>
11667
+ </xsl:copy>
11668
+ </xsl:template>
11669
+
11620
11670
  <!-- add @id, mandatory for table auto-layout algorithm -->
11621
11671
  <xsl:template match="*[local-name() = 'dl' or local-name() = 'table'][not(@id)]" mode="update_xml_step1">
11622
11672
  <xsl:copy>
@@ -12487,11 +12537,13 @@
12487
12537
  <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
12488
12538
  <xsl:choose>
12489
12539
  <xsl:when test="normalize-space() != ''">
12490
- <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{.}" filename="{@name}"/>
12540
+ <xsl:variable name="src_attachment" select="java:replaceAll(java:java.lang.String.new(.),'(&#13;&#10;|&#13;|&#10;)', '')"/> <!-- remove line breaks -->
12541
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$src_attachment}" filename="{@name}"/>
12491
12542
  </xsl:when>
12492
12543
  <xsl:otherwise>
12493
12544
  <!-- _{filename}_attachments -->
12494
- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
12545
+ <!-- <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/> -->
12546
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath , @name, ')')"/>
12495
12547
  <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
12496
12548
  </xsl:otherwise>
12497
12549
  </xsl:choose>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module UN
3
- VERSION = "0.12.14".freeze
3
+ VERSION = "0.12.16".freeze
4
4
  end
5
5
  end
data/metanorma-un.gemspec CHANGED
@@ -31,7 +31,7 @@ Gem::Specification.new do |spec|
31
31
  spec.add_dependency "roman-numerals"
32
32
  spec.add_dependency "twitter_cldr"
33
33
 
34
- spec.add_dependency "metanorma-standoc", "~> 2.9.0"
34
+ spec.add_dependency "metanorma-standoc", "~> 2.9.3"
35
35
 
36
36
  spec.add_development_dependency "debug"
37
37
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
@@ -43,4 +43,5 @@ Gem::Specification.new do |spec|
43
43
  spec.add_development_dependency "sassc", "2.4.0"
44
44
  spec.add_development_dependency "simplecov", "~> 0.15"
45
45
  spec.add_development_dependency "timecop", "~> 0.9"
46
+ spec.add_development_dependency "xml-c14n"
46
47
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-un
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.14
4
+ version: 0.12.16
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-07-22 00:00:00.000000000 Z
11
+ date: 2024-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: iso-639
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 2.9.0
61
+ version: 2.9.3
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - "~>"
67
67
  - !ruby/object:Gem::Version
68
- version: 2.9.0
68
+ version: 2.9.3
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: debug
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -206,6 +206,20 @@ dependencies:
206
206
  - - "~>"
207
207
  - !ruby/object:Gem::Version
208
208
  version: '0.9'
209
+ - !ruby/object:Gem::Dependency
210
+ name: xml-c14n
211
+ requirement: !ruby/object:Gem::Requirement
212
+ requirements:
213
+ - - ">="
214
+ - !ruby/object:Gem::Version
215
+ version: '0'
216
+ type: :development
217
+ prerelease: false
218
+ version_requirements: !ruby/object:Gem::Requirement
219
+ requirements:
220
+ - - ">="
221
+ - !ruby/object:Gem::Version
222
+ version: '0'
209
223
  description: |
210
224
  Metanorma for UN documents.
211
225