metanorma-iho 0.9.1 → 0.9.3

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: 0222564e4000d5ef484f0f0a82838f1c3ece8a0d2546e795e992c62dc69ae5fa
4
- data.tar.gz: 3db4ef3f58e77c33f55c228c6714c67ba8e278262f6de0706b2ee8ad784ff984
3
+ metadata.gz: 6f23932cc917c41bf9680cf9e300d37ea48db54c2bebb8f489b6fca2630836f5
4
+ data.tar.gz: dad38711590324bb7f1c9accfeeb34b9c6aafbddad5464ccf44b9e9111dd9589
5
5
  SHA512:
6
- metadata.gz: 4fc6726f6a56ad1fbf42489bddd54d972563e638dd83cbed938176d7ad98635a41a1e2be48f70a18f56c594a5adaf489badbafda07bd0b3d26297da7f0535369
7
- data.tar.gz: 5217fe26eda5262afd14ae27c9fcc4a651c172593d7c427ca7d2e60dcf35f67964dbe6309fa66708319a8dd174ffeaa28fcb5abb4a11b0def1da95b97fd72c4c
6
+ metadata.gz: 81026b6867354a0a96005f3a79f6b298abb37d0bee2ba2c8a4871d183cca50c743b23ae00500757024e33e70e9f1094fc81772956c1f78b5723c6aff778b52b2
7
+ data.tar.gz: c96d8655a05f751d5475fcd622f6bdc1230a2ef579cac08790aa0218100ab404e3df196b80f97ae56a0012e8b07fa0a4b5a43aaa4b2831967b4b7e34edea28e4
@@ -847,6 +847,8 @@
847
847
  <xsl:param name="svg_images"/> <!-- svg images array -->
848
848
  <xsl:variable name="images" select="document($svg_images)"/>
849
849
  <xsl:param name="basepath"/> <!-- base path for images -->
850
+ <xsl:param name="inputxml_basepath"/> <!-- input xml file path -->
851
+ <xsl:param name="inputxml_filename"/> <!-- input xml file name -->
850
852
  <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
851
853
  <xsl:param name="syntax-highlight">false</xsl:param> <!-- syntax highlighting feature, default - off -->
852
854
  <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 -->
@@ -899,6 +901,20 @@
899
901
  <xsl:call-template name="getLang"/>
900
902
  </xsl:variable>
901
903
 
904
+ <xsl:variable name="inputxml_filename_prefix">
905
+ <xsl:choose>
906
+ <xsl:when test="contains($inputxml_filename, '.presentation.xml')">
907
+ <xsl:value-of select="substring-before($inputxml_filename, '.presentation.xml')"/>
908
+ </xsl:when>
909
+ <xsl:when test="contains($inputxml_filename, '.xml')">
910
+ <xsl:value-of select="substring-before($inputxml_filename, '.xml')"/>
911
+ </xsl:when>
912
+ <xsl:otherwise>
913
+ <xsl:value-of select="$inputxml_filename"/>
914
+ </xsl:otherwise>
915
+ </xsl:choose>
916
+ </xsl:variable>
917
+
902
918
  <!-- Note 1: Each xslt has declated variable `namespace` that allows to set some properties, processing logic, etc. for concrete xslt.
903
919
  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>,
904
920
  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 -->
@@ -1359,6 +1375,10 @@
1359
1375
 
1360
1376
  </xsl:attribute-set>
1361
1377
 
1378
+ <xsl:template name="refine_termexample-style">
1379
+
1380
+ </xsl:template>
1381
+
1362
1382
  <xsl:attribute-set name="example-style">
1363
1383
 
1364
1384
  <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
@@ -1824,6 +1844,10 @@
1824
1844
 
1825
1845
  </xsl:attribute-set>
1826
1846
 
1847
+ <xsl:template name="refine_figure-block-style">
1848
+
1849
+ </xsl:template>
1850
+
1827
1851
  <xsl:attribute-set name="figure-style">
