metanorma-ogc 2.5.2 → 2.5.3

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: ed52d084ad8d9bcd783e6cc8c8e5564a1eeae09d007ab43177681331be41d366
4
- data.tar.gz: 8619fdaf6d0d8b7de450ba16383dd1ed1d2ece1fd903f80034d138873067b5a4
3
+ metadata.gz: f0877a135122a9679c77a798d1dcdbb87ab12eb88064d4e9cb0b27e6801ce01e
4
+ data.tar.gz: 96698d9f3307659aae17d583013669f255b66fb26da573ec1a5c6895bb305f2d
5
5
  SHA512:
6
- metadata.gz: 22bc6e3c49034f83122b1407d35010fd8ba4a6aae483206c2c169568cde528d37fa8514afe387b7e1a83ae2124edd17ba18bee22fdbf390b8929fe5e881ad12f
7
- data.tar.gz: 930ee5cc2220a4c492ac73a7355b7c5684aa9be9b33ccc8a0721ddabbcfa22073dc4cfdf0131460a8998ede9749c9bde90e13ef8648f6ff9a2e6840d111ae81f
6
+ metadata.gz: 87400e1bc50e17d41f0ee8ac284d0b711eb90537904751cf974073a59294aab85ff65167df3cddc3d5cebd7c17e1abb601e54a3e8fe7261e414f9450ed885a57
7
+ data.tar.gz: 9a97e9cc207be3725110845bbc29d13c688cba3d58ad297eca15dfa53dd89ef62901561191287aecfa3e01bba431325f077230448b09c369151b0ad3e581e7eb
@@ -35,7 +35,7 @@ submission_date: Submission Date
35
35
  approval_date: Approval Date
36
36
  publication_date: Publication Date
37
37
  author: Author
38
- editor: Editor
38
+ editor_full: Editor
39
39
  contributor: Contributor
40
40
  stage_dict:
41
41
  draft: Draft
@@ -20,6 +20,11 @@ module IsoDoc
20
20
  i18nyaml: i18nyaml || @i18nyaml)
21
21
  end
22
22
 
23
+ def bibrenderer(options = {})
24
+ ::Relaton::Render::Ogc::General.new(options.merge(language: @lang,
25
+ i18nhash: @i18n.get))
26
+ end
27
+
23
28
  def fileloc(loc)
24
29
  File.join(File.dirname(__FILE__), loc)
25
30
  end
@@ -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 -->
@@ -2657,6 +2673,10 @@
2657
2673
 
2658
2674
  </xsl:attribute-set>
2659
2675
 
2676
+ <xsl:template name="refine_figure-block-style">
2677
+
2678
+ </xsl:template>
2679
+
2660
2680
  <xsl:attribute-set name="figure-style">
2661
2681
 
2662
2682
  </xsl:attribute-set>
@@ -3609,7 +3629,7 @@
3609
3629
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
3610
3630
 
3611
3631
  <xsl:variable name="colwidths">
3612
- <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')">
3613
3633
  <xsl:call-template name="calculate-column-widths">
3614
3634
  <xsl:with-param name="cols-count" select="$cols-count"/>
3615
3635
  <xsl:with-param name="table" select="$simple-table"/>
@@ -3727,6 +3747,11 @@
3727
3747
  <fo:table-column column-width="{@width}"/>
3728
3748
  </xsl:for-each>
3729
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>
3730
3755
  <xsl:otherwise>
3731
3756
  <xsl:call-template name="insertTableColumnWidth">
3732
3757
  <xsl:with-param name="colwidths" select="$colwidths"/>
@@ -5010,6 +5035,7 @@
5010
5035
  <!-- ===================== -->
5011
5036
  <!-- Definition List -->
5012
5037
  <!-- ===================== -->
5038
+
5013
5039
  <xsl:template match="*[local-name()='dl']">
5014
5040
  <xsl:variable name="isAdded" select="@added"/>
5015
5041
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -5222,10 +5248,21 @@
5222
5248
  </xsl:variable>
5223
5249
 
5224
5250
  <xsl:variable name="colwidths">
5225
- <xsl:call-template name="calculate-column-widths">
5226
- <xsl:with-param name="cols-count" select="2"/>
5227
- <xsl:with-param name="table" select="$simple-table"/>
5228
- </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>
5229
5266
  </xsl:variable>
5230
5267
 
5231
5268
  <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text>
