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">
@@ -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">