1828
1852
 
1829
1853
  </xsl:attribute-set>
@@ -2480,6 +2504,36 @@
2480
2504
  </xsl:for-each>
2481
2505
  </xsl:template>
2482
2506
 
2507
+ <xsl:template name="processMainSectionsDefault_flatxml">
2508
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2509
+ <xsl:sort select="@displayorder" data-type="number"/>
2510
+ <xsl:variable name="flatxml">
2511
+ <xsl:apply-templates select="." mode="flatxml"/>
2512
+ </xsl:variable>
2513
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
2514
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
2515
+
2516
+ </xsl:for-each>
2517
+
2518
+ <xsl:for-each select="/*/*[local-name()='annex']">
2519
+ <xsl:sort select="@displayorder" data-type="number"/>
2520
+ <xsl:variable name="flatxml">
2521
+ <xsl:apply-templates select="." mode="flatxml"/>
2522
+ </xsl:variable>
2523
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
2524
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
2525
+ </xsl:for-each>
2526
+
2527
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2528
+ <xsl:sort select="@displayorder" data-type="number"/>
2529
+ <xsl:variable name="flatxml">
2530
+ <xsl:apply-templates select="." mode="flatxml"/>
2531
+ </xsl:variable>
2532
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
2533
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
2534
+ </xsl:for-each>
2535
+ </xsl:template>
2536
+
2483
2537
  <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
2484
2538
  <xsl:variable name="tag_fo_inline_keep-together_within-line_open">###fo:inline keep-together_within-line###</xsl:variable>
2485
2539
  <xsl:variable name="tag_fo_inline_keep-together_within-line_close">###/fo:inline keep-together_within-line###</xsl:variable>
@@ -2707,7 +2761,7 @@
2707
2761
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
2708
2762
 
2709
2763
  <xsl:variable name="colwidths">
2710
- <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
2764
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col']) and not(@class = 'dl')">
2711
2765
  <xsl:call-template name="calculate-column-widths">
2712
2766
  <xsl:with-param name="cols-count" select="$cols-count"/>
2713
2767
  <xsl:with-param name="table" select="$simple-table"/>
@@ -2819,6 +2873,11 @@
2819
2873
  <fo:table-column column-width="{@width}"/>
2820
2874
  </xsl:for-each>
2821
2875
  </xsl:when>
2876
+ <xsl:when test="@class = 'dl'">
2877
+ <xsl:for-each select=".//*[local-name()='tr'][1]/*">
2878
+ <fo:table-column column-width="{@width}"/>
2879
+ </xsl:for-each>
2880
+ </xsl:when>
2822
2881
  <xsl:otherwise>
2823
2882
  <xsl:call-template name="insertTableColumnWidth">
2824
2883
  <xsl:with-param name="colwidths" select="$colwidths"/>
@@ -4094,6 +4153,7 @@
4094
4153
  <!-- ===================== -->
4095
4154
  <!-- Definition List -->
4096
4155
  <!-- ===================== -->
4156
+
4097
4157
  <xsl:template match="*[local-name()='dl']">
4098
4158
  <xsl:variable name="isAdded" select="@added"/>
4099
4159
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -4308,10 +4368,21 @@
4308
4368
  </xsl:variable>
4309
4369
 
4310
4370
  <xsl:variable name="colwidths">
