metanorma-ogc 2.5.1 → 2.5.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -386,7 +386,7 @@
386
386
  <fo:inline font-weight="bold">
387
387
  <!-- Editor: -->
388
388
  <xsl:call-template name="getLocalizedString">
389
- <xsl:with-param name="key">editor</xsl:with-param>
389
+ <xsl:with-param name="key">editor_full</xsl:with-param>
390
390
  </xsl:call-template><xsl:text>: </xsl:text>
391
391
  </fo:inline>
392
392
  <xsl:for-each select="/ogc:ogc-standard/ogc:bibdata/ogc:contributor[ogc:role/@type='editor']/ogc:person/ogc:name/ogc:completename">
@@ -1577,6 +1577,8 @@
1577
1577
  <xsl:param name="svg_images"/> <!-- svg images array -->
1578
1578
  <xsl:variable name="images" select="document($svg_images)"/>
1579
1579
  <xsl:param name="basepath"/> <!-- base path for images -->
1580
+ <xsl:param name="inputxml_basepath"/> <!-- input xml file path -->
1581
+ <xsl:param name="inputxml_filename"/> <!-- input xml file name -->
1580
1582
  <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
1581
1583
  <xsl:param name="syntax-highlight">false</xsl:param> <!-- syntax highlighting feature, default - off -->
1582
1584
  <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 -->
@@ -1629,6 +1631,20 @@
1629
1631
  <xsl:call-template name="getLang"/>
1630
1632
  </xsl:variable>
1631
1633
 
1634
+ <xsl:variable name="inputxml_filename_prefix">
1635
+ <xsl:choose>
1636
+ <xsl:when test="contains($inputxml_filename, '.presentation.xml')">
1637
+ <xsl:value-of select="substring-before($inputxml_filename, '.presentation.xml')"/>
1638
+ </xsl:when>
1639
+ <xsl:when test="contains($inputxml_filename, '.xml')">
1640
+ <xsl:value-of select="substring-before($inputxml_filename, '.xml')"/>
1641
+ </xsl:when>
1642
+ <xsl:otherwise>
1643
+ <xsl:value-of select="$inputxml_filename"/>
1644
+ </xsl:otherwise>
1645
+ </xsl:choose>
1646
+ </xsl:variable>
1647
+
1632
1648
  <!-- Note 1: Each xslt has declated variable `namespace` that allows to set some properties, processing logic, etc. for concrete xslt.
1633
1649
  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>,
1634
1650
  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 -->
@@ -2152,6 +2168,10 @@
2152
2168
 
2153
2169
  </xsl:attribute-set>
2154
2170
 
2171
+ <xsl:template name="refine_termexample-style">
2172
+
2173
+ </xsl:template>
2174
+
2155
2175
  <xsl:attribute-set name="example-style">
2156
2176
 
2157
2177
  <xsl:attribute name="margin-top">10pt</xsl:attribute>
@@ -2653,6 +2673,10 @@
2653
2673
 
2654
2674
  </xsl:attribute-set>
2655
2675
 
2676
+ <xsl:template name="refine_figure-block-style">
2677
+
2678
+ </xsl:template>
2679
+
2656
2680
  <xsl:attribute-set name="figure-style">
2657
2681
 
2658
2682
  </xsl:attribute-set>
@@ -3331,6 +3355,36 @@
3331
3355
  </xsl:for-each>
3332
3356
  </xsl:template>
3333
3357
 
