metanorma-mpfa 0.5.3 → 0.5.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -96,6 +96,10 @@
96
96
 
97
97
  <xsl:call-template name="addPDFUAmeta"/>
98
98
 
99
+ <xsl:call-template name="addBookmarks">
100
+ <xsl:with-param name="contents" select="$contents"/>
101
+ </xsl:call-template>
102
+
99
103
  <fo:page-sequence master-reference="cover" force-page-count="no-force">
100
104
  <fo:static-content flow-name="cover-header">
101
105
  <fo:block-container height="100%">
@@ -171,7 +175,7 @@
171
175
  </xsl:variable>
172
176
  <fo:block font-size="14pt" margin-bottom="15.5pt"><xsl:value-of select="$title-toc"/></fo:block>
173
177
  <fo:block line-height="115%">
174
- <xsl:for-each select="xalan:nodeset($contents)//item">
178
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']">
175
179
  <fo:block>
176
180
  <xsl:if test="@level = 1">
177
181
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -193,8 +197,8 @@
193
197
  </fo:list-item-label>
194
198
  <fo:list-item-body start-indent="body-start()">
195
199
  <fo:block text-align-last="justify">
196
- <fo:basic-link internal-destination="{@id}" fox:alt-text="text()">
197
- <xsl:apply-templates/>
200
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
201
+ <xsl:apply-templates select="title"/>
198
202
  <fo:inline keep-together.within-line="always">
199
203
  <fo:leader leader-pattern="dots"/>
200
204
  <fo:page-number-citation ref-id="{@id}"/>
@@ -274,25 +278,34 @@
274
278
  </xsl:variable>
275
279
 
276
280
  <xsl:variable name="display">
277
- <xsl:choose>
278
- <xsl:when test="ancestor-or-self::mpfd:bibitem">false</xsl:when>
279
- <xsl:when test="ancestor-or-self::mpfd:term">false</xsl:when>
281
+ <xsl:choose>
280
282
  <xsl:when test="$level &gt;= 3">false</xsl:when>
281
283
  <xsl:otherwise>true</xsl:otherwise>
282
284
  </xsl:choose>
283
285
  </xsl:variable>
284
286
 
285
- <xsl:if test="$display = 'true'">
287
+ <xsl:variable name="skip">
288
+ <xsl:choose>
289
+ <xsl:when test="ancestor-or-self::mpfd:bibitem">true</xsl:when>
290
+ <xsl:when test="ancestor-or-self::mpfd:term">true</xsl:when>
291
+ <xsl:otherwise>false</xsl:otherwise>
292
+ </xsl:choose>
293
+ </xsl:variable>
294
+
295
+ <xsl:if test="$skip = 'false'">
286
296
 
287
297
  <xsl:variable name="title">
288
298
  <xsl:call-template name="getName"/>
289
299
  </xsl:variable>
290
300
 
291
- <item level="{$level}" section="{$section}" type="{$type}">
301
+ <item level="{$level}" section="{$section}" type="{$type}" display="{$display}">
292
302
  <xsl:call-template name="setId"/>
293
- <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
303
+ <title>
304
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
305
+ </title>
306
+ <xsl:apply-templates mode="contents"/>
294
307
  </item>
295
- <xsl:apply-templates mode="contents"/>
308
+
296
309
  </xsl:if>
297
310
 
298
311
  </xsl:template>
@@ -783,6 +796,12 @@
783
796
 
784
797
  </title-edition>
785
798
 
799
+ <title-edition lang="fr">
800
+
801
+ <xsl:text>Édition </xsl:text>
802
+
803
+ </title-edition>
804
+
786
805
 
787
806
  <title-toc lang="en">
788
807
 
@@ -889,7 +908,9 @@
889
908
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
890
909
  </xsl:otherwise>
891
910
  </xsl:choose>
892
- </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="link-style">
911
+ </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="root-style">
912
+
913
+ </xsl:attribute-set><xsl:attribute-set name="link-style">
893
914
 
894
915
  <xsl:attribute name="color">blue</xsl:attribute>
895
916
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
@@ -2782,12 +2803,101 @@
2782
2803
 
2783
2804
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
2784
2805
  </fo:block>
2785
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
2806
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
2786
2807
  <xsl:apply-templates mode="contents"/>
2787
2808
  <xsl:text> </xsl:text>