4311
- <xsl:call-template name="calculate-column-widths">
4312
- <xsl:with-param name="cols-count" select="2"/>
4313
- <xsl:with-param name="table" select="$simple-table"/>
4314
- </xsl:call-template>
4371
+ <xsl:choose>
4372
+ <!-- dl from table[@class='dl'] -->
4373
+ <xsl:when test="*[local-name() = 'colgroup']">
4374
+ <autolayout/>
4375
+ <xsl:for-each select="*[local-name() = 'colgroup']/*[local-name() = 'col']">
4376
+ <column><xsl:value-of select="translate(@width,'%m','')"/></column>
4377
+ </xsl:for-each>
4378
+ </xsl:when>
4379
+ <xsl:otherwise>
4380
+ <xsl:call-template name="calculate-column-widths">
4381
+ <xsl:with-param name="cols-count" select="2"/>
4382
+ <xsl:with-param name="table" select="$simple-table"/>
4383
+ </xsl:call-template>
4384
+ </xsl:otherwise>
4385
+ </xsl:choose>
4315
4386
  </xsl:variable>
4316
4387
 
4317
4388
  <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text>
@@ -4561,13 +4632,13 @@
4561
4632
  <tr>
4562
4633
  <td>
4563
4634
  <xsl:attribute name="id">
4564
- <xsl:value-of select="concat($id,'_',$row_number,'_1')"/>
4635
+ <xsl:value-of select="concat($id,'@',$row_number,'_1')"/>
4565
4636
  </xsl:attribute>
4566
4637
  <xsl:apply-templates/>
4567
4638
  </td>
4568
4639
  <td>
4569
4640
  <xsl:attribute name="id">
4570
- <xsl:value-of select="concat($id,'_',$row_number,'_2')"/>
4641
+ <xsl:value-of select="concat($id,'@',$row_number,'_2')"/>
4571
4642
  </xsl:attribute>
4572
4643
 
4573
4644
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
@@ -5248,6 +5319,10 @@
5248
5319
  <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
5249
5320
  </xsl:template>
5250
5321
 
5322
+ <xsl:template match="*[local-name() = 'span'][contains(@style, 'text-transform:none')]//text()" priority="5">
5323
+ <xsl:value-of select="."/>
5324
+ </xsl:template>
5325
+
5251
5326
  <!-- ========================= -->
5252
5327
  <!-- END Rich text formatting -->
5253
5328
  <!-- ========================= -->
@@ -5878,7 +5953,7 @@
5878
5953
  </xsl:choose>
5879
5954
  </xsl:variable>
5880
5955
  <xsl:attribute name="id">
5881
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_',$divide)"/>
5956
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_',$divide)"/>
5882
5957
  </xsl:attribute>
5883
5958
 
5884
5959
  <xsl:for-each select="*[local-name() = 'p']">
@@ -5886,7 +5961,7 @@
5886
5961
  <xsl:copy-of select="@*"/>
5887
5962
  <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
5888
5963
  <xsl:attribute name="id">
5889
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
5964
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
5890
5965
  </xsl:attribute>
5891
5966
 
5892
5967
  <!-- <xsl:copy-of select="node()" /> -->
@@ -5950,7 +6025,7 @@
5950
6025
  <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
5951
6026
  <xsl:copy>
5952
6027
  <xsl:attribute name="id">
5953
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
6028
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
5954
6029
  </xsl:attribute>
5955
6030
  <xsl:copy-of select="node()"/>
5956
6031
  </xsl:copy>
@@ -6477,6 +6552,12 @@
6477
6552
  <xsl:when test="@updatetype = 'true'">
6478
6553
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
6479
6554
  </xsl:when>
6555
+ <xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
6556
+ <!-- link to the PDF attachment -->
6557
+ <xsl:variable name="target_" select="translate(@target, '\', '/')"/>
6558
+ <xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
6559
+ <xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
6560
+ </xsl:when>
6480
6561
  <xsl:otherwise>
6481
6562
  <xsl:value-of select="normalize-space(@target)"/>
6482
6563
  </xsl:otherwise>
@@ -6884,6 +6965,7 @@
6884
6965
  <xsl:variable name="isAdded" select="@added"/>
6885
6966
  <xsl:variable name="isDeleted" select="@deleted"/>
6886
6967
  <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
6968
+ <xsl:call-template name="refine_figure-block-style"/>
6887
6969
 
