metanorma-un 0.12.3 → 0.12.4

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: afef4ddbab8e145f16145d3073dab882a4655888e14361bfcd0cafa8df0df6f5
4
- data.tar.gz: 376ced8cee4bb57461c1aeaaf4dc93d1160da3e08cdc2aa455c5e30faff1d5c7
3
+ metadata.gz: 6a6a30ba559e99be775cb5171f13cd196f8a2f3f47416c6fe5125d4a3b2ae158
4
+ data.tar.gz: 5247a58efec6e008bbbe5e30bfd6838662e0c066d1105a8765c5c18d2e71381b
5
5
  SHA512:
6
- metadata.gz: e78e0ea377c90c1f10c2dad246747f34d52bcc4135bf4d5528cec7cad043f72fe1546bbe53057eaf0ade3bbc421e95f3d311d3ffe61fe4b52c94adc26143b146
7
- data.tar.gz: 5f951a6ac21e68a2bc21e4b60d855d8230f978d242fc96bbad62ca691287461cea5d9c8a8e686235510a0a2b5f7513f8eeda5483eddf855417d5f0d109541884
6
+ metadata.gz: 675bb2c90ca90d8e4c3401b5f14f0231a36370277d241bd3779499ba1d51ab6d327cbba318d3c19e9675cd9a33c911f7a87cf048d77c0540f3da9fd1c8f5762b
7
+ data.tar.gz: a5ed94230bf8b0a1bf4c2de826717cd1a07ee0ff2eb68a1e258aa57e64ed7f5db2e04e46cbfc86b7d1d99a6acb0c9a4e674e6d164cf5059a199af4ba510bd118
@@ -738,6 +738,8 @@
738
738
  <xsl:param name="svg_images"/> <!-- svg images array -->
739
739
  <xsl:variable name="images" select="document($svg_images)"/>
740
740
  <xsl:param name="basepath"/> <!-- base path for images -->
741
+ <xsl:param name="inputxml_basepath"/> <!-- input xml file path -->
742
+ <xsl:param name="inputxml_filename"/> <!-- input xml file name -->
741
743
  <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
742
744
  <xsl:param name="syntax-highlight">false</xsl:param> <!-- syntax highlighting feature, default - off -->
743
745
  <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 -->
@@ -790,6 +792,20 @@
790
792
  <xsl:call-template name="getLang"/>
791
793
  </xsl:variable>
792
794
 
795
+ <xsl:variable name="inputxml_filename_prefix">
796
+ <xsl:choose>
797
+ <xsl:when test="contains($inputxml_filename, '.presentation.xml')">
798
+ <xsl:value-of select="substring-before($inputxml_filename, '.presentation.xml')"/>
799
+ </xsl:when>
800
+ <xsl:when test="contains($inputxml_filename, '.xml')">
801
+ <xsl:value-of select="substring-before($inputxml_filename, '.xml')"/>
802
+ </xsl:when>
803
+ <xsl:otherwise>
804
+ <xsl:value-of select="$inputxml_filename"/>
805
+ </xsl:otherwise>
806
+ </xsl:choose>
807
+ </xsl:variable>
808
+
793
809
  <!-- Note 1: Each xslt has declated variable `namespace` that allows to set some properties, processing logic, etc. for concrete xslt.
794
810
  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>,
795
811
  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 -->
@@ -1696,6 +1712,10 @@
1696
1712
 
1697
1713
  </xsl:attribute-set>
1698
1714
 
1715
+ <xsl:template name="refine_figure-block-style">
1716
+
1717
+ </xsl:template>
1718
+
1699
1719
  <xsl:attribute-set name="figure-style">
1700
1720
 
1701
1721
  </xsl:attribute-set>
@@ -2606,7 +2626,7 @@
2606
2626
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
2607
2627
 
2608
2628
  <xsl:variable name="colwidths">
2609
- <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
2629
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col']) and not(@class = 'dl')">
2610
2630
  <xsl:call-template name="calculate-column-widths">