3358
+ <xsl:template name="processMainSectionsDefault_flatxml">
3359
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
3360
+ <xsl:sort select="@displayorder" data-type="number"/>
3361
+ <xsl:variable name="flatxml">
3362
+ <xsl:apply-templates select="." mode="flatxml"/>
3363
+ </xsl:variable>
3364
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
3365
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
3366
+
3367
+ </xsl:for-each>
3368
+
3369
+ <xsl:for-each select="/*/*[local-name()='annex']">
3370
+ <xsl:sort select="@displayorder" data-type="number"/>
3371
+ <xsl:variable name="flatxml">
3372
+ <xsl:apply-templates select="." mode="flatxml"/>
3373
+ </xsl:variable>
3374
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
3375
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
3376
+ </xsl:for-each>
3377
+
3378
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
3379
+ <xsl:sort select="@displayorder" data-type="number"/>
3380
+ <xsl:variable name="flatxml">
3381
+ <xsl:apply-templates select="." mode="flatxml"/>
3382
+ </xsl:variable>
3383
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
3384
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
3385
+ </xsl:for-each>
3386
+ </xsl:template>
3387
+
3334
3388
  <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
3335
3389
  <xsl:variable name="tag_fo_inline_keep-together_within-line_open">###fo:inline keep-together_within-line###</xsl:variable>
3336
3390
  <xsl:variable name="tag_fo_inline_keep-together_within-line_close">###/fo:inline keep-together_within-line###</xsl:variable>
@@ -3575,7 +3629,7 @@
3575
3629
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
3576
3630
 
3577
3631
  <xsl:variable name="colwidths">
3578
- <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
3632
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col']) and not(@class = 'dl')">
3579
3633
  <xsl:call-template name="calculate-column-widths">
3580
3634
  <xsl:with-param name="cols-count" select="$cols-count"/>
3581
3635
  <xsl:with-param name="table" select="$simple-table"/>
@@ -3693,6 +3747,11 @@
3693
3747
  <fo:table-column column-width="{@width}"/>
3694
3748
  </xsl:for-each>
3695
3749
  </xsl:when>
3750
+ <xsl:when test="@class = 'dl'">
3751
+ <xsl:for-each select=".//*[local-name()='tr'][1]/*">
3752
+ <fo:table-column column-width="{@width}"/>
3753
+ </xsl:for-each>
3754
+ </xsl:when>
3696
3755
  <xsl:otherwise>
3697
3756
  <xsl:call-template name="insertTableColumnWidth">
3698
3757
  <xsl:with-param name="colwidths" select="$colwidths"/>
@@ -4976,6 +5035,7 @@
4976
5035
  <!-- ===================== -->
4977
5036
  <!-- Definition List -->
4978
5037
  <!-- ===================== -->
5038
+
4979
5039
  <xsl:template match="*[local-name()='dl']">
4980
5040
  <xsl:variable name="isAdded" select="@added"/>
4981
5041
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -5188,10 +5248,21 @@
5188
5248
  </xsl:variable>
5189
5249
 
5190
5250
  <xsl:variable name="colwidths">
5191
- <xsl:call-template name="calculate-column-widths">
5192
- <xsl:with-param name="cols-count" select="2"/>
5193
- <xsl:with-param name="table" select="$simple-table"/>
5194
- </xsl:call-template>
5251
+ <xsl:choose>
5252
+ <!-- dl from table[@class='dl'] -->
5253
+ <xsl:when test="*[local-name() = 'colgroup']">
5254
+ <autolayout/>
5255
+ <xsl:for-each select="*[local-name() = 'colgroup']/*[local-name() = 'col']">
5256
+ <column><xsl:value-of select="translate(@width,'%m','')"/></column>
5257
+ </xsl:for-each>
5258
+ </xsl:when>
5259
+ <xsl:otherwise>
5260
+ <xsl:call-template name="calculate-column-widths">
5261
+ <xsl:with-param name="cols-count" select="2"/>
5262
+ <xsl:with-param name="table" select="$simple-table"/>
5263
+ </xsl:call-template>
5264
+ </xsl:otherwise>
5265
+ </xsl:choose>
5195
5266
  </xsl:variable>
5196
5267
 
5197
5268
  <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text>
@@ -5437,13 +5508,13 @@
5437
5508
  <tr>
5438
5509
  <td>
5439
5510
  <xsl:attribute name="id">