6888
6970
  <xsl:call-template name="setTrackChangesStyles">
6889
6971
  <xsl:with-param name="isAdded" select="$isAdded"/>
@@ -8752,7 +8834,7 @@
8752
8834
  <!-- ====== -->
8753
8835
  <xsl:template match="*[local-name() = 'termexample']">
8754
8836
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
8755
-
8837
+ <xsl:call-template name="refine_termexample-style"/>
8756
8838
  <xsl:call-template name="setBlockSpanAll"/>
8757
8839
 
8758
8840
  <xsl:apply-templates select="*[local-name()='name']"/>
@@ -11242,10 +11324,10 @@
11242
11324
 
11243
11325
  <xsl:template name="addPDFUAmeta">
11244
11326
  <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
11245
- <pdf:dictionary type="normal" key="ViewerPreferences">
11246
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
11247
- </pdf:dictionary>
11248
- </pdf:catalog>
11327
+ <pdf:dictionary type="normal" key="ViewerPreferences">
11328
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
11329
+ </pdf:dictionary>
11330
+ </pdf:catalog>
11249
11331
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
11250
11332
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
11251
11333
  <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
@@ -11297,6 +11379,19 @@
11297
11379
  </rdf:Description>
11298
11380
  </rdf:RDF>
11299
11381
  </x:xmpmeta>
11382
+ <!-- add attachments -->
11383
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
11384
+ <xsl:choose>
11385
+ <xsl:when test="normalize-space() != ''">
11386
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{.}" filename="{@name}"/>
11387
+ </xsl:when>
11388
+ <xsl:otherwise>
11389
+ <!-- _{filename}_attachments -->
11390
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
11391
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
11392
+ </xsl:otherwise>
11393
+ </xsl:choose>
11394
+ </xsl:for-each>
11300
11395
  </xsl:template> <!-- addPDFUAmeta -->
11301
11396
 
11302
11397
  <xsl:template name="getId">
@@ -847,6 +847,8 @@
847
847
  <xsl:param name="svg_images"/> <!-- svg images array -->
848
848
  <xsl:variable name="images" select="document($svg_images)"/>
849
849
  <xsl:param name="basepath"/> <!-- base path for images -->
850
+ <xsl:param name="inputxml_basepath"/> <!-- input xml file path -->
851
+ <xsl:param name="inputxml_filename"/> <!-- input xml file name -->
850
852
  <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
851
853
  <xsl:param name="syntax-highlight">false</xsl:param> <!-- syntax highlighting feature, default - off -->
852
854
  <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 -->
@@ -899,6 +901,20 @@
899
901
  <xsl:call-template name="getLang"/>
900
902
  </xsl:variable>
901
903
 
904
+ <xsl:variable name="inputxml_filename_prefix">
905
+ <xsl:choose>
906
+ <xsl:when test="contains($inputxml_filename, '.presentation.xml')">
907
+ <xsl:value-of select="substring-before($inputxml_filename, '.presentation.xml')"/>
908
+ </xsl:when>
909
+ <xsl:when test="contains($inputxml_filename, '.xml')">
910
+ <xsl:value-of select="substring-before($inputxml_filename, '.xml')"/>
911
+ </xsl:when>
912
+ <xsl:otherwise>
913
+ <xsl:value-of select="$inputxml_filename"/>
914
+ </xsl:otherwise>
915
+ </xsl:choose>
916
+ </xsl:variable>
917
+
902
918
  <!-- Note 1: Each xslt has declated variable `namespace` that allows to set some properties, processing logic, etc. for concrete xslt.
903
919
  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>,
904
920
  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 -->
@@ -1359,6 +1375,10 @@
1359
1375
 
1360
1376
  </xsl:attribute-set>
1361
1377
 
1378
+ <xsl:template name="refine_termexample-style">
1379
+
1380
+ </xsl:template>
1381
+
1362
1382
  <xsl:attribute-set name="example-style">