2611
2631
  <xsl:with-param name="cols-count" select="$cols-count"/>
2612
2632
  <xsl:with-param name="table" select="$simple-table"/>
@@ -2724,6 +2744,11 @@
2724
2744
  <fo:table-column column-width="{@width}"/>
2725
2745
  </xsl:for-each>
2726
2746
  </xsl:when>
2747
+ <xsl:when test="@class = 'dl'">
2748
+ <xsl:for-each select=".//*[local-name()='tr'][1]/*">
2749
+ <fo:table-column column-width="{@width}"/>
2750
+ </xsl:for-each>
2751
+ </xsl:when>
2727
2752
  <xsl:otherwise>
2728
2753
  <xsl:call-template name="insertTableColumnWidth">
2729
2754
  <xsl:with-param name="colwidths" select="$colwidths"/>
@@ -4000,6 +4025,7 @@
4000
4025
  <!-- ===================== -->
4001
4026
  <!-- Definition List -->
4002
4027
  <!-- ===================== -->
4028
+
4003
4029
  <xsl:template match="*[local-name()='dl']">
4004
4030
  <xsl:variable name="isAdded" select="@added"/>
4005
4031
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -4212,10 +4238,21 @@
4212
4238
  </xsl:variable>
4213
4239
 
4214
4240
  <xsl:variable name="colwidths">
4215
- <xsl:call-template name="calculate-column-widths">
4216
- <xsl:with-param name="cols-count" select="2"/>
4217
- <xsl:with-param name="table" select="$simple-table"/>
4218
- </xsl:call-template>
4241
+ <xsl:choose>
4242
+ <!-- dl from table[@class='dl'] -->
4243
+ <xsl:when test="*[local-name() = 'colgroup']">
4244
+ <autolayout/>
4245
+ <xsl:for-each select="*[local-name() = 'colgroup']/*[local-name() = 'col']">
4246
+ <column><xsl:value-of select="translate(@width,'%m','')"/></column>
4247
+ </xsl:for-each>
4248
+ </xsl:when>
4249
+ <xsl:otherwise>
4250
+ <xsl:call-template name="calculate-column-widths">
4251
+ <xsl:with-param name="cols-count" select="2"/>
4252
+ <xsl:with-param name="table" select="$simple-table"/>
4253
+ </xsl:call-template>
4254
+ </xsl:otherwise>
4255
+ </xsl:choose>
4219
4256
  </xsl:variable>
4220
4257
 
4221
4258
  <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text>
@@ -6309,6 +6346,12 @@
6309
6346
  <xsl:when test="@updatetype = 'true'">
6310
6347
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
6311
6348
  </xsl:when>
6349
+ <xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
6350
+ <!-- link to the PDF attachment -->
6351
+ <xsl:variable name="target_" select="translate(@target, '\', '/')"/>
6352
+ <xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
6353
+ <xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
6354
+ </xsl:when>
6312
6355
  <xsl:otherwise>
6313
6356
  <xsl:value-of select="normalize-space(@target)"/>
6314
6357
  </xsl:otherwise>
@@ -6727,6 +6770,7 @@
6727
6770
  <xsl:variable name="isAdded" select="@added"/>
6728
6771
  <xsl:variable name="isDeleted" select="@deleted"/>
6729
6772
  <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
6773
+ <xsl:call-template name="refine_figure-block-style"/>
6730
6774
 
6731
6775
  <xsl:call-template name="setTrackChangesStyles">
6732
6776
  <xsl:with-param name="isAdded" select="$isAdded"/>
@@ -11074,10 +11118,10 @@
11074
11118
 
11075
11119
  <xsl:template name="addPDFUAmeta">
11076
11120
  <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
11077
- <pdf:dictionary type="normal" key="ViewerPreferences">
11078
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
11079
- </pdf:dictionary>
11080
- </pdf:catalog>
11121
+ <pdf:dictionary type="normal" key="ViewerPreferences">
11122
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
11123
+ </pdf:dictionary>
11124
+ </pdf:catalog>
11081
11125
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
11082
11126
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
11083
11127
  <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