5440
- <xsl:value-of select="concat($id,'_',$row_number,'_1')"/>
5511
+ <xsl:value-of select="concat($id,'@',$row_number,'_1')"/>
5441
5512
  </xsl:attribute>
5442
5513
  <xsl:apply-templates/>
5443
5514
  </td>
5444
5515
  <td>
5445
5516
  <xsl:attribute name="id">
5446
- <xsl:value-of select="concat($id,'_',$row_number,'_2')"/>
5517
+ <xsl:value-of select="concat($id,'@',$row_number,'_2')"/>
5447
5518
  </xsl:attribute>
5448
5519
 
5449
5520
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
@@ -6064,6 +6135,10 @@
6064
6135
  <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
6065
6136
  </xsl:template>
6066
6137
 
6138
+ <xsl:template match="*[local-name() = 'span'][contains(@style, 'text-transform:none')]//text()" priority="5">
6139
+ <xsl:value-of select="."/>
6140
+ </xsl:template>
6141
+
6067
6142
  <!-- ========================= -->
6068
6143
  <!-- END Rich text formatting -->
6069
6144
  <!-- ========================= -->
@@ -6694,7 +6769,7 @@
6694
6769
  </xsl:choose>
6695
6770
  </xsl:variable>
6696
6771
  <xsl:attribute name="id">
6697
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_',$divide)"/>
6772
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_',$divide)"/>
6698
6773
  </xsl:attribute>
6699
6774
 
6700
6775
  <xsl:for-each select="*[local-name() = 'p']">
@@ -6702,7 +6777,7 @@
6702
6777
  <xsl:copy-of select="@*"/>
6703
6778
  <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
6704
6779
  <xsl:attribute name="id">
6705
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
6780
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
6706
6781
  </xsl:attribute>
6707
6782
 
6708
6783
  <!-- <xsl:copy-of select="node()" /> -->
@@ -6766,7 +6841,7 @@
6766
6841
  <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
6767
6842
  <xsl:copy>
6768
6843
  <xsl:attribute name="id">
6769
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
6844
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
6770
6845
  </xsl:attribute>
6771
6846
  <xsl:copy-of select="node()"/>
6772
6847
  </xsl:copy>
@@ -7293,6 +7368,12 @@
7293
7368
  <xsl:when test="@updatetype = 'true'">
7294
7369
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
7295
7370
  </xsl:when>
7371
+ <xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
7372
+ <!-- link to the PDF attachment -->
7373
+ <xsl:variable name="target_" select="translate(@target, '\', '/')"/>
7374
+ <xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
7375
+ <xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
7376
+ </xsl:when>
7296
7377
  <xsl:otherwise>
7297
7378
  <xsl:value-of select="normalize-space(@target)"/>
7298
7379
  </xsl:otherwise>
@@ -7706,6 +7787,7 @@
7706
7787
  <xsl:variable name="isAdded" select="@added"/>
7707
7788
  <xsl:variable name="isDeleted" select="@deleted"/>
7708
7789
  <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
7790
+ <xsl:call-template name="refine_figure-block-style"/>
7709
7791
 
7710
7792
  <xsl:call-template name="setTrackChangesStyles">
7711
7793
  <xsl:with-param name="isAdded" select="$isAdded"/>
@@ -9626,7 +9708,7 @@
9626
9708
  <!-- ====== -->
9627
9709
  <xsl:template match="*[local-name() = 'termexample']">
9628
9710
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
9629
-
9711
+ <xsl:call-template name="refine_termexample-style"/>
9630
9712
  <xsl:call-template name="setBlockSpanAll"/>
9631
9713
 
9632
9714
  <xsl:apply-templates select="*[local-name()='name']"/>
@@ -12112,10 +12194,10 @@
12112
12194
 
12113
12195
  <xsl:template name="addPDFUAmeta">
12114
12196
  <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