@@ -7331,6 +7368,12 @@
7331
7368
  <xsl:when test="@updatetype = 'true'">
7332
7369
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
7333
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>
7334
7377
  <xsl:otherwise>
7335
7378
  <xsl:value-of select="normalize-space(@target)"/>
7336
7379
  </xsl:otherwise>
@@ -7744,6 +7787,7 @@
7744
7787
  <xsl:variable name="isAdded" select="@added"/>
7745
7788
  <xsl:variable name="isDeleted" select="@deleted"/>
7746
7789
  <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
7790
+ <xsl:call-template name="refine_figure-block-style"/>
7747
7791
 
7748
7792
  <xsl:call-template name="setTrackChangesStyles">
7749
7793
  <xsl:with-param name="isAdded" select="$isAdded"/>
@@ -12150,10 +12194,10 @@
12150
12194
 
12151
12195
  <xsl:template name="addPDFUAmeta">
12152
12196
  <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
12153
- <pdf:dictionary type="normal" key="ViewerPreferences">
12154
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
12155
- </pdf:dictionary>
12156
- </pdf:catalog>
12197
+ <pdf:dictionary type="normal" key="ViewerPreferences">
12198
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
12199
+ </pdf:dictionary>
12200
+ </pdf:catalog>
12157
12201
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
12158
12202
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
12159
12203
  <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
@@ -12205,6 +12249,19 @@
12205
12249
  </rdf:Description>
12206
12250
  </rdf:RDF>
12207
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>
12208
12265
  </xsl:template> <!-- addPDFUAmeta -->
12209
12266
 
12210
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 -->
@@ -2657,6 +2673,10 @@
2657
2673
 
2658
2674
  </xsl:attribute-set>
2659
2675
 
2676
+ <xsl:template name="refine_figure-block-style">
2677
+
2678
+ </xsl:template>
2679
+
2660
2680
  <xsl:attribute-set name="figure-style">
2661
2681
 
2662
2682
  </xsl:attribute-set>
@@ -3609,7 +3629,7 @@
3609
3629
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
3610
3630
 
3611
3631
  <xsl:variable name="colwidths">
3612
- <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')">
3613
3633
  <xsl:call-template name="calculate-column-widths">
3614
3634
  <xsl:with-param name="cols-count" select="$cols-count"/>
3615
3635
  <xsl:with-param name="table" select="$simple-table"/>
@@ -3727,6 +3747,11 @@
3727
3747
  <fo:table-column column-width="{@width}"/>
3728
3748
  </xsl:for-each>
3729
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>
3730
3755
  <xsl:otherwise>
3731
3756
  <xsl:call-template name="insertTableColumnWidth">
3732
3757
  <xsl:with-param name="colwidths" select="$colwidths"/>
@@ -5010,6 +5035,7 @@
5010
5035
  <!-- ===================== -->
5011
5036
  <!-- Definition List -->
5012
5037
  <!-- ===================== -->
5038
+
5013
5039
  <xsl:template match="*[local-name()='dl']">
5014
5040
  <xsl:variable name="isAdded" select="@added"/>
5015
5041
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -5222,10 +5248,21 @@
5222
5248
  </xsl:variable>
5223
5249
 
5224
5250
  <xsl:variable name="colwidths">
5225
- <xsl:call-template name="calculate-column-widths">
5226
- <xsl:with-param name="cols-count" select="2"/>
5227
- <xsl:with-param name="table" select="$simple-table"/>
5228
- </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>
5229
5266
  </xsl:variable>
5230
5267
 
5231
5268
  <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text>
@@ -7331,6 +7368,12 @@
7331
7368
  <xsl:when test="@updatetype = 'true'">
7332
7369
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
7333
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>
7334
7377
  <xsl:otherwise>
7335
7378
  <xsl:value-of select="normalize-space(@target)"/>
7336
7379
  </xsl:otherwise>
@@ -7744,6 +7787,7 @@
7744
7787
  <xsl:variable name="isAdded" select="@added"/>
7745
7788
  <xsl:variable name="isDeleted" select="@deleted"/>
7746
7789
  <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
7790
+ <xsl:call-template name="refine_figure-block-style"/>
7747
7791
 
7748
7792
  <xsl:call-template name="setTrackChangesStyles">
7749
7793
  <xsl:with-param name="isAdded" select="$isAdded"/>
@@ -12150,10 +12194,10 @@
12150
12194
 
12151
12195
  <xsl:template name="addPDFUAmeta">