2788
- </xsl:template><xsl:template match="text()" mode="contents">
2809
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="bookmarks">
2810
+ <xsl:apply-templates mode="bookmarks"/>
2811
+ <xsl:text> </xsl:text>
2812
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
2789
2813
  <xsl:value-of select="."/>
2790
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
2814
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
2815
+ <xsl:value-of select="."/>
2816
+ </xsl:template><xsl:template match="node()" mode="contents">
2817
+ <xsl:apply-templates mode="contents"/>
2818
+ </xsl:template><xsl:template match="node()" mode="bookmarks">
2819
+ <xsl:apply-templates mode="bookmarks"/>
2820
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
2821
+ <xsl:apply-templates select="."/>
2822
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
2823
+ <xsl:apply-templates mode="bookmarks"/>
2824
+ </xsl:template><xsl:template name="addBookmarks">
2825
+ <xsl:param name="contents"/>
2826
+ <xsl:if test="xalan:nodeset($contents)//item">
2827
+ <fo:bookmark-tree>
2828
+ <xsl:choose>
2829
+ <xsl:when test="xalan:nodeset($contents)/doc">
2830
+ <xsl:choose>
2831
+ <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
2832
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
2833
+ <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
2834
+ <fo:bookmark-title>
2835
+ <xsl:variable name="bookmark-title_">
2836
+ <xsl:choose>
2837
+ <xsl:when test="@lang = 'en'">
2838
+
2839
+
2840
+ </xsl:when>
2841
+ <xsl:when test="@lang = 'fr'">
2842
+
2843
+
2844
+ </xsl:when>
2845
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
2846
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
2847
+ </xsl:choose>
2848
+ </xsl:variable>
2849
+ <xsl:choose>
2850
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
2851
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
2852
+ </xsl:when>
2853
+ <xsl:otherwise>
2854
+ <xsl:choose>
2855
+ <xsl:when test="@lang = 'en'">English</xsl:when>
2856
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
2857
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
2858
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
2859
+ </xsl:choose>
2860
+ </xsl:otherwise>
2861
+ </xsl:choose>
2862
+ </fo:bookmark-title>
2863
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
2864
+ </fo:bookmark>
2865
+
2866
+ </xsl:for-each>
2867
+ </xsl:when>
2868
+ <xsl:otherwise>
2869
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
2870
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
2871
+ </xsl:for-each>
2872
+ </xsl:otherwise>
2873
+ </xsl:choose>
2874
+ </xsl:when>
2875
+ <xsl:otherwise>
2876
+ <xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
2877
+ </xsl:otherwise>
2878
+ </xsl:choose>
2879
+
2880
+
2881
+
2882
+
2883
+
2884
+
2885
+
2886
+
2887
+ </fo:bookmark-tree>
2888
+ </xsl:if>
2889
+ </xsl:template><xsl:template match="item" mode="bookmark">
2890
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
2891
+ <fo:bookmark-title>
2892
+ <xsl:if test="@section != ''">
2893
+ <xsl:value-of select="@section"/>
2894
+ <xsl:text> </xsl:text>
2895
+ </xsl:if>
2896
+ <xsl:value-of select="normalize-space(title)"/>
2897
+ </fo:bookmark-title>
2898
+ <xsl:apply-templates mode="bookmark"/>
2899
+ </fo:bookmark>
2900
+ </xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
2791
2901
  <xsl:if test="normalize-space() != ''">
2792
2902
  <fo:block xsl:use-attribute-sets="figure-name-style">
2793
2903
 
@@ -2845,7 +2955,7 @@
2845
2955
  <xsl:apply-templates/>
2846
2956
  </xsl:otherwise>
2847
2957
  </xsl:choose>
2848
- </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
2958
+ </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
2849
2959
  <xsl:text> </xsl:text>
2850
2960
  </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
2851
2961
  <xsl:copy>
@@ -3441,20 +3551,29 @@
3441
3551
  <!-- 0xA0 to space replacement -->