12115
- <pdf:dictionary type="normal" key="ViewerPreferences">
12116
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
12117
- </pdf:dictionary>
12118
- </pdf:catalog>
12197
+ <pdf:dictionary type="normal" key="ViewerPreferences">
12198
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
12199
+ </pdf:dictionary>
12200
+ </pdf:catalog>
12119
12201
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
12120
12202
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
12121
12203
  <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
@@ -12167,6 +12249,19 @@
12167
12249
  </rdf:Description>
12168
12250
  </rdf:RDF>
12169
12251
  </x:xmpmeta>
12252
+ <!-- add attachments -->
12253
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
12254
+ <xsl:choose>
12255
+ <xsl:when test="normalize-space() != ''">
12256
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{.}" filename="{@name}"/>
12257
+ </xsl:when>
12258
+ <xsl:otherwise>
12259
+ <!-- _{filename}_attachments -->
12260
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
12261
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
12262
+ </xsl:otherwise>
12263
+ </xsl:choose>
12264
+ </xsl:for-each>
12170
12265
  </xsl:template> <!-- addPDFUAmeta -->
12171
12266
 
12172
12267
  <xsl:template name="getId">
@@ -164,7 +164,12 @@
164
164
  </xsl:for-each>
165
165
  </xsl:variable>
166
166
  <xsl:if test="normalize-space($editors) != ''">
167
- <fo:block margin-top="6pt">Editor: <xsl:value-of select="$editors"/></fo:block>
167
+ <fo:block margin-top="6pt">
168
+ <!-- Editor: -->
169
+ <xsl:call-template name="getLocalizedString">
170
+ <xsl:with-param name="key">editor_full</xsl:with-param>
171
+ </xsl:call-template><xsl:text>: </xsl:text><xsl:value-of select="$editors"/>
172
+ </fo:block>
168
173
  </xsl:if>
169
174
  </fo:block>
170
175
 
@@ -648,6 +653,8 @@
648
653
  <xsl:param name="svg_images"/> <!-- svg images array -->
649
654
  <xsl:variable name="images" select="document($svg_images)"/>
650
655
  <xsl:param name="basepath"/> <!-- base path for images -->
656
+ <xsl:param name="inputxml_basepath"/> <!-- input xml file path -->
657
+ <xsl:param name="inputxml_filename"/> <!-- input xml file name -->
651
658
  <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
652
659
  <xsl:param name="syntax-highlight">false</xsl:param> <!-- syntax highlighting feature, default - off -->
653
660
  <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 -->
@@ -700,6 +707,20 @@
700
707
  <xsl:call-template name="getLang"/>
701
708
  </xsl:variable>
702
709
 
710
+ <xsl:variable name="inputxml_filename_prefix">
711
+ <xsl:choose>
712
+ <xsl:when test="contains($inputxml_filename, '.presentation.xml')">
713
+ <xsl:value-of select="substring-before($inputxml_filename, '.presentation.xml')"/>
714
+ </xsl:when>
715
+ <xsl:when test="contains($inputxml_filename, '.xml')">
716
+ <xsl:value-of select="substring-before($inputxml_filename, '.xml')"/>
717
+ </xsl:when>
718
+ <xsl:otherwise>
719
+ <xsl:value-of select="$inputxml_filename"/>
720
+ </xsl:otherwise>
721
+ </xsl:choose>
722
+ </xsl:variable>
723
+
703
724
  <!-- Note 1: Each xslt has declated variable `namespace` that allows to set some properties, processing logic, etc. for concrete xslt.
704
725
  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>,
705
726
  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 -->
@@ -1216,6 +1237,10 @@
1216
1237
 
1217
1238
  </xsl:attribute-set>
1218
1239
 
1240
+ <xsl:template name="refine_termexample-style">
1241
+
1242
+ </xsl:template>
1243
+
1219
1244
  <xsl:attribute-set name="example-style">
1220
1245
 
1221
1246
  <xsl:attribute name="font-size">10pt</xsl:attribute>