12152
12196
  <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
12153
- <pdf:dictionary type="normal" key="ViewerPreferences">
12154
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
12155
- </pdf:dictionary>
12156
- </pdf:catalog>
12197
+ <pdf:dictionary type="normal" key="ViewerPreferences">
12198
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
12199
+ </pdf:dictionary>
12200
+ </pdf:catalog>
12157
12201
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
12158
12202
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
12159
12203
  <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
@@ -12205,6 +12249,19 @@
12205
12249
  </rdf:Description>
12206
12250
  </rdf:RDF>
12207
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>
12208
12265
  </xsl:template> <!-- addPDFUAmeta -->
12209
12266
 
12210
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 -->
@@ -2657,6 +2673,10 @@
2657
2673
 
2658
2674
  </xsl:attribute-set>
2659
2675
 
2676
+ <xsl:template name="refine_figure-block-style">
2677
+
2678
+ </xsl:template>
2679
+
2660
2680
  <xsl:attribute-set name="figure-style">
2661
2681
 
2662
2682
  </xsl:attribute-set>
@@ -3609,7 +3629,7 @@
3609
3629
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
3610
3630
 
3611
3631
  <xsl:variable name="colwidths">
3612
- <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')">
3613
3633
  <xsl:call-template name="calculate-column-widths">
3614
3634
  <xsl:with-param name="cols-count" select="$cols-count"/>
3615
3635
  <xsl:with-param name="table" select="$simple-table"/>
@@ -3727,6 +3747,11 @@
3727
3747
  <fo:table-column column-width="{@width}"/>
3728
3748
  </xsl:for-each>
3729
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>
3730
3755
  <xsl:otherwise>
3731
3756
  <xsl:call-template name="insertTableColumnWidth">
3732
3757
  <xsl:with-param name="colwidths" select="$colwidths"/>
@@ -5010,6 +5035,7 @@
5010
5035
  <!-- ===================== -->
5011
5036
  <!-- Definition List -->
5012
5037
  <!-- ===================== -->
5038
+
5013
5039
  <xsl:template match="*[local-name()='dl']">
5014
5040
  <xsl:variable name="isAdded" select="@added"/>
5015
5041
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -5222,10 +5248,21 @@
5222
5248
  </xsl:variable>
5223
5249
 
5224
5250
  <xsl:variable name="colwidths">
5225
- <xsl:call-template name="calculate-column-widths">
5226
- <xsl:with-param name="cols-count" select="2"/>
5227
- <xsl:with-param name="table" select="$simple-table"/>
5228
- </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>
5229
5266
  </xsl:variable>
5230
5267
 
5231
5268
  <!-- <xsl:text disable-output-escaping="yes">&lt;!- -</xsl:text>
@@ -7331,6 +7368,12 @@
7331
7368
  <xsl:when test="@updatetype = 'true'">
7332
7369
  <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
7333
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>
7334
7377
  <xsl:otherwise>
7335
7378
  <xsl:value-of select="normalize-space(@target)"/>
7336
7379
  </xsl:otherwise>
@@ -7744,6 +7787,7 @@
7744
7787
  <xsl:variable name="isAdded" select="@added"/>
7745
7788
  <xsl:variable name="isDeleted" select="@deleted"/>
7746
7789
  <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
7790
+ <xsl:call-template name="refine_figure-block-style"/>
7747
7791
 
7748
7792
  <xsl:call-template name="setTrackChangesStyles">
7749
7793
  <xsl:with-param name="isAdded" select="$isAdded"/>
@@ -12150,10 +12194,10 @@
12150
12194
 
12151
12195
  <xsl:template name="addPDFUAmeta">
12152
12196
  <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
12153
- <pdf:dictionary type="normal" key="ViewerPreferences">
12154
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
12155
- </pdf:dictionary>
12156
- </pdf:catalog>
12197
+ <pdf:dictionary type="normal" key="ViewerPreferences">
12198
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
12199
+ </pdf:dictionary>
12200
+ </pdf:catalog>
12157
12201
  <x:xmpmeta xmlns:x="adobe:ns:meta/">
12158
12202
  <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
12159
12203
  <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
@@ -12205,6 +12249,19 @@
12205
12249
  </rdf:Description>
12206
12250
  </rdf:RDF>
12207
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>
12208
12265
  </xsl:template> <!-- addPDFUAmeta -->
12209
12266
 
12210
12267
  <xsl:template name="getId">