3442
3552
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
3443
3553
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
3444
- <fo:block-container margin-left="0mm">
3445
- <xsl:if test="parent::*[local-name() = 'note']">
3446
- <xsl:attribute name="margin-left">
3447
- <xsl:choose>
3448
- <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3449
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3450
- </xsl:choose>
3451
- </xsl:attribute>
3452
-
3453
- </xsl:if>
3454
- <fo:block-container margin-left="0mm">
3455
- <xsl:apply-templates select="." mode="ul_ol"/>
3456
- </fo:block-container>
3457
- </fo:block-container>
3554
+ <xsl:choose>
3555
+ <xsl:when test="parent::*[local-name() = 'note']">
3556
+ <fo:block-container>
3557
+ <xsl:attribute name="margin-left">
3558
+ <xsl:choose>
3559
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3560
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3561
+ </xsl:choose>
3562
+ </xsl:attribute>
3563
+
3564
+ <fo:block-container margin-left="0mm">
3565
+ <fo:block>
3566
+ <xsl:apply-templates select="." mode="ul_ol"/>
3567
+ </fo:block>
3568
+ </fo:block-container>
3569
+ </fo:block-container>
3570
+ </xsl:when>
3571
+ <xsl:otherwise>
3572
+ <fo:block>
3573
+ <xsl:apply-templates select="." mode="ul_ol"/>
3574
+ </fo:block>
3575
+ </xsl:otherwise>
3576
+ </xsl:choose>
3458
3577
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
3459
3578
  <!-- <row>
3460
3579
  <date>05-07-2013</date>
@@ -3748,6 +3867,7 @@
3748
3867
 
3749
3868
  <xsl:value-of select="document('')//*/namespace::mpfd"/>
3750
3869
 
3870
+
3751
3871
  </xsl:variable>
3752
3872
  <xsl:if test="$documentNS != $XSLNS">
3753
3873
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -3773,4 +3893,21 @@
3773
3893
  </xsl:otherwise>
3774
3894
  </xsl:choose>
3775
3895
  </xsl:attribute>
3896
+ </xsl:template><xsl:template name="add-letter-spacing">
3897
+ <xsl:param name="text"/>
3898
+ <xsl:param name="letter-spacing" select="'0.15'"/>
3899
+ <xsl:if test="string-length($text) &gt; 0">
3900
+ <xsl:variable name="char" select="substring($text, 1, 1)"/>
3901
+ <fo:inline padding-right="{$letter-spacing}mm">
3902
+ <xsl:if test="$char = '®'">
3903
+ <xsl:attribute name="font-size">58%</xsl:attribute>
3904
+ <xsl:attribute name="baseline-shift">30%</xsl:attribute>
3905
+ </xsl:if>
3906
+ <xsl:value-of select="$char"/>
3907
+ </fo:inline>
3908
+ <xsl:call-template name="add-letter-spacing">
3909
+ <xsl:with-param name="text" select="substring($text, 2)"/>
3910
+ <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
3911
+ </xsl:call-template>
3912
+ </xsl:if>
3776
3913
  </xsl:template></xsl:stylesheet>
@@ -75,7 +75,7 @@ module IsoDoc
75
75
  end
76
76
 
77
77
  def annex_names(clause, num)
78
- @anchors[clause["id"]] = { label: annex_name_lbl(clause, num),
78
+ @anchors[clause["id"]] = { label: annex_name_lbl(clause, num), value: num,
79
79
  xref: "#{@labels['annex']} #{num}", level: 1 }
80
80
  if a = single_annex_special_section(clause)
81
81
  annex_names1(a, "#{num}", 1)
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module MPFA
3
- VERSION = "0.5.3"
3
+ VERSION = "0.5.4"
4
4
  end
5
5
  end
@@ -29,7 +29,7 @@ Gem::Specification.new do |spec|
29
29
  spec.required_ruby_version = Gem::Requirement.new(">= 2.4.0")
30
30
 
31
31
  spec.add_dependency "htmlentities", "~> 4.3.4"
32
- spec.add_dependency "metanorma-standoc", "~> 1.5.0"
32
+ spec.add_dependency "metanorma-standoc", "~> 1.6.0"
33
33
  spec.add_dependency "isodoc", "~> 1.2.0"
34
34
  spec.add_dependency "twitter_cldr"
35
35
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-mpfa
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.5.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-09-11 00:00:00.000000000 Z
11
+ date: 2020-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: htmlentities
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.5.0
33
+ version: 1.6.0
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.5.0
40
+ version: 1.6.0
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: isodoc
43
43
  requirement: !ruby/object:Gem::Requirement