@@ -1682,6 +1707,10 @@
1682
1707
 
1683
1708
  </xsl:attribute-set>
1684
1709
 
1710
+ <xsl:template name="refine_figure-block-style">
1711
+
1712
+ </xsl:template>
1713
+
1685
1714
  <xsl:attribute-set name="figure-style">
1686
1715
 
1687
1716
  </xsl:attribute-set>
@@ -2353,6 +2382,36 @@
2353
2382
  </xsl:for-each>
2354
2383
  </xsl:template>
2355
2384
 
2385
+ <xsl:template name="processMainSectionsDefault_flatxml">
2386
+ <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
2387
+ <xsl:sort select="@displayorder" data-type="number"/>
2388
+ <xsl:variable name="flatxml">
2389
+ <xsl:apply-templates select="." mode="flatxml"/>
2390
+ </xsl:variable>
2391
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
2392
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
2393
+
2394
+ </xsl:for-each>
2395
+
2396
+ <xsl:for-each select="/*/*[local-name()='annex']">
2397
+ <xsl:sort select="@displayorder" data-type="number"/>
2398
+ <xsl:variable name="flatxml">
2399
+ <xsl:apply-templates select="." mode="flatxml"/>
2400
+ </xsl:variable>
2401
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
2402
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
2403
+ </xsl:for-each>
2404
+
2405
+ <xsl:for-each select="/*/*[local-name()='bibliography']/*[not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]">
2406
+ <xsl:sort select="@displayorder" data-type="number"/>
2407
+ <xsl:variable name="flatxml">
2408
+ <xsl:apply-templates select="." mode="flatxml"/>
2409
+ </xsl:variable>
2410
+ <!-- debug_flatxml='<xsl:copy-of select="$flatxml"/>' -->
2411
+ <xsl:apply-templates select="xalan:nodeset($flatxml)/*"/>
2412
+ </xsl:for-each>
2413
+ </xsl:template>
2414
+
2356
2415
  <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
2357
2416
  <xsl:variable name="tag_fo_inline_keep-together_within-line_open">###fo:inline keep-together_within-line###</xsl:variable>
2358
2417
  <xsl:variable name="tag_fo_inline_keep-together_within-line_close">###/fo:inline keep-together_within-line###</xsl:variable>
@@ -2612,7 +2671,7 @@
2612
2671
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
2613
2672
 
2614
2673
  <xsl:variable name="colwidths">
2615
- <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
2674
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col']) and not(@class = 'dl')">
2616
2675
  <xsl:call-template name="calculate-column-widths">
2617
2676
  <xsl:with-param name="cols-count" select="$cols-count"/>
2618
2677
  <xsl:with-param name="table" select="$simple-table"/>
@@ -2730,6 +2789,11 @@
2730
2789
  <fo:table-column column-width="{@width}"/>
2731
2790
  </xsl:for-each>
2732
2791
  </xsl:when>
2792
+ <xsl:when test="@class = 'dl'">
2793
+ <xsl:for-each select=".//*[local-name()='tr'][1]/*">
2794
+ <fo:table-column column-width="{@width}"/>
2795
+ </xsl:for-each>
2796
+ </xsl:when>
2733
2797
  <xsl:otherwise>
2734
2798
  <xsl:call-template name="insertTableColumnWidth">
2735
2799
  <xsl:with-param name="colwidths" select="$colwidths"/>
@@ -4015,6 +4079,7 @@
4015
4079
  <!-- ===================== -->
4016
4080
  <!-- Definition List -->
4017
4081
  <!-- ===================== -->
4082
+
4018
4083
  <xsl:template match="*[local-name()='dl']">
4019
4084
  <xsl:variable name="isAdded" select="@added"/>
4020
4085
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -4227,10 +4292,21 @@
4227
4292
  </xsl:variable>
4228
4293
 
4229
4294
  <xsl:variable name="colwidths">