1363
1383
 
1364
1384
  <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
@@ -1824,6 +1844,10 @@
1824
1844
 
1825
1845
  </xsl:attribute-set>
1826
1846
 
1847
+ <xsl:template name="refine_figure-block-style">
1848
+
1849
+ </xsl:template>
1850
+
1827
1851
  <xsl:attribute-set name="figure-style">
1828
1852
 
1829
1853
  </xsl:attribute-set>
@@ -2480,6 +2504,36 @@
2480
2504
  </xsl:for-each>
2481
2505
  </xsl:template>
2482
2506
 
2507
+ <xsl:template name="processMainSectionsDefault_flatxml">
2508
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2509
+ <xsl:sort select="@displayorder" data-type="number"/>
2510
+ <xsl:variable name="flatxml">
2511
+ <xsl:apply-templates select="." mode="flatxml"/>
2512
+ </xsl:variable>
2513
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
2514
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
2515
+
2516
+ </xsl:for-each>
2517
+
2518
+ <xsl:for-each select="/*/*[local-name()='annex']">
2519
+ <xsl:sort select="@displayorder" data-type="number"/>
2520
+ <xsl:variable name="flatxml">
2521
+ <xsl:apply-templates select="." mode="flatxml"/>
2522
+ </xsl:variable>
2523
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
2524
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
2525
+ </xsl:for-each>
2526
+
2527
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2528
+ <xsl:sort select="@displayorder" data-type="number"/>
2529
+ <xsl:variable name="flatxml">
2530
+ <xsl:apply-templates select="." mode="flatxml"/>
2531
+ </xsl:variable>
2532
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
2533
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
2534
+ </xsl:for-each>
2535
+ </xsl:template>
2536
+
2483
2537
  <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
2484
2538
  <xsl:variable name="tag_fo_inline_keep-together_within-line_open">###fo:inline keep-together_within-line###</xsl:variable>
2485
2539
  <xsl:variable name="tag_fo_inline_keep-together_within-line_close">###/fo:inline keep-together_within-line###</xsl:variable>
@@ -2707,7 +2761,7 @@
2707
2761
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
2708
2762
 
2709
2763
  <xsl:variable name="colwidths">
2710
- <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
2764
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col']) and not(@class = 'dl')">
2711
2765
  <xsl:call-template name="calculate-column-widths">
2712
2766
  <xsl:with-param name="cols-count" select="$cols-count"/>
2713
2767
  <xsl:with-param name="table" select="$simple-table"/>
@@ -2819,6 +2873,11 @@
2819
2873
  <fo:table-column column-width="{@width}"/>
2820
2874
  </xsl:for-each>
2821
2875
  </xsl:when>
2876
+ <xsl:when test="@class = 'dl'">
2877
+ <xsl:for-each select=".//*[local-name()='tr'][1]/*">
2878
+ <fo:table-column column-width="{@width}"/>
2879
+ </xsl:for-each>
2880
+ </xsl:when>
2822
2881
  <xsl:otherwise>
2823
2882
  <xsl:call-template name="insertTableColumnWidth">
2824
2883
  <xsl:with-param name="colwidths" select="$colwidths"/>
@@ -4094,6 +4153,7 @@
4094
4153
  <!-- ===================== -->
4095
4154
  <!-- Definition List -->
4096
4155
  <!-- ===================== -->
4156
+
4097
4157
  <xsl:template match="*[local-name()='dl']">
4098
4158
  <xsl:variable name="isAdded" select="@added"/>
4099
4159
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -4308,10 +4368,21 @@
4308
4368
  </xsl:variable>
4309
4369
 
4310
4370
  <xsl:variable name="colwidths">