@@ -11129,6 +11173,19 @@
11129
11173
  </rdf:Description>
11130
11174
  </rdf:RDF>
11131
11175
  </x:xmpmeta>
11176
+ <!-- add attachments -->
11177
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
11178
+ <xsl:choose>
11179
+ <xsl:when test="normalize-space() != ''">
11180
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{.}" filename="{@name}"/>
11181
+ </xsl:when>
11182
+ <xsl:otherwise>
11183
+ <!-- _{filename}_attachments -->
11184
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
11185
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
11186
+ </xsl:otherwise>
11187
+ </xsl:choose>
11188
+ </xsl:for-each>
11132
11189
  </xsl:template> <!-- addPDFUAmeta -->
11133
11190
 
11134
11191
  <xsl:template name="getId">
@@ -738,6 +738,8 @@
738
738
  <xsl:param name="svg_images"/> <!-- svg images array -->
739
739
  <xsl:variable name="images" select="document($svg_images)"/>
740
740
  <xsl:param name="basepath"/> <!-- base path for images -->
741
+ <xsl:param name="inputxml_basepath"/> <!-- input xml file path -->
742
+ <xsl:param name="inputxml_filename"/> <!-- input xml file name -->
741
743
  <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
742
744
  <xsl:param name="syntax-highlight">false</xsl:param> <!-- syntax highlighting feature, default - off -->
743
745
  <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 -->
@@ -790,6 +792,20 @@
790
792
  <xsl:call-template name="getLang"/>
791
793
  </xsl:variable>
792
794
 
795
+ <xsl:variable name="inputxml_filename_prefix">
796
+ <xsl:choose>
797
+ <xsl:when test="contains($inputxml_filename, '.presentation.xml')">
798
+ <xsl:value-of select="substring-before($inputxml_filename, '.presentation.xml')"/>
799
+ </xsl:when>
800
+ <xsl:when test="contains($inputxml_filename, '.xml')">
801
+ <xsl:value-of select="substring-before($inputxml_filename, '.xml')"/>
802
+ </xsl:when>
803
+ <xsl:otherwise>
804
+ <xsl:value-of select="$inputxml_filename"/>
805
+ </xsl:otherwise>
806
+ </xsl:choose>
807
+ </xsl:variable>
808
+
793
809
  <!-- Note 1: Each xslt has declated variable `namespace` that allows to set some properties, processing logic, etc. for concrete xslt.
794
810
  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>,
795
811
  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 -->
@@ -1696,6 +1712,10 @@
1696
1712
 
1697
1713
  </xsl:attribute-set>
1698
1714
 
1715
+ <xsl:template name="refine_figure-block-style">
1716
+
1717
+ </xsl:template>
1718
+
1699
1719
  <xsl:attribute-set name="figure-style">
1700
1720
 
1701
1721
  </xsl:attribute-set>
@@ -2606,7 +2626,7 @@
2606
2626
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
2607
2627
 
2608
2628
  <xsl:variable name="colwidths">
2609
- <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
2629
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col']) and not(@class = 'dl')">
2610
2630
  <xsl:call-template name="calculate-column-widths">
2611
2631
  <xsl:with-param name="cols-count" select="$cols-count"/>
2612
2632
  <xsl:with-param name="table" select="$simple-table"/>
@@ -2724,6 +2744,11 @@
2724
2744
  <fo:table-column column-width="{@width}"/>
2725
2745
  </xsl:for-each>
2726
2746
  </xsl:when>
2747
+ <xsl:when test="@class = 'dl'">
2748
+ <xsl:for-each select=".//*[local-name()='tr'][1]/*">
2749
+ <fo:table-column column-width="{@width}"/>
2750
+ </xsl:for-each>
2751
+ </xsl:when>
2727
2752
  <xsl:otherwise>
2728
2753
  <xsl:call-template name="insertTableColumnWidth">