4230
- <xsl:call-template name="calculate-column-widths">
4231
- <xsl:with-param name="cols-count" select="2"/>
4232
- <xsl:with-param name="table" select="$simple-table"/>
4233
- </xsl:call-template>
4295
+ <xsl:choose>
4296
+ <!-- dl from table[@class='dl'] -->
4297
+ <xsl:when test="*[local-name() = 'colgroup']">
4298
+ <autolayout/>
4299
+ <xsl:for-each select="*[local-name() = 'colgroup']/*[local-name() = 'col']">
4300
+ <column><xsl:value-of select="translate(@width,'%m','')"/></column>
4301
+ </xsl:for-each>
4302
+ </xsl:when>
4303
+ <xsl:otherwise>
4304
+ <xsl:call-template name="calculate-column-widths">
4305
+ <xsl:with-param name="cols-count" select="2"/>
4306
+ <xsl:with-param name="table" select="$simple-table"/>
4307
+ </xsl:call-template>
4308
+ </xsl:otherwise>
4309
+ </xsl:choose>
4234
4310
  </xsl:variable>
4235
4311
 
4236
4312
  <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text>
@@ -4476,13 +4552,13 @@
4476
4552
  <tr>
4477
4553
  <td>
4478
4554
  <xsl:attribute name="id">
4479
- <xsl:value-of select="concat($id,'_',$row_number,'_1')"/>
4555
+ <xsl:value-of select="concat($id,'@',$row_number,'_1')"/>
4480
4556
  </xsl:attribute>
4481
4557
  <xsl:apply-templates/>
4482
4558
  </td>
4483
4559
  <td>
4484
4560
  <xsl:attribute name="id">
4485
- <xsl:value-of select="concat($id,'_',$row_number,'_2')"/>
4561
+ <xsl:value-of select="concat($id,'@',$row_number,'_2')"/>
4486
4562
  </xsl:attribute>
4487
4563
 
4488
4564
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]">
@@ -5096,6 +5172,10 @@
5096
5172
  <fo:inline keep-with-next.within-line="always"><xsl:value-of select="."/></fo:inline>
5097
5173
  </xsl:template>
5098
5174
 
5175
+ <xsl:template match="*[local-name() = 'span'][contains(@style, 'text-transform:none')]//text()" priority="5">
5176
+ <xsl:value-of select="."/>
5177
+ </xsl:template>
5178
+
5099
5179
  <!-- ========================= -->
5100
5180
  <!-- END Rich text formatting -->
5101
5181
  <!-- ========================= -->
@@ -5726,7 +5806,7 @@
5726
5806
  </xsl:choose>
5727
5807
  </xsl:variable>
5728
5808
  <xsl:attribute name="id">
5729
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_',$divide)"/>
5809
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_',$divide)"/>
5730
5810
  </xsl:attribute>
5731
5811
 
5732
5812
  <xsl:for-each select="*[local-name() = 'p']">
@@ -5734,7 +5814,7 @@
5734
5814
  <xsl:copy-of select="@*"/>
5735
5815
  <xsl:variable name="p_num" select="count(preceding-sibling::*[local-name() = 'p']) + 1"/>
5736
5816
  <xsl:attribute name="id">
5737
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
5817
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_p_',$p_num,'_',$divide)"/>
5738
5818
  </xsl:attribute>
5739
5819
 
5740
5820
  <!-- <xsl:copy-of select="node()" /> -->
@@ -5798,7 +5878,7 @@
5798
5878
  <xsl:variable name="num" select="count(preceding-sibling::word) + 1"/>
5799
5879
  <xsl:copy>
5800
5880
  <xsl:attribute name="id">
5801
- <xsl:value-of select="concat($id,'_',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
5881
+ <xsl:value-of select="concat($id,'@',$row_number,'_',$col_number,'_word_',$num,'_',$divide)"/>
5802
5882
  </xsl:attribute>
5803
5883
  <xsl:copy-of select="node()"/>