4311
- <xsl:call-template name="calculate-column-widths">
4312
- <xsl:with-param name="cols-count" select="2"/>
4313
- <xsl:with-param name="table" select="$simple-table"/>
4314
- </xsl:call-template>
4371
+ <xsl:choose>
4372
+ <!-- dl from table[@class='dl'] -->
4373
+ <xsl:when test="*[local-name() = 'colgroup']">
4374
+ <autolayout/>
4375
+ <xsl:for-each select="*[local-name() = 'colgroup']/*[local-name() = 'col']">
4376
+ <column><xsl:value-of select="translate(@width,'%m','')"/></column>
4377
+ </xsl:for-each>
4378
+ </xsl:when>
4379
+ <xsl:otherwise>
4380
+ <xsl:call-template name="calculate-column-widths">
4381
+ <xsl:with-param name="cols-count" select="2"/>
4382
+ <xsl:with-param name="table" select="$simple-table"/>
4383
+ </xsl:call-template>
4384
+ </xsl:otherwise>
4385
+ </xsl:choose>
4315
4386
  </xsl:variable>
4316
4387
 
4317
4388
  <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text>
@@ -4561,13 +4632,13 @@
4561
4632
  <tr>
4562
4633
  <td>
4563
4634
  <xsl:attribute name="id">
4564
- <xsl:value-of select="concat($id,'_',$row_number,'_1')"/>
4635
+ <xsl:value-of select="concat($id,'@',$row_number,'_1')"/>
4565
4636
  </xsl:attribute>
4566
4637
  <xsl:apply-templates/>
4567
4638
  </td>
4568
4639
  <td>
4569
4640
  <xsl:attribute name="id">
4570
- <xsl:value-of select="concat($id,'_',$row_number,'_2')"/>
4641
+ <xsl:value-of select="concat($id,'@',$row_number,'_2')"/>
4571
4642
  </xsl:attribute>
4572
4643
 
4573
4644
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
@@ -5248,6 +5319,10 @@
5248
5319
  <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
5249
5320
  </xsl:template>
5250
5321
 
5322
+ <xsl:template match="*[local-name() = 'span'][contains(@style, 'text-transform:none')]//text()" priority="5">
5323
+ <xsl:value-of select="."/>
5324
+ </xsl:template>
5325
+
5251
5326
  <!-- ========================= -->
5252
5327
  <!-- END Rich text formatting -->
5253
5328
  <!-- ========================= -->
@@ -5878,7 +5953,7 @@
5878
5953
  </xsl:choose>
5879
5954
  </xsl:variable>
5880
5955
  <xsl:attribute name="id">
5881
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_',$divide)"/>
5956
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_',$divide)"/>
5882
5957
  </xsl:attribute>
5883
5958
 
5884
5959
  <xsl:for-each select="*[local-name() = 'p']">
@@ -5886,7 +5961,7 @@
5886
5961
  <xsl:copy-of select="@*"/>
5887
5962
  <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
5888
5963
  <xsl:attribute name="id">
5889
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
5964
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
5890
5965
  </xsl:attribute>
5891
5966
 
5892
5967
  <!-- <xsl:copy-of select="node()" /> -->
@@ -5950,7 +6025,7 @@
5950
6025
  <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
5951
6026
  <xsl:copy>
5952
6027
  <xsl:attribute name="id">
5953
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
6028
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
5954
6029
  </xsl:attribute>
5955
6030
  <xsl:copy-of select="node()"/>
5956
6031
  </xsl:copy>
@@ -6477,6 +6552,12 @@
6477
6552
  <xsl:when test="@updatetype = 'true'">
6478
6553
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
6479
6554
  </xsl:when>
6555
+ <xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
6556
+ <!-- link to the PDF attachment -->
6557
+ <xsl:variable name="target_" select="translate(@target, '\', '/')"/>
6558
+ <xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
6559
+ <xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
6560
+ </xsl:when>
6480
6561
  <xsl:otherwise>
6481
6562
  <xsl:value-of select="normalize-space(@target)"/>
6482
6563
  </xsl:otherwise>