2729
2754
  <xsl:with-param name="colwidths" select="$colwidths"/>
@@ -4000,6 +4025,7 @@
4000
4025
  <!-- ===================== -->
4001
4026
  <!-- Definition List -->
4002
4027
  <!-- ===================== -->
4028
+
4003
4029
  <xsl:template match="*[local-name()='dl']">
4004
4030
  <xsl:variable name="isAdded" select="@added"/>
4005
4031
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -4212,10 +4238,21 @@
4212
4238
  </xsl:variable>
4213
4239
 
4214
4240
  <xsl:variable name="colwidths">
4215
- <xsl:call-template name="calculate-column-widths">
4216
- <xsl:with-param name="cols-count" select="2"/>
4217
- <xsl:with-param name="table" select="$simple-table"/>
4218
- </xsl:call-template>
4241
+ <xsl:choose>
4242
+ <!-- dl from table[@class='dl'] -->
4243
+ <xsl:when test="*[local-name() = 'colgroup']">
4244
+ <autolayout/>
4245
+ <xsl:for-each select="*[local-name() = 'colgroup']/*[local-name() = 'col']">
4246
+ <column><xsl:value-of select="translate(@width,'%m','')"/></column>
4247
+ </xsl:for-each>
4248
+ </xsl:when>
4249
+ <xsl:otherwise>
4250
+ <xsl:call-template name="calculate-column-widths">
4251
+ <xsl:with-param name="cols-count" select="2"/>
4252
+ <xsl:with-param name="table" select="$simple-table"/>
4253
+ </xsl:call-template>
4254
+ </xsl:otherwise>
4255
+ </xsl:choose>
4219
4256
  </xsl:variable>
4220
4257
 
4221
4258
  <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text>
@@ -6309,6 +6346,12 @@
6309
6346
  <xsl:when test="@updatetype = 'true'">
6310
6347
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
6311
6348
  </xsl:when>
6349
+ <xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
6350
+ <!-- link to the PDF attachment -->
6351
+ <xsl:variable name="target_" select="translate(@target, '\', '/')"/>
6352
+ <xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
6353
+ <xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
6354
+ </xsl:when>
6312
6355
  <xsl:otherwise>
6313
6356
  <xsl:value-of select="normalize-space(@target)"/>
6314
6357
  </xsl:otherwise>
@@ -6727,6 +6770,7 @@
6727
6770
  <xsl:variable name="isAdded" select="@added"/>
6728
6771
  <xsl:variable name="isDeleted" select="@deleted"/>
6729
6772
  <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
6773
+ <xsl:call-template name="refine_figure-block-style"/>
6730
6774
 
6731
6775
  <xsl:call-template name="setTrackChangesStyles">
6732
6776
  <xsl:with-param name="isAdded" select="$isAdded"/>
@@ -11074,10 +11118,10 @@
11074
11118
 
11075
11119
  <xsl:template name="addPDFUAmeta">
11076
11120
  <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
11077
- <pdf:dictionary type="normal" key="ViewerPreferences">
11078
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
11079
- </pdf:dictionary>
11080
- </pdf:catalog>
11121
+ <pdf:dictionary type="normal" key="ViewerPreferences">
11122
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
11123
+ </pdf:dictionary>
11124
+ </pdf:catalog>
11081
11125
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
11082
11126
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
11083
11127
  <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
@@ -11129,6 +11173,19 @@
11129
11173
  </rdf:Description>
11130
11174
  </rdf:RDF>
11131
11175
  </x:xmpmeta>
11176
+ <!-- add attachments -->
11177
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
11178
+ <xsl:choose>
11179
+ <xsl:when test="normalize-space() != ''">
11180
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{.}" filename="{@name}"/>
11181
+ </xsl:when>
11182
+ <xsl:otherwise>
11183
+ <!-- _{filename}_attachments -->
11184
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
11185
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
11186
+ </xsl:otherwise>
11187
+ </xsl:choose>
11188
+ </xsl:for-each>
11132
11189
  </xsl:template> <!-- addPDFUAmeta -->