5804
5884
  </xsl:copy>
@@ -6325,6 +6405,12 @@
6325
6405
  <xsl:when test="@updatetype = 'true'">
6326
6406
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
6327
6407
  </xsl:when>
6408
+ <xsl:when test="contains(@target, concat('_', $inputxml_filename_prefix, '_attachments'))">
6409
+ <!-- link to the PDF attachment -->
6410
+ <xsl:variable name="target_" select="translate(@target, '\', '/')"/>
6411
+ <xsl:variable name="target__" select="substring-after($target_, concat('_', $inputxml_filename_prefix, '_attachments', '/'))"/>
6412
+ <xsl:value-of select="concat('url(embedded-file:', $target__, ')')"/>
6413
+ </xsl:when>
6328
6414
  <xsl:otherwise>
6329
6415
  <xsl:value-of select="normalize-space(@target)"/>
6330
6416
  </xsl:otherwise>
@@ -6732,6 +6818,7 @@
6732
6818
  <xsl:variable name="isAdded" select="@added"/>
6733
6819
  <xsl:variable name="isDeleted" select="@deleted"/>
6734
6820
  <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
6821
+ <xsl:call-template name="refine_figure-block-style"/>
6735
6822
 
6736
6823
  <xsl:call-template name="setTrackChangesStyles">
6737
6824
  <xsl:with-param name="isAdded" select="$isAdded"/>
@@ -8621,7 +8708,7 @@
8621
8708
  <!-- ====== -->
8622
8709
  <xsl:template match="*[local-name() = 'termexample']">
8623
8710
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
8624
-
8711
+ <xsl:call-template name="refine_termexample-style"/>
8625
8712
  <xsl:call-template name="setBlockSpanAll"/>
8626
8713
 
8627
8714
  <xsl:apply-templates select="*[local-name()='name']"/>
@@ -11119,10 +11206,10 @@
11119
11206
 
11120
11207
  <xsl:template name="addPDFUAmeta">
11121
11208
  <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
11122
- <pdf:dictionary type="normal" key="ViewerPreferences">
11123
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
11124
- </pdf:dictionary>
11125
- </pdf:catalog>
11209
+ <pdf:dictionary type="normal" key="ViewerPreferences">
11210
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
11211
+ </pdf:dictionary>
11212
+ </pdf:catalog>
11126
11213
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
11127
11214
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
11128
11215
  <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
@@ -11174,6 +11261,19 @@
11174
11261
  </rdf:Description>
11175
11262
  </rdf:RDF>
11176
11263
  </x:xmpmeta>
11264
+ <!-- add attachments -->
11265
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']">
11266
+ <xsl:choose>
11267
+ <xsl:when test="normalize-space() != ''">
11268
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{.}" filename="{@name}"/>
11269
+ </xsl:when>
11270
+ <xsl:otherwise>
11271
+ <!-- _{filename}_attachments -->
11272
+ <xsl:variable name="url" select="concat('url(file:///',$inputxml_basepath, '_', $inputxml_filename_prefix, '_attachments', '/', @name, ')')"/>
11273
+ <pdf:embedded-file xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf" src="{$url}" filename="{@name}"/>
11274
+ </xsl:otherwise>
11275
+ </xsl:choose>
11276
+ </xsl:for-each>
11177
11277
  </xsl:template> <!-- addPDFUAmeta -->
11178
11278
 
11179
11279
  <xsl:template name="getId">
@@ -157,10 +157,6 @@ module IsoDoc
157
157
  bibitem["hidden"] == "true" || bibitem.parent["hidden"] == "true"
158
158
  end
159
159
 
160
- def bibrenderer
161
- ::Relaton::Render::Ogc::General.new(language: @lang)
162
- end
163
-
164
160
  def bibrender_formattedref(formattedref, xml); end
165
161
 
166
162
  def bibrender_relaton(xml, renderings)
@@ -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">