metanorma-iec 1.3.4 → 1.3.8
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/rake.yml +1 -1
- data/.rubocop.yml +1 -1
- data/lib/asciidoctor/iec/front.rb +64 -46
- data/lib/asciidoctor/iec/isodoc.rng +62 -8
- data/lib/asciidoctor/iec/isostandard.rng +7 -3
- data/lib/isodoc/iec/base_convert.rb +20 -14
- data/lib/isodoc/iec/html_convert.rb +6 -6
- data/lib/isodoc/iec/iec.international-standard.xsl +576 -66
- data/lib/isodoc/iec/metadata.rb +1 -1
- data/lib/isodoc/iec/pdf_convert.rb +1 -1
- data/lib/isodoc/iec/presentation_xml_convert.rb +17 -17
- data/lib/isodoc/iec/word_convert.rb +69 -19
- data/lib/metanorma/iec/version.rb +1 -1
- data/metanorma-iec.gemspec +2 -2
- data/spec/asciidoctor/blocks_spec.rb +3 -5
- data/spec/isodoc/blocks_spec.rb +2 -2
- data/spec/isodoc/i18n_spec.rb +346 -432
- data/spec/isodoc/iev_spec.rb +508 -519
- data/spec/isodoc/inline_spec.rb +2 -2
- data/spec/isodoc/postproc_spec.rb +221 -192
- data/spec/isodoc/ref_spec.rb +6 -6
- data/spec/isodoc/section_spec.rb +334 -339
- data/spec/isodoc/terms_spec.rb +1 -1
- data/spec/spec_helper.rb +2 -0
- metadata +5 -5
@@ -14,14 +14,14 @@ module IsoDoc
|
|
14
14
|
def default_fonts(options)
|
15
15
|
{
|
16
16
|
bodyfont: (options[:script] == "Hans" ? '"Source Han Sans",serif' : '"Arial",sans-serif'),
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
17
|
+
headerfont: (options[:script] == "Hans" ? '"Source Han Sans",sans-serif' : '"Arial",sans-serif'),
|
18
|
+
monospacefont: '"Courier New",monospace',
|
19
|
+
monospacefontsize: "1.0em",
|
20
|
+
footnotefontsize: "0.9em",
|
21
21
|
}
|
22
22
|
end
|
23
23
|
|
24
|
-
def default_file_locations(
|
24
|
+
def default_file_locations(_options)
|
25
25
|
@libdir = File.dirname(__FILE__)
|
26
26
|
{
|
27
27
|
htmlstylesheet: html_doc_path("htmlstyle.scss"),
|
@@ -30,7 +30,7 @@ module IsoDoc
|
|
30
30
|
}
|
31
31
|
end
|
32
32
|
|
33
|
-
def htmlstyle(
|
33
|
+
def htmlstyle(_docxml)
|
34
34
|
docxml = super
|
35
35
|
b = docxml.at("div[@class = 'boilerplate_legal']/ol")
|
36
36
|
b and b["type"] = "1"
|
@@ -20,8 +20,12 @@
|
|
20
20
|
|
21
21
|
|
22
22
|
<xsl:variable name="debug">false</xsl:variable>
|
23
|
-
<xsl:variable name="pageWidth" select="
|
24
|
-
<xsl:variable name="pageHeight" select="
|
23
|
+
<xsl:variable name="pageWidth" select="210"/>
|
24
|
+
<xsl:variable name="pageHeight" select="297"/>
|
25
|
+
<xsl:variable name="marginLeftRight1" select="25"/>
|
26
|
+
<xsl:variable name="marginLeftRight2" select="25"/>
|
27
|
+
<xsl:variable name="marginTop" select="31"/>
|
28
|
+
<xsl:variable name="marginBottom" select="15"/>
|
25
29
|
|
26
30
|
<xsl:variable name="copyrightText" select="concat('© ', //iec:iec-standard/iec:bibdata/iec:copyright/iec:owner/iec:organization/iec:abbreviation, ':', //iec:iec-standard/iec:bibdata/iec:copyright/iec:from)"/>
|
27
31
|
<!-- <xsl:variable name="lang-1st-letter" select="concat('(', translate(substring(iec:iec-standard/iec:bibdata/iec:language,1,1),$lower, $upper), ')')"/> -->
|
@@ -160,14 +164,14 @@
|
|
160
164
|
<fo:root font-family="Arial, Times New Roman, STIX Two Math, Source Han Sans" font-size="10pt" xml:lang="{$lang}">
|
161
165
|
<fo:layout-master-set>
|
162
166
|
<!-- cover pages -->
|
163
|
-
<fo:simple-page-master master-name="cover" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
167
|
+
<fo:simple-page-master master-name="cover" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
164
168
|
<fo:region-body margin-top="17.5mm" margin-bottom="12.5mm" margin-left="18mm" margin-right="20.5mm"/>
|
165
169
|
<fo:region-before region-name="header" extent="17.5mm"/>
|
166
170
|
<fo:region-after region-name="footer" extent="12.5mm" precedence="true"/>
|
167
171
|
<fo:region-start region-name="left-region" extent="18mm"/>
|
168
172
|
<fo:region-end region-name="right-region" extent="20.5mm"/>
|
169
173
|
</fo:simple-page-master>
|
170
|
-
<fo:simple-page-master master-name="cover_2nd" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
174
|
+
<fo:simple-page-master master-name="cover_2nd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
171
175
|
<fo:region-body margin-top="17.5mm" margin-bottom="12.5mm" margin-left="25mm" margin-right="25mm" column-count="2" column-gap="5mm"/>
|
172
176
|
<fo:region-before region-name="header" extent="17.5mm"/>
|
173
177
|
<fo:region-after region-name="footer" extent="12.5mm" precedence="true"/>
|
@@ -175,7 +179,7 @@
|
|
175
179
|
<fo:region-end region-name="right-region" extent="25mm"/>
|
176
180
|
</fo:simple-page-master>
|
177
181
|
|
178
|
-
<fo:simple-page-master master-name="cover-FDIS" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
182
|
+
<fo:simple-page-master master-name="cover-FDIS" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
179
183
|
<fo:region-body margin-top="17.5mm" margin-bottom="29mm" margin-left="18mm" margin-right="19mm"/>
|
180
184
|
<fo:region-before region-name="header" extent="17.5mm"/>
|
181
185
|
<fo:region-after region-name="footer-FDIS" extent="29mm"/>
|
@@ -184,20 +188,20 @@
|
|
184
188
|
</fo:simple-page-master>
|
185
189
|
|
186
190
|
<!-- odd pages -->
|
187
|
-
<fo:simple-page-master master-name="odd" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
188
|
-
<fo:region-body margin-top="
|
189
|
-
<fo:region-before region-name="header-odd" extent="
|
190
|
-
<fo:region-after region-name="footer" extent="
|
191
|
-
<fo:region-start region-name="left-region" extent="
|
192
|
-
<fo:region-end region-name="right-region" extent="
|
191
|
+
<fo:simple-page-master master-name="odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
192
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
|
193
|
+
<fo:region-before region-name="header-odd" extent="{$marginTop}mm"/>
|
194
|
+
<fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
|
195
|
+
<fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
|
196
|
+
<fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
|
193
197
|
</fo:simple-page-master>
|
194
198
|
<!-- even pages -->
|
195
|
-
<fo:simple-page-master master-name="even" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
196
|
-
<fo:region-body margin-top="
|
197
|
-
<fo:region-before region-name="header-even" extent="
|
198
|
-
<fo:region-after region-name="footer" extent="
|
199
|
-
<fo:region-start region-name="left-region" extent="
|
200
|
-
<fo:region-end region-name="right-region" extent="
|
199
|
+
<fo:simple-page-master master-name="even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
200
|
+
<fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
|
201
|
+
<fo:region-before region-name="header-even" extent="{$marginTop}mm"/>
|
202
|
+
<fo:region-after region-name="footer" extent="{$marginBottom}mm"/>
|
203
|
+
<fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
|
204
|
+
<fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
|
201
205
|
</fo:simple-page-master>
|
202
206
|
<fo:page-sequence-master master-name="document">
|
203
207
|
<fo:repeatable-page-master-alternatives>
|
@@ -206,11 +210,11 @@
|
|
206
210
|
</fo:repeatable-page-master-alternatives>
|
207
211
|
</fo:page-sequence-master>
|
208
212
|
|
209
|
-
<fo:simple-page-master master-name="blank-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
213
|
+
<fo:simple-page-master master-name="blank-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
210
214
|
<fo:region-body margin-top="107mm" margin-bottom="0mm" margin-left="18mm" margin-right="0mm"/>
|
211
215
|
</fo:simple-page-master>
|
212
216
|
|
213
|
-
<fo:simple-page-master master-name="last-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
|
217
|
+
<fo:simple-page-master master-name="last-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
|
214
218
|
<fo:region-body margin-top="107mm" margin-bottom="0mm" margin-left="18mm" margin-right="0mm" background-color="rgb(236, 236, 236)"/>
|
215
219
|
<fo:region-before region-name="header" extent="107mm"/>
|
216
220
|
<fo:region-start region-name="left-region" extent="18mm"/>
|
@@ -2694,7 +2698,7 @@
|
|
2694
2698
|
|
2695
2699
|
|
2696
2700
|
|
2697
|
-
|
2701
|
+
|
2698
2702
|
</xsl:attribute-set><xsl:attribute-set name="example-style">
|
2699
2703
|
|
2700
2704
|
|
@@ -2753,7 +2757,10 @@
|
|
2753
2757
|
|
2754
2758
|
|
2755
2759
|
|
2756
|
-
|
2760
|
+
|
2761
|
+
</xsl:attribute-set><xsl:variable name="table-border_">
|
2762
|
+
|
2763
|
+
</xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-name-style">
|
2757
2764
|
<xsl:attribute name="keep-with-next">always</xsl:attribute>
|
2758
2765
|
|
2759
2766
|
|
@@ -2774,6 +2781,8 @@
|
|
2774
2781
|
|
2775
2782
|
|
2776
2783
|
|
2784
|
+
</xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style">
|
2785
|
+
|
2777
2786
|
</xsl:attribute-set><xsl:attribute-set name="appendix-style">
|
2778
2787
|
|
2779
2788
|
|
@@ -2801,6 +2810,7 @@
|
|
2801
2810
|
|
2802
2811
|
|
2803
2812
|
|
2813
|
+
|
2804
2814
|
</xsl:attribute-set><xsl:attribute-set name="note-style">
|
2805
2815
|
|
2806
2816
|
|
@@ -2821,6 +2831,7 @@
|
|
2821
2831
|
|
2822
2832
|
|
2823
2833
|
|
2834
|
+
|
2824
2835
|
</xsl:attribute-set><xsl:variable name="note-body-indent">10mm</xsl:variable><xsl:variable name="note-body-indent-table">5mm</xsl:variable><xsl:attribute-set name="note-name-style">
|
2825
2836
|
|
2826
2837
|
|
@@ -2864,10 +2875,12 @@
|
|
2864
2875
|
|
2865
2876
|
|
2866
2877
|
|
2878
|
+
|
2867
2879
|
</xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
|
2868
2880
|
|
2869
2881
|
|
2870
2882
|
|
2883
|
+
|
2871
2884
|
</xsl:attribute-set><xsl:attribute-set name="quote-style">
|
2872
2885
|
|
2873
2886
|
|
@@ -2930,6 +2943,7 @@
|
|
2930
2943
|
|
2931
2944
|
|
2932
2945
|
|
2946
|
+
|
2933
2947
|
|
2934
2948
|
|
2935
2949
|
|
@@ -3007,6 +3021,8 @@
|
|
3007
3021
|
<xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
|
3008
3022
|
|
3009
3023
|
|
3024
|
+
</xsl:attribute-set><xsl:attribute-set name="list-style">
|
3025
|
+
|
3010
3026
|
</xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
|
3011
3027
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
|
3012
3028
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
|
@@ -3017,14 +3033,15 @@
|
|
3017
3033
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
|
3018
3034
|
|
3019
3035
|
<!-- Normative references -->
|
3020
|
-
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
|
3036
|
+
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]" mode="contents"/>
|
3021
3037
|
<!-- Terms and definitions -->
|
3022
3038
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]" mode="contents"/>
|
3023
3039
|
<!-- Another main sections -->
|
3024
3040
|
<xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]" mode="contents"/>
|
3025
3041
|
<xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
|
3026
3042
|
<!-- Bibliography -->
|
3027
|
-
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
|
3043
|
+
<xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
|
3044
|
+
|
3028
3045
|
</xsl:template><xsl:template name="processPrefaceSectionsDefault">
|
3029
3046
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
|
3030
3047
|
<xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
|
@@ -3060,13 +3077,15 @@
|
|
3060
3077
|
<xsl:variable name="table">
|
3061
3078
|
|
3062
3079
|
<xsl:variable name="simple-table">
|
3063
|
-
<xsl:call-template name="getSimpleTable"/>
|
3080
|
+
<xsl:call-template name="getSimpleTable"/>
|
3064
3081
|
</xsl:variable>
|
3065
3082
|
|
3066
3083
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
3067
|
-
<fo:block> </fo:block>
|
3084
|
+
<fo:block> </fo:block>
|
3068
3085
|
</xsl:if> -->
|
3069
3086
|
|
3087
|
+
|
3088
|
+
<!-- Display table's name before table as standalone block -->
|
3070
3089
|
<!-- $namespace = 'iso' or -->
|
3071
3090
|
|
3072
3091
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
@@ -3148,6 +3167,12 @@
|
|
3148
3167
|
|
3149
3168
|
|
3150
3169
|
|
3170
|
+
|
3171
|
+
|
3172
|
+
|
3173
|
+
<!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
|
3174
|
+
|
3175
|
+
|
3151
3176
|
<xsl:variable name="table_width">
|
3152
3177
|
<!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
|
3153
3178
|
100%
|
@@ -3164,6 +3189,7 @@
|
|
3164
3189
|
|
3165
3190
|
|
3166
3191
|
|
3192
|
+
|
3167
3193
|
<attribute name="border">0.5pt solid black</attribute>
|
3168
3194
|
|
3169
3195
|
|
@@ -3174,6 +3200,7 @@
|
|
3174
3200
|
|
3175
3201
|
|
3176
3202
|
|
3203
|
+
|
3177
3204
|
</xsl:variable>
|
3178
3205
|
|
3179
3206
|
|
@@ -3315,6 +3342,9 @@
|
|
3315
3342
|
<fo:block xsl:use-attribute-sets="table-name-style">
|
3316
3343
|
|
3317
3344
|
|
3345
|
+
|
3346
|
+
|
3347
|
+
|
3318
3348
|
<xsl:choose>
|
3319
3349
|
<xsl:when test="$continued = 'true'">
|
3320
3350
|
<!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
|
@@ -3462,6 +3492,7 @@
|
|
3462
3492
|
<!-- font-weight="bold" -->
|
3463
3493
|
<fo:table-header>
|
3464
3494
|
|
3495
|
+
|
3465
3496
|
<xsl:apply-templates/>
|
3466
3497
|
</fo:table-header>
|
3467
3498
|
</xsl:template><xsl:template name="table-header-title">
|
@@ -3598,6 +3629,8 @@
|
|
3598
3629
|
</xsl:choose>
|
3599
3630
|
</xsl:for-each>
|
3600
3631
|
|
3632
|
+
|
3633
|
+
|
3601
3634
|
<xsl:choose>
|
3602
3635
|
<xsl:when test="xalan:nodeset($colgroup)//*[local-name()='col']">
|
3603
3636
|
<xsl:for-each select="xalan:nodeset($colgroup)//*[local-name()='col']">
|
@@ -3623,6 +3656,7 @@
|
|
3623
3656
|
<fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
|
3624
3657
|
|
3625
3658
|
|
3659
|
+
|
3626
3660
|
<xsl:attribute name="border">solid black 0.5pt</xsl:attribute>
|
3627
3661
|
|
3628
3662
|
|
@@ -3638,6 +3672,11 @@
|
|
3638
3672
|
|
3639
3673
|
|
3640
3674
|
|
3675
|
+
|
3676
|
+
|
3677
|
+
<!-- for BSI (not PAS) display Notes before footnotes -->
|
3678
|
+
|
3679
|
+
|
3641
3680
|
<!-- except gb -->
|
3642
3681
|
|
3643
3682
|
<xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
|
@@ -3669,6 +3708,10 @@
|
|
3669
3708
|
<!-- fn processing -->
|
3670
3709
|
<xsl:call-template name="fn_display"/>
|
3671
3710
|
|
3711
|
+
|
3712
|
+
<!-- for PAS display Notes after footnotes -->
|
3713
|
+
|
3714
|
+
|
3672
3715
|
</fo:table-cell>
|
3673
3716
|
</fo:table-row>
|
3674
3717
|
</fo:table-body>
|
@@ -3725,10 +3768,13 @@
|
|
3725
3768
|
<xsl:attribute name="border-bottom">solid black 0.5pt</xsl:attribute>
|
3726
3769
|
|
3727
3770
|
|
3771
|
+
|
3772
|
+
|
3728
3773
|
</xsl:if>
|
3729
3774
|
<xsl:if test="$parent-name = 'tfoot'">
|
3730
3775
|
|
3731
3776
|
|
3777
|
+
|
3732
3778
|
<xsl:attribute name="border-left">solid black 0.5pt</xsl:attribute>
|
3733
3779
|
<xsl:attribute name="border-right">solid black 0.5pt</xsl:attribute>
|
3734
3780
|
|
@@ -3737,6 +3783,12 @@
|
|
3737
3783
|
|
3738
3784
|
|
3739
3785
|
|
3786
|
+
|
3787
|
+
|
3788
|
+
|
3789
|
+
|
3790
|
+
|
3791
|
+
|
3740
3792
|
<!-- <xsl:if test="$namespace = 'bipm'">
|
3741
3793
|
<xsl:attribute name="height">8mm</xsl:attribute>
|
3742
3794
|
</xsl:if> -->
|
@@ -3824,6 +3876,7 @@
|
|
3824
3876
|
|
3825
3877
|
|
3826
3878
|
|
3879
|
+
|
3827
3880
|
<xsl:if test="ancestor::*[local-name() = 'tfoot']">
|
3828
3881
|
<xsl:attribute name="border">solid black 0</xsl:attribute>
|
3829
3882
|
</xsl:if>
|
@@ -3841,6 +3894,9 @@
|
|
3841
3894
|
|
3842
3895
|
|
3843
3896
|
|
3897
|
+
|
3898
|
+
|
3899
|
+
|
3844
3900
|
<xsl:if test=".//*[local-name() = 'table']">
|
3845
3901
|
<xsl:attribute name="padding-right">1mm</xsl:attribute>
|
3846
3902
|
</xsl:if>
|
@@ -3867,14 +3923,20 @@
|
|
3867
3923
|
|
3868
3924
|
|
3869
3925
|
|
3926
|
+
|
3870
3927
|
<xsl:attribute name="font-size">8pt</xsl:attribute>
|
3871
3928
|
<xsl:attribute name="margin-bottom">6pt</xsl:attribute>
|
3872
3929
|
|
3873
3930
|
|
3874
3931
|
|
3875
3932
|
|
3933
|
+
|
3934
|
+
<!-- Table's note name (NOTE, for example) -->
|
3935
|
+
|
3876
3936
|
<fo:inline padding-right="2mm">
|
3877
3937
|
|
3938
|
+
|
3939
|
+
|
3878
3940
|
|
3879
3941
|
|
3880
3942
|
|
@@ -3882,6 +3944,8 @@
|
|
3882
3944
|
|
3883
3945
|
</fo:inline>
|
3884
3946
|
|
3947
|
+
|
3948
|
+
|
3885
3949
|
<xsl:apply-templates mode="process"/>
|
3886
3950
|
</fo:block>
|
3887
3951
|
|
@@ -3901,6 +3965,8 @@
|
|
3901
3965
|
<xsl:variable name="reference" select="@reference"/>
|
3902
3966
|
<xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
|
3903
3967
|
<fo:block margin-bottom="12pt">
|
3968
|
+
|
3969
|
+
|
3904
3970
|
|
3905
3971
|
|
3906
3972
|
|
@@ -3915,6 +3981,7 @@
|
|
3915
3981
|
|
3916
3982
|
|
3917
3983
|
|
3984
|
+
|
3918
3985
|
<xsl:attribute name="baseline-shift">30%</xsl:attribute>
|
3919
3986
|
<xsl:attribute name="font-size">70%</xsl:attribute>
|
3920
3987
|
|
@@ -3925,6 +3992,7 @@
|
|
3925
3992
|
<xsl:value-of select="@reference"/>
|
3926
3993
|
|
3927
3994
|
|
3995
|
+
|
3928
3996
|
</fo:inline>
|
3929
3997
|
<fo:inline>
|
3930
3998
|
|
@@ -4069,6 +4137,8 @@
|
|
4069
4137
|
<!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
|
4070
4138
|
<fo:inline font-size="80%" keep-with-previous.within-line="always">
|
4071
4139
|
|
4140
|
+
|
4141
|
+
|
4072
4142
|
<xsl:if test="ancestor::*[local-name()='td']">
|
4073
4143
|
<xsl:attribute name="font-weight">normal</xsl:attribute>
|
4074
4144
|
<!-- <xsl:attribute name="alignment-baseline">hanging</xsl:attribute> -->
|
@@ -4080,11 +4150,14 @@
|
|
4080
4150
|
|
4081
4151
|
|
4082
4152
|
|
4153
|
+
|
4154
|
+
|
4083
4155
|
<fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
|
4084
4156
|
|
4085
4157
|
|
4086
4158
|
<xsl:value-of select="@reference"/>
|
4087
4159
|
|
4160
|
+
|
4088
4161
|
</fo:basic-link>
|
4089
4162
|
</fo:inline>
|
4090
4163
|
</xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
|
@@ -4398,6 +4471,7 @@
|
|
4398
4471
|
|
4399
4472
|
<fo:table-row>
|
4400
4473
|
|
4474
|
+
|
4401
4475
|
<fo:table-cell>
|
4402
4476
|
|
4403
4477
|
<fo:block margin-top="6pt">
|
@@ -4417,6 +4491,7 @@
|
|
4417
4491
|
|
4418
4492
|
|
4419
4493
|
|
4494
|
+
|
4420
4495
|
<xsl:apply-templates/>
|
4421
4496
|
<!-- <xsl:if test="$namespace = 'gb'">
|
4422
4497
|
<xsl:if test="ancestor::*[local-name()='formula']">
|
@@ -4964,7 +5039,15 @@
|
|
4964
5039
|
<xsl:copy>
|
4965
5040
|
<xsl:apply-templates select="@*|node()" mode="mathml"/>
|
4966
5041
|
</xsl:copy>
|
4967
|
-
<
|
5042
|
+
<xsl:choose>
|
5043
|
+
<!-- if in msub, then don't add space -->
|
5044
|
+
<xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
|
5045
|
+
<!-- if next char in digit, don't add space -->
|
5046
|
+
<xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
|
5047
|
+
<xsl:otherwise>
|
5048
|
+
<mathml:mspace width="0.5ex"/>
|
5049
|
+
</xsl:otherwise>
|
5050
|
+
</xsl:choose>
|
4968
5051
|
</xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
|
4969
5052
|
<xsl:variable name="target">
|
4970
5053
|
<xsl:choose>
|
@@ -4992,6 +5075,8 @@
|
|
4992
5075
|
<xsl:attribute name="color">blue</xsl:attribute>
|
4993
5076
|
</xsl:if>
|
4994
5077
|
|
5078
|
+
|
5079
|
+
|
4995
5080
|
<xsl:choose>
|
4996
5081
|
<xsl:when test="$target_text = ''">
|
4997
5082
|
<xsl:apply-templates/>
|
@@ -5100,6 +5185,7 @@
|
|
5100
5185
|
|
5101
5186
|
|
5102
5187
|
|
5188
|
+
|
5103
5189
|
<fo:block-container margin-left="0mm">
|
5104
5190
|
|
5105
5191
|
|
@@ -5143,6 +5229,7 @@
|
|
5143
5229
|
</xsl:choose>
|
5144
5230
|
</xsl:template><xsl:template match="*[local-name() = 'termnote']">
|
5145
5231
|
<fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
|
5232
|
+
|
5146
5233
|
<fo:inline xsl:use-attribute-sets="termnote-name-style">
|
5147
5234
|
|
5148
5235
|
<xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
|
@@ -5218,6 +5305,7 @@
|
|
5218
5305
|
</xsl:call-template>
|
5219
5306
|
|
5220
5307
|
<fo:block>
|
5308
|
+
|
5221
5309
|
<xsl:apply-templates/>
|
5222
5310
|
</fo:block>
|
5223
5311
|
<xsl:call-template name="fn_display_figure"/>
|
@@ -5272,7 +5360,24 @@
|
|
5272
5360
|
</fo:instream-foreign-object>
|
5273
5361
|
</xsl:when>
|
5274
5362
|
<xsl:otherwise>
|
5275
|
-
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"
|
5363
|
+
<fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style">
|
5364
|
+
<xsl:if test="not(@mimetype = 'image/svg+xml') and ../*[local-name() = 'name'] and not(ancestor::*[local-name() = 'table'])">
|
5365
|
+
|
5366
|
+
<xsl:variable name="img_src">
|
5367
|
+
<xsl:choose>
|
5368
|
+
<xsl:when test="not(starts-with(@src, 'data:'))"><xsl:value-of select="concat($basepath, @src)"/></xsl:when>
|
5369
|
+
<xsl:otherwise><xsl:value-of select="@src"/></xsl:otherwise>
|
5370
|
+
</xsl:choose>
|
5371
|
+
</xsl:variable>
|
5372
|
+
|
5373
|
+
<xsl:variable name="scale" select="java:org.metanorma.fop.Util.getImageScale($img_src, $width_effective, $height_effective)"/>
|
5374
|
+
<xsl:if test="number($scale) < 100">
|
5375
|
+
<xsl:attribute name="content-width"><xsl:value-of select="$scale"/>%</xsl:attribute>
|
5376
|
+
</xsl:if>
|
5377
|
+
|
5378
|
+
</xsl:if>
|
5379
|
+
|
5380
|
+
</fo:external-graphic>
|
5276
5381
|
</xsl:otherwise>
|
5277
5382
|
</xsl:choose>
|
5278
5383
|
|
@@ -5340,6 +5445,253 @@
|
|
5340
5445
|
<xsl:param name="height"/>
|
5341
5446
|
<line xmlns="http://www.w3.org/2000/svg" x1="0" y1="0" x2="{$width}" y2="{$height}" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
|
5342
5447
|
<line xmlns="http://www.w3.org/2000/svg" x1="0" y1="{$height}" x2="{$width}" y2="0" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
|
5448
|
+
</xsl:template><xsl:variable name="figure_name_height">14</xsl:variable><xsl:variable name="width_effective" select="$pageWidth - $marginLeftRight1 - $marginLeftRight2"/><xsl:variable name="height_effective" select="$pageHeight - $marginTop - $marginBottom - $figure_name_height"/><xsl:variable name="image_dpi" select="96"/><xsl:variable name="width_effective_px" select="$width_effective div 25.4 * $image_dpi"/><xsl:variable name="height_effective_px" select="$height_effective div 25.4 * $image_dpi"/><xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image']) and *[local-name() = 'svg']]/*[local-name() = 'name']/*[local-name() = 'bookmark']" priority="2"/><xsl:template match="*[local-name() = 'figure'][not(*[local-name() = 'image'])]/*[local-name() = 'svg']" priority="2" name="image_svg">
|
5449
|
+
<xsl:param name="name"/>
|
5450
|
+
|
5451
|
+
<xsl:variable name="svg_content">
|
5452
|
+
<xsl:apply-templates select="." mode="svg_update"/>
|
5453
|
+
</xsl:variable>
|
5454
|
+
|
5455
|
+
<xsl:variable name="alt-text">
|
5456
|
+
<xsl:choose>
|
5457
|
+
<xsl:when test="normalize-space(../*[local-name() = 'name']) != ''">
|
5458
|
+
<xsl:value-of select="../*[local-name() = 'name']"/>
|
5459
|
+
</xsl:when>
|
5460
|
+
<xsl:when test="normalize-space($name) != ''">
|
5461
|
+
<xsl:value-of select="$name"/>
|
5462
|
+
</xsl:when>
|
5463
|
+
<xsl:otherwise>Figure</xsl:otherwise>
|
5464
|
+
</xsl:choose>
|
5465
|
+
</xsl:variable>
|
5466
|
+
|
5467
|
+
<xsl:choose>
|
5468
|
+
<xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
|
5469
|
+
<fo:block>
|
5470
|
+
<xsl:variable name="width" select="@width"/>
|
5471
|
+
<xsl:variable name="height" select="@height"/>
|
5472
|
+
|
5473
|
+
<xsl:variable name="scale_x">
|
5474
|
+
<xsl:choose>
|
5475
|
+
<xsl:when test="$width > $width_effective_px">
|
5476
|
+
<xsl:value-of select="$width_effective_px div $width"/>
|
5477
|
+
</xsl:when>
|
5478
|
+
<xsl:otherwise>1</xsl:otherwise>
|
5479
|
+
</xsl:choose>
|
5480
|
+
</xsl:variable>
|
5481
|
+
|
5482
|
+
<xsl:variable name="scale_y">
|
5483
|
+
<xsl:choose>
|
5484
|
+
<xsl:when test="$height * $scale_x > $height_effective_px">
|
5485
|
+
<xsl:value-of select="$height_effective_px div ($height * $scale_x)"/>
|
5486
|
+
</xsl:when>
|
5487
|
+
<xsl:otherwise>1</xsl:otherwise>
|
5488
|
+
</xsl:choose>
|
5489
|
+
</xsl:variable>
|
5490
|
+
|
5491
|
+
<xsl:variable name="scale">
|
5492
|
+
<xsl:choose>
|
5493
|
+
<xsl:when test="$scale_y != 1">
|
5494
|
+
<xsl:value-of select="$scale_x * $scale_y"/>
|
5495
|
+
</xsl:when>
|
5496
|
+
<xsl:otherwise>
|
5497
|
+
<xsl:value-of select="$scale_x"/>
|
5498
|
+
</xsl:otherwise>
|
5499
|
+
</xsl:choose>
|
5500
|
+
</xsl:variable>
|
5501
|
+
|
5502
|
+
<xsl:variable name="width_scale" select="round($width * $scale)"/>
|
5503
|
+
<xsl:variable name="height_scale" select="round($height * $scale)"/>
|
5504
|
+
|
5505
|
+
<fo:table table-layout="fixed" width="100%">
|
5506
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
5507
|
+
<fo:table-column column-width="{$width_scale}px"/>
|
5508
|
+
<fo:table-column column-width="proportional-column-width(1)"/>
|
5509
|
+
<fo:table-body>
|
5510
|
+
<fo:table-row>
|
5511
|
+
<fo:table-cell column-number="2">
|
5512
|
+
<fo:block>
|
5513
|
+
<fo:block-container width="{$width_scale}px" height="{$height_scale}px">
|
5514
|
+
<xsl:if test="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
5515
|
+
<fo:block line-height="0" font-size="0">
|
5516
|
+
<xsl:for-each select="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
|
5517
|
+
<xsl:call-template name="bookmark"/>
|
5518
|
+
</xsl:for-each>
|
5519
|
+
</fo:block>
|
5520
|
+
</xsl:if>
|
5521
|
+
<fo:block text-depth="0" line-height="0" font-size="0">
|
5522
|
+
|
5523
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
5524
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
5525
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
5526
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
5527
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
5528
|
+
|
5529
|
+
<xsl:apply-templates select="xalan:nodeset($svg_content)" mode="svg_remove_a"/>
|
5530
|
+
</fo:instream-foreign-object>
|
5531
|
+
</fo:block>
|
5532
|
+
|
5533
|
+
<xsl:apply-templates select=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]" mode="svg_imagemap_links">
|
5534
|
+
<xsl:with-param name="scale" select="$scale"/>
|
5535
|
+
</xsl:apply-templates>
|
5536
|
+
</fo:block-container>
|
5537
|
+
</fo:block>
|
5538
|
+
</fo:table-cell>
|
5539
|
+
</fo:table-row>
|
5540
|
+
</fo:table-body>
|
5541
|
+
</fo:table>
|
5542
|
+
</fo:block>
|
5543
|
+
|
5544
|
+
</xsl:when>
|
5545
|
+
<xsl:otherwise>
|
5546
|
+
<fo:block xsl:use-attribute-sets="image-style">
|
5547
|
+
<fo:instream-foreign-object fox:alt-text="{$alt-text}">
|
5548
|
+
<xsl:attribute name="width">100%</xsl:attribute>
|
5549
|
+
<xsl:attribute name="content-height">100%</xsl:attribute>
|
5550
|
+
<xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
|
5551
|
+
<xsl:variable name="svg_width" select="xalan:nodeset($svg_content)/*/@width"/>
|
5552
|
+
<xsl:variable name="svg_height" select="xalan:nodeset($svg_content)/*/@height"/>
|
5553
|
+
<!-- effective height 297 - 27.4 - 13 = 256.6 -->
|
5554
|
+
<!-- effective width 210 - 12.5 - 25 = 172.5 -->
|
5555
|
+
<!-- effective height / width = 1.48, 1.4 - with title -->
|
5556
|
+
<xsl:if test="$svg_height > ($svg_width * 1.4)"> <!-- for images with big height -->
|
5557
|
+
<xsl:variable name="width" select="(($svg_width * 1.4) div $svg_height) * 100"/>
|
5558
|
+
<xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
|
5559
|
+
</xsl:if>
|
5560
|
+
<xsl:attribute name="scaling">uniform</xsl:attribute>
|
5561
|
+
<xsl:copy-of select="$svg_content"/>
|
5562
|
+
</fo:instream-foreign-object>
|
5563
|
+
</fo:block>
|
5564
|
+
</xsl:otherwise>
|
5565
|
+
</xsl:choose>
|
5566
|
+
</xsl:template><xsl:template match="@*|node()" mode="svg_update">
|
5567
|
+
<xsl:copy>
|
5568
|
+
<xsl:apply-templates select="@*|node()" mode="svg_update"/>
|
5569
|
+
</xsl:copy>
|
5570
|
+
</xsl:template><xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
|
5571
|
+
<xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
|
5572
|
+
<xsl:value-of select="."/>
|
5573
|
+
</xsl:attribute>
|
5574
|
+
</xsl:template><xsl:template match="*[local-name() = 'svg'][not(@width and @height)]" mode="svg_update">
|
5575
|
+
<xsl:copy>
|
5576
|
+
<xsl:apply-templates select="@*" mode="svg_update"/>
|
5577
|
+
<xsl:variable name="viewbox">
|
5578
|
+
<xsl:call-template name="split">
|
5579
|
+
<xsl:with-param name="pText" select="@viewBox"/>
|
5580
|
+
<xsl:with-param name="sep" select="' '"/>
|
5581
|
+
</xsl:call-template>
|
5582
|
+
</xsl:variable>
|
5583
|
+
<xsl:attribute name="width">
|
5584
|
+
<xsl:value-of select="round(xalan:nodeset($viewbox)//item[3])"/>
|
5585
|
+
</xsl:attribute>
|
5586
|
+
<xsl:attribute name="height">
|
5587
|
+
<xsl:value-of select="round(xalan:nodeset($viewbox)//item[4])"/>
|
5588
|
+
</xsl:attribute>
|
5589
|
+
<xsl:apply-templates mode="svg_update"/>
|
5590
|
+
</xsl:copy>
|
5591
|
+
</xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
|
5592
|
+
<xsl:variable name="svg_content" select="document(@src)"/>
|
5593
|
+
<xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
|
5594
|
+
<xsl:for-each select="xalan:nodeset($svg_content)/node()">
|
5595
|
+
<xsl:call-template name="image_svg">
|
5596
|
+
<xsl:with-param name="name" select="$name"/>
|
5597
|
+
</xsl:call-template>
|
5598
|
+
</xsl:for-each>
|
5599
|
+
</xsl:template><xsl:template match="@*|node()" mode="svg_remove_a">
|
5600
|
+
<xsl:copy>
|
5601
|
+
<xsl:apply-templates select="@*|node()" mode="svg_remove_a"/>
|
5602
|
+
</xsl:copy>
|
5603
|
+
</xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_remove_a">
|
5604
|
+
<xsl:apply-templates mode="svg_remove_a"/>
|
5605
|
+
</xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_imagemap_links">
|
5606
|
+
<xsl:param name="scale"/>
|
5607
|
+
<xsl:variable name="dest">
|
5608
|
+
<xsl:choose>
|
5609
|
+
<xsl:when test="starts-with(@href, '#')">
|
5610
|
+
<xsl:value-of select="substring-after(@href, '#')"/>
|
5611
|
+
</xsl:when>
|
5612
|
+
<xsl:otherwise>
|
5613
|
+
<xsl:value-of select="@href"/>
|
5614
|
+
</xsl:otherwise>
|
5615
|
+
</xsl:choose>
|
5616
|
+
</xsl:variable>
|
5617
|
+
<xsl:for-each select="./*[local-name() = 'rect']">
|
5618
|
+
<xsl:call-template name="insertSVGMapLink">
|
5619
|
+
<xsl:with-param name="left" select="floor(@x * $scale)"/>
|
5620
|
+
<xsl:with-param name="top" select="floor(@y * $scale)"/>
|
5621
|
+
<xsl:with-param name="width" select="floor(@width * $scale)"/>
|
5622
|
+
<xsl:with-param name="height" select="floor(@height * $scale)"/>
|
5623
|
+
<xsl:with-param name="dest" select="$dest"/>
|
5624
|
+
</xsl:call-template>
|
5625
|
+
</xsl:for-each>
|
5626
|
+
|
5627
|
+
<xsl:for-each select="./*[local-name() = 'polygon']">
|
5628
|
+
<xsl:variable name="points">
|
5629
|
+
<xsl:call-template name="split">
|
5630
|
+
<xsl:with-param name="pText" select="@points"/>
|
5631
|
+
</xsl:call-template>
|
5632
|
+
</xsl:variable>
|
5633
|
+
<xsl:variable name="x_coords">
|
5634
|
+
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 1]">
|
5635
|
+
<xsl:sort select="." data-type="number"/>
|
5636
|
+
<x><xsl:value-of select="."/></x>
|
5637
|
+
</xsl:for-each>
|
5638
|
+
</xsl:variable>
|
5639
|
+
<xsl:variable name="y_coords">
|
5640
|
+
<xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 0]">
|
5641
|
+
<xsl:sort select="." data-type="number"/>
|
5642
|
+
<y><xsl:value-of select="."/></y>
|
5643
|
+
</xsl:for-each>
|
5644
|
+
</xsl:variable>
|
5645
|
+
<xsl:variable name="x" select="xalan:nodeset($x_coords)//x[1]"/>
|
5646
|
+
<xsl:variable name="y" select="xalan:nodeset($y_coords)//y[1]"/>
|
5647
|
+
<xsl:variable name="width" select="xalan:nodeset($x_coords)//x[last()] - $x"/>
|
5648
|
+
<xsl:variable name="height" select="xalan:nodeset($y_coords)//y[last()] - $y"/>
|
5649
|
+
<xsl:call-template name="insertSVGMapLink">
|
5650
|
+
<xsl:with-param name="left" select="floor($x * $scale)"/>
|
5651
|
+
<xsl:with-param name="top" select="floor($y * $scale)"/>
|
5652
|
+
<xsl:with-param name="width" select="floor($width * $scale)"/>
|
5653
|
+
<xsl:with-param name="height" select="floor($height * $scale)"/>
|
5654
|
+
<xsl:with-param name="dest" select="$dest"/>
|
5655
|
+
</xsl:call-template>
|
5656
|
+
</xsl:for-each>
|
5657
|
+
|
5658
|
+
<xsl:for-each select="./*[local-name() = 'circle']">
|
5659
|
+
<xsl:call-template name="insertSVGMapLink">
|
5660
|
+
<xsl:with-param name="left" select="floor((@cx - @r) * $scale)"/>
|
5661
|
+
<xsl:with-param name="top" select="floor((@cy - @r) * $scale)"/>
|
5662
|
+
<xsl:with-param name="width" select="floor(@r * 2 * $scale)"/>
|
5663
|
+
<xsl:with-param name="height" select="floor(@r * 2 * $scale)"/>
|
5664
|
+
<xsl:with-param name="dest" select="$dest"/>
|
5665
|
+
</xsl:call-template>
|
5666
|
+
</xsl:for-each>
|
5667
|
+
<xsl:for-each select="./*[local-name() = 'ellipse']">
|
5668
|
+
<xsl:call-template name="insertSVGMapLink">
|
5669
|
+
<xsl:with-param name="left" select="floor((@cx - @rx) * $scale)"/>
|
5670
|
+
<xsl:with-param name="top" select="floor((@cy - @ry) * $scale)"/>
|
5671
|
+
<xsl:with-param name="width" select="floor(@rx * 2 * $scale)"/>
|
5672
|
+
<xsl:with-param name="height" select="floor(@ry * 2 * $scale)"/>
|
5673
|
+
<xsl:with-param name="dest" select="$dest"/>
|
5674
|
+
</xsl:call-template>
|
5675
|
+
</xsl:for-each>
|
5676
|
+
</xsl:template><xsl:template name="insertSVGMapLink">
|
5677
|
+
<xsl:param name="left"/>
|
5678
|
+
<xsl:param name="top"/>
|
5679
|
+
<xsl:param name="width"/>
|
5680
|
+
<xsl:param name="height"/>
|
5681
|
+
<xsl:param name="dest"/>
|
5682
|
+
<fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
|
5683
|
+
<fo:block font-size="1pt">
|
5684
|
+
<fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
|
5685
|
+
<fo:inline-container inline-progression-dimension="100%">
|
5686
|
+
<fo:block-container height="{$height - 1}px" width="100%">
|
5687
|
+
<!-- DEBUG <xsl:if test="local-name()='polygon'">
|
5688
|
+
<xsl:attribute name="background-color">magenta</xsl:attribute>
|
5689
|
+
</xsl:if> -->
|
5690
|
+
<fo:block> </fo:block></fo:block-container>
|
5691
|
+
</fo:inline-container>
|
5692
|
+
</fo:basic-link>
|
5693
|
+
</fo:block>
|
5694
|
+
</fo:block-container>
|
5343
5695
|
</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">
|
5344
5696
|
<xsl:apply-templates mode="contents"/>
|
5345
5697
|
<xsl:text> </xsl:text>
|
@@ -5368,28 +5720,39 @@
|
|
5368
5720
|
<xsl:when test="count(xalan:nodeset($contents)/doc) > 1">
|
5369
5721
|
<xsl:for-each select="xalan:nodeset($contents)/doc">
|
5370
5722
|
<fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
|
5723
|
+
<xsl:if test="@bundle = 'true'">
|
5724
|
+
<xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
|
5725
|
+
</xsl:if>
|
5371
5726
|
<fo:bookmark-title>
|
5372
|
-
<xsl:variable name="bookmark-title_">
|
5373
|
-
<xsl:call-template name="getLangVersion">
|
5374
|
-
<xsl:with-param name="lang" select="@lang"/>
|
5375
|
-
<xsl:with-param name="doctype" select="@doctype"/>
|
5376
|
-
<xsl:with-param name="title" select="@title-part"/>
|
5377
|
-
</xsl:call-template>
|
5378
|
-
</xsl:variable>
|
5379
5727
|
<xsl:choose>
|
5380
|
-
<xsl:when test="normalize-space(
|
5381
|
-
<xsl:
|
5382
|
-
|
5383
|
-
|
5728
|
+
<xsl:when test="not(normalize-space(@bundle) = 'true')"> <!-- 'bundle' means several different documents (not language versions) in one xml -->
|
5729
|
+
<xsl:variable name="bookmark-title_">
|
5730
|
+
<xsl:call-template name="getLangVersion">
|
5731
|
+
<xsl:with-param name="lang" select="@lang"/>
|
5732
|
+
<xsl:with-param name="doctype" select="@doctype"/>
|
5733
|
+
<xsl:with-param name="title" select="@title-part"/>
|
5734
|
+
</xsl:call-template>
|
5735
|
+
</xsl:variable>
|
5384
5736
|
<xsl:choose>
|
5385
|
-
<xsl:when test="
|
5386
|
-
|
5387
|
-
|
5388
|
-
<xsl:otherwise
|
5737
|
+
<xsl:when test="normalize-space($bookmark-title_) != ''">
|
5738
|
+
<xsl:value-of select="normalize-space($bookmark-title_)"/>
|
5739
|
+
</xsl:when>
|
5740
|
+
<xsl:otherwise>
|
5741
|
+
<xsl:choose>
|
5742
|
+
<xsl:when test="@lang = 'en'">English</xsl:when>
|
5743
|
+
<xsl:when test="@lang = 'fr'">Français</xsl:when>
|
5744
|
+
<xsl:when test="@lang = 'de'">Deutsche</xsl:when>
|
5745
|
+
<xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
|
5746
|
+
</xsl:choose>
|
5747
|
+
</xsl:otherwise>
|
5389
5748
|
</xsl:choose>
|
5749
|
+
</xsl:when>
|
5750
|
+
<xsl:otherwise>
|
5751
|
+
<xsl:value-of select="@title-part"/>
|
5390
5752
|
</xsl:otherwise>
|
5391
5753
|
</xsl:choose>
|
5392
5754
|
</fo:bookmark-title>
|
5755
|
+
|
5393
5756
|
<xsl:apply-templates select="contents/item" mode="bookmark"/>
|
5394
5757
|
|
5395
5758
|
<xsl:call-template name="insertFigureBookmarks">
|
@@ -5488,20 +5851,28 @@
|
|
5488
5851
|
<xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
|
5489
5852
|
</xsl:choose>
|
5490
5853
|
</xsl:template><xsl:template match="item" mode="bookmark">
|
5491
|
-
<
|
5492
|
-
|
5493
|
-
|
5494
|
-
|
5495
|
-
<xsl:
|
5496
|
-
|
5497
|
-
|
5498
|
-
|
5499
|
-
|
5500
|
-
|
5854
|
+
<xsl:choose>
|
5855
|
+
<xsl:when test="@id != ''">
|
5856
|
+
<fo:bookmark internal-destination="{@id}" starting-state="hide">
|
5857
|
+
<fo:bookmark-title>
|
5858
|
+
<xsl:if test="@section != ''">
|
5859
|
+
<xsl:value-of select="@section"/>
|
5860
|
+
<xsl:text> </xsl:text>
|
5861
|
+
</xsl:if>
|
5862
|
+
<xsl:value-of select="normalize-space(title)"/>
|
5863
|
+
</fo:bookmark-title>
|
5864
|
+
<xsl:apply-templates mode="bookmark"/>
|
5865
|
+
</fo:bookmark>
|
5866
|
+
</xsl:when>
|
5867
|
+
<xsl:otherwise>
|
5868
|
+
<xsl:apply-templates mode="bookmark"/>
|
5869
|
+
</xsl:otherwise>
|
5870
|
+
</xsl:choose>
|
5501
5871
|
</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">
|
5502
5872
|
<xsl:if test="normalize-space() != ''">
|
5503
5873
|
<fo:block xsl:use-attribute-sets="figure-name-style">
|
5504
5874
|
|
5875
|
+
|
5505
5876
|
<xsl:apply-templates/>
|
5506
5877
|
</fo:block>
|
5507
5878
|
</xsl:if>
|
@@ -5582,6 +5953,7 @@
|
|
5582
5953
|
|
5583
5954
|
<fo:block-container margin-left="0mm">
|
5584
5955
|
<xsl:copy-of select="@id"/>
|
5956
|
+
|
5585
5957
|
<xsl:if test="parent::*[local-name() = 'note']">
|
5586
5958
|
<xsl:attribute name="margin-left">
|
5587
5959
|
<xsl:choose>
|
@@ -5592,7 +5964,9 @@
|
|
5592
5964
|
|
5593
5965
|
</xsl:if>
|
5594
5966
|
<fo:block-container margin-left="0mm">
|
5595
|
-
|
5967
|
+
|
5968
|
+
|
5969
|
+
|
5596
5970
|
<fo:block xsl:use-attribute-sets="sourcecode-style">
|
5597
5971
|
<xsl:variable name="_font-size">
|
5598
5972
|
|
@@ -5621,10 +5995,14 @@
|
|
5621
5995
|
</xsl:choose>
|
5622
5996
|
</xsl:attribute>
|
5623
5997
|
</xsl:if>
|
5624
|
-
|
5625
|
-
|
5998
|
+
|
5999
|
+
<xsl:apply-templates/>
|
6000
|
+
</fo:block>
|
6001
|
+
|
6002
|
+
|
5626
6003
|
<xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
|
5627
6004
|
|
6005
|
+
|
5628
6006
|
</fo:block-container>
|
5629
6007
|
</fo:block-container>
|
5630
6008
|
</xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
|
@@ -5970,6 +6348,8 @@
|
|
5970
6348
|
|
5971
6349
|
|
5972
6350
|
|
6351
|
+
|
6352
|
+
|
5973
6353
|
<xsl:call-template name="getTitle">
|
5974
6354
|
<xsl:with-param name="name" select="'title-source'"/>
|
5975
6355
|
</xsl:call-template>
|
@@ -6046,7 +6426,9 @@
|
|
6046
6426
|
|
6047
6427
|
|
6048
6428
|
</xsl:if>
|
6049
|
-
|
6429
|
+
|
6430
|
+
|
6431
|
+
|
6050
6432
|
<fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
|
6051
6433
|
<xsl:if test="normalize-space(@citeas) = ''">
|
6052
6434
|
<xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
|
@@ -6055,6 +6437,7 @@
|
|
6055
6437
|
|
6056
6438
|
|
6057
6439
|
|
6440
|
+
|
6058
6441
|
</xsl:if>
|
6059
6442
|
|
6060
6443
|
<xsl:apply-templates/>
|
@@ -6197,6 +6580,7 @@
|
|
6197
6580
|
<xsl:call-template name="setId"/>
|
6198
6581
|
|
6199
6582
|
|
6583
|
+
|
6200
6584
|
<xsl:apply-templates/>
|
6201
6585
|
</fo:block>
|
6202
6586
|
</xsl:template><xsl:template match="*[local-name() = 'definitions']">
|
@@ -6443,17 +6827,17 @@
|
|
6443
6827
|
<xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
|
6444
6828
|
<xsl:choose>
|
6445
6829
|
<xsl:when test="normalize-space($_doc_ident) != ''">
|
6446
|
-
<xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
|
6830
|
+
<!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
|
6447
6831
|
<xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
|
6448
6832
|
<xsl:value-of select="$type"/><xsl:text> </xsl:text>
|
6449
|
-
</xsl:if>
|
6833
|
+
</xsl:if> -->
|
6450
6834
|
<xsl:value-of select="$_doc_ident"/>
|
6451
6835
|
</xsl:when>
|
6452
6836
|
<xsl:otherwise>
|
6453
|
-
<xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
|
6837
|
+
<!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
|
6454
6838
|
<xsl:if test="$type != ''">
|
6455
6839
|
<xsl:value-of select="$type"/><xsl:text> </xsl:text>
|
6456
|
-
</xsl:if>
|
6840
|
+
</xsl:if> -->
|
6457
6841
|
<xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
|
6458
6842
|
</xsl:otherwise>
|
6459
6843
|
</xsl:choose>
|
@@ -6894,20 +7278,40 @@
|
|
6894
7278
|
</xsl:call-template>
|
6895
7279
|
</xsl:if>
|
6896
7280
|
</xsl:template><xsl:template name="getLocalizedString">
|
6897
|
-
<xsl:param name="key"/>
|
7281
|
+
<xsl:param name="key"/>
|
7282
|
+
<xsl:param name="formatted">false</xsl:param>
|
6898
7283
|
|
6899
7284
|
<xsl:variable name="curr_lang">
|
6900
7285
|
<xsl:call-template name="getLang"/>
|
6901
7286
|
</xsl:variable>
|
6902
7287
|
|
6903
|
-
<xsl:variable name="data_value"
|
7288
|
+
<xsl:variable name="data_value">
|
7289
|
+
<xsl:choose>
|
7290
|
+
<xsl:when test="$formatted = 'true'">
|
7291
|
+
<xsl:apply-templates select="xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
7292
|
+
</xsl:when>
|
7293
|
+
<xsl:otherwise>
|
7294
|
+
<xsl:value-of select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
|
7295
|
+
</xsl:otherwise>
|
7296
|
+
</xsl:choose>
|
7297
|
+
</xsl:variable>
|
6904
7298
|
|
6905
7299
|
<xsl:choose>
|
6906
|
-
<xsl:when test="$data_value != ''">
|
6907
|
-
<xsl:
|
7300
|
+
<xsl:when test="normalize-space($data_value) != ''">
|
7301
|
+
<xsl:choose>
|
7302
|
+
<xsl:when test="$formatted = 'true'"><xsl:copy-of select="$data_value"/></xsl:when>
|
7303
|
+
<xsl:otherwise><xsl:value-of select="$data_value"/></xsl:otherwise>
|
7304
|
+
</xsl:choose>
|
6908
7305
|
</xsl:when>
|
6909
7306
|
<xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
|
6910
|
-
<xsl:
|
7307
|
+
<xsl:choose>
|
7308
|
+
<xsl:when test="$formatted = 'true'">
|
7309
|
+
<xsl:apply-templates select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
7310
|
+
</xsl:when>
|
7311
|
+
<xsl:otherwise>
|
7312
|
+
<xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
|
7313
|
+
</xsl:otherwise>
|
7314
|
+
</xsl:choose>
|
6911
7315
|
</xsl:when>
|
6912
7316
|
<xsl:otherwise>
|
6913
7317
|
<xsl:variable name="key_">
|
@@ -6918,7 +7322,7 @@
|
|
6918
7322
|
<xsl:value-of select="$key_"/>
|
6919
7323
|
</xsl:otherwise>
|
6920
7324
|
</xsl:choose>
|
6921
|
-
|
7325
|
+
|
6922
7326
|
</xsl:template><xsl:template name="setTrackChangesStyles">
|
6923
7327
|
<xsl:param name="isAdded"/>
|
6924
7328
|
<xsl:param name="isDeleted"/>
|
@@ -6959,4 +7363,110 @@
|
|
6959
7363
|
<xsl:value-of select="$align"/>
|
6960
7364
|
</xsl:when>
|
6961
7365
|
</xsl:choose>
|
7366
|
+
</xsl:template><xsl:template name="setTextAlignment">
|
7367
|
+
<xsl:param name="default">left</xsl:param>
|
7368
|
+
<xsl:attribute name="text-align">
|
7369
|
+
<xsl:choose>
|
7370
|
+
<xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
|
7371
|
+
<xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
|
7372
|
+
<xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
|
7373
|
+
<xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
|
7374
|
+
</xsl:choose>
|
7375
|
+
</xsl:attribute>
|
7376
|
+
</xsl:template><xsl:template name="number-to-words">
|
7377
|
+
<xsl:param name="number"/>
|
7378
|
+
<xsl:param name="first"/>
|
7379
|
+
<xsl:if test="$number != ''">
|
7380
|
+
<xsl:variable name="words">
|
7381
|
+
<words>
|
7382
|
+
<word cardinal="1">One-</word>
|
7383
|
+
<word ordinal="1">First </word>
|
7384
|
+
<word cardinal="2">Two-</word>
|
7385
|
+
<word ordinal="2">Second </word>
|
7386
|
+
<word cardinal="3">Three-</word>
|
7387
|
+
<word ordinal="3">Third </word>
|
7388
|
+
<word cardinal="4">Four-</word>
|
7389
|
+
<word ordinal="4">Fourth </word>
|
7390
|
+
<word cardinal="5">Five-</word>
|
7391
|
+
<word ordinal="5">Fifth </word>
|
7392
|
+
<word cardinal="6">Six-</word>
|
7393
|
+
<word ordinal="6">Sixth </word>
|
7394
|
+
<word cardinal="7">Seven-</word>
|
7395
|
+
<word ordinal="7">Seventh </word>
|
7396
|
+
<word cardinal="8">Eight-</word>
|
7397
|
+
<word ordinal="8">Eighth </word>
|
7398
|
+
<word cardinal="9">Nine-</word>
|
7399
|
+
<word ordinal="9">Ninth </word>
|
7400
|
+
<word ordinal="10">Tenth </word>
|
7401
|
+
<word ordinal="11">Eleventh </word>
|
7402
|
+
<word ordinal="12">Twelfth </word>
|
7403
|
+
<word ordinal="13">Thirteenth </word>
|
7404
|
+
<word ordinal="14">Fourteenth </word>
|
7405
|
+
<word ordinal="15">Fifteenth </word>
|
7406
|
+
<word ordinal="16">Sixteenth </word>
|
7407
|
+
<word ordinal="17">Seventeenth </word>
|
7408
|
+
<word ordinal="18">Eighteenth </word>
|
7409
|
+
<word ordinal="19">Nineteenth </word>
|
7410
|
+
<word cardinal="20">Twenty-</word>
|
7411
|
+
<word ordinal="20">Twentieth </word>
|
7412
|
+
<word cardinal="30">Thirty-</word>
|
7413
|
+
<word ordinal="30">Thirtieth </word>
|
7414
|
+
<word cardinal="40">Forty-</word>
|
7415
|
+
<word ordinal="40">Fortieth </word>
|
7416
|
+
<word cardinal="50">Fifty-</word>
|
7417
|
+
<word ordinal="50">Fiftieth </word>
|
7418
|
+
<word cardinal="60">Sixty-</word>
|
7419
|
+
<word ordinal="60">Sixtieth </word>
|
7420
|
+
<word cardinal="70">Seventy-</word>
|
7421
|
+
<word ordinal="70">Seventieth </word>
|
7422
|
+
<word cardinal="80">Eighty-</word>
|
7423
|
+
<word ordinal="80">Eightieth </word>
|
7424
|
+
<word cardinal="90">Ninety-</word>
|
7425
|
+
<word ordinal="90">Ninetieth </word>
|
7426
|
+
<word cardinal="100">Hundred-</word>
|
7427
|
+
<word ordinal="100">Hundredth </word>
|
7428
|
+
</words>
|
7429
|
+
</xsl:variable>
|
7430
|
+
|
7431
|
+
<xsl:variable name="ordinal" select="xalan:nodeset($words)//word[@ordinal = $number]/text()"/>
|
7432
|
+
|
7433
|
+
<xsl:variable name="value">
|
7434
|
+
<xsl:choose>
|
7435
|
+
<xsl:when test="$ordinal != ''">
|
7436
|
+
<xsl:value-of select="$ordinal"/>
|
7437
|
+
</xsl:when>
|
7438
|
+
<xsl:otherwise>
|
7439
|
+
<xsl:choose>
|
7440
|
+
<xsl:when test="$number < 100">
|
7441
|
+
<xsl:variable name="decade" select="concat(substring($number,1,1), '0')"/>
|
7442
|
+
<xsl:variable name="digit" select="substring($number,2)"/>
|
7443
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $decade]/text()"/>
|
7444
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@ordinal = $digit]/text()"/>
|
7445
|
+
</xsl:when>
|
7446
|
+
<xsl:otherwise>
|
7447
|
+
<!-- more 100 -->
|
7448
|
+
<xsl:variable name="hundred" select="substring($number,1,1)"/>
|
7449
|
+
<xsl:variable name="digits" select="number(substring($number,2))"/>
|
7450
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = $hundred]/text()"/>
|
7451
|
+
<xsl:value-of select="xalan:nodeset($words)//word[@cardinal = '100']/text()"/>
|
7452
|
+
<xsl:call-template name="number-to-words">
|
7453
|
+
<xsl:with-param name="number" select="$digits"/>
|
7454
|
+
</xsl:call-template>
|
7455
|
+
</xsl:otherwise>
|
7456
|
+
</xsl:choose>
|
7457
|
+
</xsl:otherwise>
|
7458
|
+
</xsl:choose>
|
7459
|
+
</xsl:variable>
|
7460
|
+
<xsl:choose>
|
7461
|
+
<xsl:when test="$first = 'true'">
|
7462
|
+
<xsl:variable name="value_lc" select="java:toLowerCase(java:java.lang.String.new($value))"/>
|
7463
|
+
<xsl:call-template name="capitalize">
|
7464
|
+
<xsl:with-param name="str" select="$value_lc"/>
|
7465
|
+
</xsl:call-template>
|
7466
|
+
</xsl:when>
|
7467
|
+
<xsl:otherwise>
|
7468
|
+
<xsl:value-of select="$value"/>
|
7469
|
+
</xsl:otherwise>
|
7470
|
+
</xsl:choose>
|
7471
|
+
</xsl:if>
|
6962
7472
|
</xsl:template></xsl:stylesheet>
|