11133
11190
 
11134
11191
  <xsl:template name="getId">
@@ -844,6 +844,8 @@
844
844
  <xsl:param name="svg_images"/> <!-- svg images array -->
845
845
  <xsl:variable name="images" select="document($svg_images)"/>
846
846
  <xsl:param name="basepath"/> <!-- base path for images -->
847
+ <xsl:param name="inputxml_basepath"/> <!-- input xml file path -->
848
+ <xsl:param name="inputxml_filename"/> <!-- input xml file name -->
847
849
  <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
848
850
  <xsl:param name="syntax-highlight">false</xsl:param> <!-- syntax highlighting feature, default - off -->
849
851
  <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 -->
@@ -896,6 +898,20 @@
896
898
  <xsl:call-template name="getLang"/>
897
899
  </xsl:variable>
898
900
 
901
+ <xsl:variable name="inputxml_filename_prefix">
902
+ <xsl:choose>
903
+ <xsl:when test="contains($inputxml_filename, '.presentation.xml')">
904
+ <xsl:value-of select="substring-before($inputxml_filename, '.presentation.xml')"/>
905
+ </xsl:when>
906
+ <xsl:when test="contains($inputxml_filename, '.xml')">
907
+ <xsl:value-of select="substring-before($inputxml_filename, '.xml')"/>
908
+ </xsl:when>
909
+ <xsl:otherwise>
910
+ <xsl:value-of select="$inputxml_filename"/>
911
+ </xsl:otherwise>
912
+ </xsl:choose>
913
+ </xsl:variable>
914
+
899
915
  <!-- Note 1: Each xslt has declated variable `namespace` that allows to set some properties, processing logic, etc. for concrete xslt.
900
916
  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>,
901
917
  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 -->
@@ -1819,6 +1835,10 @@
1819
1835
 
1820
1836
  </xsl:attribute-set>
1821
1837
 
1838
+ <xsl:template name="refine_figure-block-style">
1839
+
1840
+ </xsl:template>
1841
+
1822
1842
  <xsl:attribute-set name="figure-style">
1823
1843
 
1824
1844
  </xsl:attribute-set>
@@ -2737,7 +2757,7 @@
2737
2757
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
2738
2758
 
2739
2759
  <xsl:variable name="colwidths">
2740
- <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
2760
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col']) and not(@class = 'dl')">
2741
2761
  <xsl:call-template name="calculate-column-widths">
2742
2762
  <xsl:with-param name="cols-count" select="$cols-count"/>
2743
2763
  <xsl:with-param name="table" select="$simple-table"/>
@@ -2855,6 +2875,11 @@
2855
2875
  <fo:table-column column-width="{@width}"/>
2856
2876
  </xsl:for-each>
2857
2877
  </xsl:when>
2878
+ <xsl:when test="@class = 'dl'">
2879
+ <xsl:for-each select=".//*[local-name()='tr'][1]/*">
2880
+ <fo:table-column column-width="{@width}"/>
2881
+ </xsl:for-each>
2882
+ </xsl:when>
2858
2883
  <xsl:otherwise>
2859
2884
  <xsl:call-template name="insertTableColumnWidth">
2860
2885
  <xsl:with-param name="colwidths" select="$colwidths"/>
@@ -4127,6 +4152,7 @@
4127
4152
  <!-- ===================== -->
4128
4153
  <!-- Definition List -->
4129
4154
  <!-- ===================== -->
4155
+
4130
4156
  <xsl:template match="*[local-name()='dl']">
4131
4157
  <xsl:variable name="isAdded" select="@added"/>
4132
4158
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -4339,10 +4365,21 @@
4339
4365
  </xsl:variable>
4340
4366
 
4341
4367
  <xsl:variable name="colwidths">