@@ -6884,6 +6965,7 @@
6884
6965
  <xsl:variable name="isAdded" select="@added"/>
6885
6966
  <xsl:variable name="isDeleted" select="@deleted"/>
6886
6967
  <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
6968
+ <xsl:call-template name="refine_figure-block-style"/>
6887
6969
 
6888
6970
  <xsl:call-template name="setTrackChangesStyles">
6889
6971
  <xsl:with-param name="isAdded" select="$isAdded"/>
@@ -8752,7 +8834,7 @@
8752
8834
  <!-- ====== -->
8753
8835
  <xsl:template match="*[local-name() = 'termexample']">
8754
8836
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
8755
-
8837
+ <xsl:call-template name="refine_termexample-style"/>
8756
8838
  <xsl:call-template name="setBlockSpanAll"/>
8757
8839
 
8758
8840
  <xsl:apply-templates select="*[local-name()='name']"/>
@@ -11242,10 +11324,10 @@
11242
11324
 
11243
11325
  <xsl:template name="addPDFUAmeta">
11244
11326
  <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
11245
- <pdf:dictionary type="normal" key="ViewerPreferences">
11246
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
11247
- </pdf:dictionary>
11248
- </pdf:catalog>
11327
+ <pdf:dictionary type="normal" key="ViewerPreferences">
11328
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
11329
+ </pdf:dictionary>
11330
+ </pdf:catalog>
11249
11331
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
11250
11332
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
11251
11333
  <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
@@ -11297,6 +11379,19 @@
11297
11379
  </rdf:Description>
11298
11380
  </rdf:RDF>
11299
11381
  </x:xmpmeta>
11382
+ <!-- add attachments -->
11383
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
11384
+ <xsl:choose>
11385
+ <xsl:when test="normalize-space() != ''">
11386
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{.}" filename="{@name}"/>
11387
+ </xsl:when>
11388
+ <xsl:otherwise>
11389
+ <!-- _{filename}_attachments -->
11390
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
11391
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
11392
+ </xsl:otherwise>
11393
+ </xsl:choose>
11394
+ </xsl:for-each>
11300
11395
  </xsl:template> <!-- addPDFUAmeta -->
11301
11396
 
11302
11397
  <xsl:template name="getId">
@@ -22,6 +22,11 @@ module IsoDoc
22
22
  )
23
23
  end
24
24
 
25
+ def bibrenderer(options = {})
26
+ ::Relaton::Render::IHO::General.new(options.merge(language: @lang,
27
+ i18nhash: @i18n.get))
28
+ end
29
+
25
30
  def info(isoxml, out)
26
31
  @meta.series isoxml, out
27
32
  super
@@ -6,10 +6,6 @@ require_relative "../../relaton/render/general"
6
6
  module IsoDoc
7
7
  module IHO
8
8
  class PresentationXMLConvert < IsoDoc::Generic::PresentationXMLConvert
9
- def bibrenderer
10
- ::Relaton::Render::IHO::General.new(language: @lang)
11
- end
12
-
13
9
  def norm_ref_entry_code(ordinal, _idents, _ids, _standard, _datefn, _bib)
14
10
  "[#{ordinal}]<tab/>"
15
11
  end
@@ -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 IHO
3
- VERSION = "0.9.1".freeze
3
+ VERSION = "0.9.3".freeze
4
4
  end
5
5
  end
@@ -27,7 +27,7 @@ Gem::Specification.new do |spec|
27
27
  spec.require_paths = ["lib"]
28
28
  spec.required_ruby_version = Gem::Requirement.new(">= 2.7.0")
29
29
 
30
- spec.add_dependency "metanorma-generic", "~> 2.6.0"
30
+ spec.add_dependency "metanorma-generic", "~> 2.6.2"
31
31
 
32
32
  spec.add_development_dependency "debug"
33
33
  spec.add_development_dependency "equivalent-xml", "~> 0.6"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-iho
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.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-05 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