4342
- <xsl:call-template name="calculate-column-widths">
4343
- <xsl:with-param name="cols-count" select="2"/>
4344
- <xsl:with-param name="table" select="$simple-table"/>
4345
- </xsl:call-template>
4368
+ <xsl:choose>
4369
+ <!-- dl from table[@class='dl'] -->
4370
+ <xsl:when test="*[local-name() = 'colgroup']">
4371
+ <autolayout/>
4372
+ <xsl:for-each select="*[local-name() = 'colgroup']/*[local-name() = 'col']">
4373
+ <column><xsl:value-of select="translate(@width,'%m','')"/></column>
4374
+ </xsl:for-each>
4375
+ </xsl:when>
4376
+ <xsl:otherwise>
4377
+ <xsl:call-template name="calculate-column-widths">
4378
+ <xsl:with-param name="cols-count" select="2"/>
4379
+ <xsl:with-param name="table" select="$simple-table"/>
4380
+ </xsl:call-template>
4381
+ </xsl:otherwise>
4382
+ </xsl:choose>
4346
4383
  </xsl:variable>
4347
4384
 
4348
4385
  <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text>
@@ -6436,6 +6473,12 @@
6436
6473
  <xsl:when test="@updatetype = 'true'">
6437
6474
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
6438
6475
  </xsl:when>
6476
+ <xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
6477
+ <!-- link to the PDF attachment -->
6478
+ <xsl:variable name="target_" select="translate(@target, '\', '/')"/>
6479
+ <xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
6480
+ <xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
6481
+ </xsl:when>
6439
6482
  <xsl:otherwise>
6440
6483
  <xsl:value-of select="normalize-space(@target)"/>
6441
6484
  </xsl:otherwise>
@@ -6854,6 +6897,7 @@
6854
6897
  <xsl:variable name="isAdded" select="@added"/>
6855
6898
  <xsl:variable name="isDeleted" select="@deleted"/>
6856
6899
  <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
6900
+ <xsl:call-template name="refine_figure-block-style"/>
6857
6901
 
6858
6902
  <xsl:call-template name="setTrackChangesStyles">
6859
6903
  <xsl:with-param name="isAdded" select="$isAdded"/>
@@ -11202,10 +11246,10 @@
11202
11246
 
11203
11247
  <xsl:template name="addPDFUAmeta">
11204
11248
  <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
11205
- <pdf:dictionary type="normal" key="ViewerPreferences">
11206
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
11207
- </pdf:dictionary>
11208
- </pdf:catalog>
11249
+ <pdf:dictionary type="normal" key="ViewerPreferences">
11250
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
11251
+ </pdf:dictionary>
11252
+ </pdf:catalog>
11209
11253
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
11210
11254
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
11211
11255
  <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
@@ -11257,6 +11301,19 @@
11257
11301
  </rdf:Description>
11258
11302
  </rdf:RDF>
11259
11303
  </x:xmpmeta>
11304
+ <!-- add attachments -->
11305
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
11306
+ <xsl:choose>
11307
+ <xsl:when test="normalize-space() != ''">
11308
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{.}" filename="{@name}"/>
11309
+ </xsl:when>
11310
+ <xsl:otherwise>
11311
+ <!-- _{filename}_attachments -->
11312
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
11313
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
11314
+ </xsl:otherwise>
11315
+ </xsl:choose>
11316
+ </xsl:for-each>
11260
11317
  </xsl:template> <!-- addPDFUAmeta -->
11261
11318
 
11262
11319
  <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 UN
3
- VERSION = "0.12.3".freeze
3
+ VERSION = "0.12.4".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.8.2"
34
+ spec.add_dependency "metanorma-standoc", "~> 2.8.4"
35
35
 
36
36
  spec.add_development_dependency "debug"
37
37
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
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.3
4
+ version: 0.12.4
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: iso-639
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - "~>"
60
60
  - !ruby/object:Gem::Version
61
- version: 2.8.2
61
+ version: 2.8.4
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.8.2
68
+ version: 2.8.4
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: debug
71
71
  requirement: !ruby/object:Gem::Requirement