metanorma-mpfa 0.6.5 → 0.6.6

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: 8c98ed7b1146c47d50b038240e5680d3345b63e181369ed20aa5d971162df961
4
- data.tar.gz: ff9fd29bd1dda19e35a6d70451fdcabe1b0e7ff94e9eef536f204929680206df
3
+ metadata.gz: 6c8636c4532317ad31af938010b32a0e0db9504d6d7bc6f96d46603694f3db1e
4
+ data.tar.gz: fa33c669965b72847fa28c831ade831a5cbd0b0253794d4c3acb9d8454c6eda5
5
5
  SHA512:
6
- metadata.gz: 63a9e925b5aa576a8d2c55b7197dc2f6747b7cf8ceef99dbcfc633d251f5c659c037b26327103e06803900477dadee74d4b7eea2fdfc09e8179471feb785ce2c
7
- data.tar.gz: 2c4b7362d868a55775bbf52e0a42007d1ce77cea68c079ef6c8143cb656980fc5e14af3c6bd8b980d5c733ac41f7084615071a56342af5eab29648a3e2912a52
6
+ metadata.gz: c93cb0a5cd55b40bf6b22c5cfeac7e1a9d8c772b20a7e3c0b08b511ca4ccde6d188d99fdaf823362305bfdc4a80a8b675b8779ff91e91f0f816bb75b3ebf5243
7
+ data.tar.gz: 17011395f91cc0f1210707bf31e6797a693bed509e1afeda99222e8ffc702fec9853c26110ed22716ae8fdd28ce59fd43bd3486d96392fe68e768ee39692f22e
@@ -16,7 +16,7 @@ jobs:
16
16
  strategy:
17
17
  fail-fast: false
18
18
  matrix:
19
- ruby: [ '3.0', '2.7', '2.6', '2.5', '2.4' ]
19
+ ruby: [ '3.0', '2.7', '2.6', '2.5' ]
20
20
  os: [ ubuntu-latest, windows-latest, macos-latest ]
21
21
  experimental: [ false ]
22
22
  steps:
@@ -955,7 +955,24 @@
955
955
  <define name="concept">
956
956
  <element name="concept">
957
957
  <optional>
958
- <attribute name="term"/>
958
+ <element name="refterm">
959
+ <zeroOrMore>
960
+ <choice>
961
+ <ref name="PureTextElement"/>
962
+ <ref name="stem"/>
963
+ </choice>
964
+ </zeroOrMore>
965
+ </element>
966
+ </optional>
967
+ <optional>
968
+ <element name="renderterm">
969
+ <zeroOrMore>
970
+ <choice>
971
+ <ref name="PureTextElement"/>
972
+ <ref name="stem"/>
973
+ </choice>
974
+ </zeroOrMore>
975
+ </element>
959
976
  </optional>
960
977
  <choice>
961
978
  <ref name="eref"/>
@@ -12,8 +12,12 @@
12
12
 
13
13
 
14
14
  <xsl:variable name="debug">false</xsl:variable>
15
- <xsl:variable name="pageWidth" select="'210mm'"/>
16
- <xsl:variable name="pageHeight" select="'297mm'"/>
15
+ <xsl:variable name="pageWidth" select="210"/>
16
+ <xsl:variable name="pageHeight" select="297"/>
17
+ <xsl:variable name="marginLeftRight1" select="19"/>
18
+ <xsl:variable name="marginLeftRight2" select="19"/>
19
+ <xsl:variable name="marginTop" select="16.5"/>
20
+ <xsl:variable name="marginBottom" select="10"/>
17
21
 
18
22
  <xsl:variable name="copyrightHolder">Ribose Group Inc.</xsl:variable>
19
23
 
@@ -63,7 +67,7 @@
63
67
  <fo:layout-master-set>
64
68
 
65
69
  <!-- cover page -->
66
- <fo:simple-page-master master-name="cover" page-width="{$pageWidth}" page-height="{$pageHeight}">
70
+ <fo:simple-page-master master-name="cover" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
67
71
  <fo:region-body margin-top="24mm" margin-bottom="10mm" margin-left="19mm" margin-right="19mm"/>
68
72
  <fo:region-before region-name="cover-header" extent="24mm"/>
69
73
  <fo:region-after region-name="footer" extent="10mm"/>
@@ -72,19 +76,19 @@
72
76
  </fo:simple-page-master>
73
77
 
74
78
  <!-- document pages -->
75
- <fo:simple-page-master master-name="odd" page-width="{$pageWidth}" page-height="{$pageHeight}">
76
- <fo:region-body margin-top="16.5mm" margin-bottom="10mm" margin-left="19mm" margin-right="19mm"/>
77
- <fo:region-before region-name="header-odd" extent="16.5mm"/>
78
- <fo:region-after region-name="footer-odd" extent="10mm"/>
79
- <fo:region-start region-name="left-region" extent="19mm"/>
80
- <fo:region-end region-name="right-region" extent="19mm"/>
79
+ <fo:simple-page-master master-name="odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
80
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
81
+ <fo:region-before region-name="header-odd" extent="{$marginTop}mm"/>
82
+ <fo:region-after region-name="footer-odd" extent="{$marginBottom}mm"/>
83
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
84
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
81
85
  </fo:simple-page-master>
82
- <fo:simple-page-master master-name="even" page-width="{$pageWidth}" page-height="{$pageHeight}">
83
- <fo:region-body margin-top="16.5mm" margin-bottom="10mm" margin-left="19mm" margin-right="19mm"/>
84
- <fo:region-before region-name="header-even" extent="16.5mm"/>
85
- <fo:region-after region-name="footer-even" extent="10mm"/>
86
- <fo:region-start region-name="left-region" extent="19mm"/>
87
- <fo:region-end region-name="right-region" extent="19mm"/>
86
+ <fo:simple-page-master master-name="even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
87
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
88
+ <fo:region-before region-name="header-even" extent="{$marginTop}mm"/>
89
+ <fo:region-after region-name="footer-even" extent="{$marginBottom}mm"/>
90
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight2}mm"/>
91
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight1}mm"/>
88
92
  </fo:simple-page-master>
89
93
 
90
94
  <fo:page-sequence-master master-name="document">
@@ -1100,6 +1104,7 @@
1100
1104
  </xsl:attribute-set><xsl:attribute-set name="eref-style">
1101
1105
 
1102
1106
 
1107
+
1103
1108
  <xsl:attribute name="color">blue</xsl:attribute>
1104
1109
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1105
1110
 
@@ -1301,14 +1306,15 @@
1301
1306
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1302
1307
 
1303
1308
  <!-- Normative references -->
1304
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
1309
+ <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"/>
1305
1310
  <!-- Terms and definitions -->
1306
1311
  <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"/>
1307
1312
  <!-- Another main sections -->
1308
1313
  <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"/>
1309
1314
  <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
1310
1315
  <!-- Bibliography -->
1311
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
1316
+ <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"/>
1317
+
1312
1318
  </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1313
1319
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1314
1320
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
@@ -2090,6 +2096,7 @@
2090
2096
 
2091
2097
 
2092
2098
 
2099
+
2093
2100
  <xsl:if test=".//*[local-name() = 'table']">
2094
2101
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2095
2102
  </xsl:if>
@@ -2119,6 +2126,7 @@
2119
2126
 
2120
2127
 
2121
2128
 
2129
+
2122
2130
  <fo:inline padding-right="2mm">
2123
2131
 
2124
2132
 
@@ -2160,6 +2168,7 @@
2160
2168
 
2161
2169
 
2162
2170
 
2171
+
2163
2172
  <xsl:value-of select="@reference"/>
2164
2173
 
2165
2174
 
@@ -2304,6 +2313,9 @@
2304
2313
 
2305
2314
 
2306
2315
 
2316
+
2317
+
2318
+
2307
2319
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
2308
2320
 
2309
2321
 
@@ -3203,6 +3215,7 @@
3203
3215
  <fo:inline xsl:use-attribute-sets="link-style">
3204
3216
 
3205
3217
 
3218
+
3206
3219
  <xsl:choose>
3207
3220
  <xsl:when test="$target_text = ''">
3208
3221
  <xsl:apply-templates/>
@@ -3551,6 +3564,234 @@
3551
3564
  <xsl:param name="height"/>
3552
3565
  <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; "/>
3553
3566
  <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; "/>
3567
+ </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">
3568
+ <xsl:param name="name"/>
3569
+
3570
+ <xsl:variable name="svg_content">
3571
+ <xsl:apply-templates select="." mode="svg_update"/>
3572
+ </xsl:variable>
3573
+
3574
+ <xsl:variable name="alt-text">
3575
+ <xsl:choose>
3576
+ <xsl:when test="normalize-space(../*[local-name() = 'name']) != ''">
3577
+ <xsl:value-of select="../*[local-name() = 'name']"/>
3578
+ </xsl:when>
3579
+ <xsl:when test="normalize-space($name) != ''">
3580
+ <xsl:value-of select="$name"/>
3581
+ </xsl:when>
3582
+ <xsl:otherwise>Figure</xsl:otherwise>
3583
+ </xsl:choose>
3584
+ </xsl:variable>
3585
+
3586
+ <xsl:choose>
3587
+ <xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
3588
+ <fo:block>
3589
+ <xsl:variable name="width" select="@width"/>
3590
+ <xsl:variable name="height" select="@height"/>
3591
+
3592
+ <xsl:variable name="scale_x">
3593
+ <xsl:choose>
3594
+ <xsl:when test="$width &gt; $width_effective_px">
3595
+ <xsl:value-of select="$width_effective_px div $width"/>
3596
+ </xsl:when>
3597
+ <xsl:otherwise>1</xsl:otherwise>
3598
+ </xsl:choose>
3599
+ </xsl:variable>
3600
+
3601
+ <xsl:variable name="scale_y">
3602
+ <xsl:choose>
3603
+ <xsl:when test="$height * $scale_x &gt; $height_effective_px">
3604
+ <xsl:value-of select="$height_effective_px div ($height * $scale_x)"/>
3605
+ </xsl:when>
3606
+ <xsl:otherwise>1</xsl:otherwise>
3607
+ </xsl:choose>
3608
+ </xsl:variable>
3609
+
3610
+ <xsl:variable name="scale">
3611
+ <xsl:choose>
3612
+ <xsl:when test="$scale_y != 1">
3613
+ <xsl:value-of select="$scale_x * $scale_y"/>
3614
+ </xsl:when>
3615
+ <xsl:otherwise>
3616
+ <xsl:value-of select="$scale_x"/>
3617
+ </xsl:otherwise>
3618
+ </xsl:choose>
3619
+ </xsl:variable>
3620
+
3621
+ <xsl:variable name="width_scale" select="round($width * $scale)"/>
3622
+ <xsl:variable name="height_scale" select="round($height * $scale)"/>
3623
+
3624
+ <fo:table table-layout="fixed" width="100%">
3625
+ <fo:table-column column-width="proportional-column-width(1)"/>
3626
+ <fo:table-column column-width="{$width_scale}px"/>
3627
+ <fo:table-column column-width="proportional-column-width(1)"/>
3628
+ <fo:table-body>
3629
+ <fo:table-row>
3630
+ <fo:table-cell column-number="2">
3631
+ <fo:block>
3632
+ <fo:block-container width="{$width_scale}px" height="{$height_scale}px">
3633
+ <xsl:if test="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
3634
+ <fo:block line-height="0" font-size="0">
3635
+ <xsl:for-each select="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
3636
+ <xsl:call-template name="bookmark"/>
3637
+ </xsl:for-each>
3638
+ </fo:block>
3639
+ </xsl:if>
3640
+ <fo:block text-depth="0" line-height="0" font-size="0">
3641
+
3642
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}">
3643
+ <xsl:attribute name="width">100%</xsl:attribute>
3644
+ <xsl:attribute name="content-height">100%</xsl:attribute>
3645
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
3646
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
3647
+
3648
+ <xsl:apply-templates select="xalan:nodeset($svg_content)" mode="svg_remove_a"/>
3649
+ </fo:instream-foreign-object>
3650
+ </fo:block>
3651
+
3652
+ <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">
3653
+ <xsl:with-param name="scale" select="$scale"/>
3654
+ </xsl:apply-templates>
3655
+ </fo:block-container>
3656
+ </fo:block>
3657
+ </fo:table-cell>
3658
+ </fo:table-row>
3659
+ </fo:table-body>
3660
+ </fo:table>
3661
+ </fo:block>
3662
+
3663
+ </xsl:when>
3664
+ <xsl:otherwise>
3665
+ <fo:block xsl:use-attribute-sets="image-style">
3666
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}">
3667
+ <xsl:attribute name="width">100%</xsl:attribute>
3668
+ <xsl:attribute name="content-height">100%</xsl:attribute>
3669
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
3670
+ <!-- effective height 297 - 27.4 - 13 = 256.6 -->
3671
+ <!-- effective width 210 - 12.5 - 25 = 172.5 -->
3672
+ <!-- effective height / width = 1.48, 1.4 - with title -->
3673
+ <xsl:if test="@height &gt; (@width * 1.4)"> <!-- for images with big height -->
3674
+ <xsl:variable name="width" select="((@width * 1.4) div @height) * 100"/>
3675
+ <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
3676
+ </xsl:if>
3677
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
3678
+ <xsl:copy-of select="$svg_content"/>
3679
+ </fo:instream-foreign-object>
3680
+ </fo:block>
3681
+ </xsl:otherwise>
3682
+ </xsl:choose>
3683
+ </xsl:template><xsl:template match="@*|node()" mode="svg_update">
3684
+ <xsl:copy>
3685
+ <xsl:apply-templates select="@*|node()" mode="svg_update"/>
3686
+ </xsl:copy>
3687
+ </xsl:template><xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
3688
+ <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
3689
+ <xsl:value-of select="."/>
3690
+ </xsl:attribute>
3691
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
3692
+ <xsl:variable name="svg_content" select="document(@src)"/>
3693
+ <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
3694
+ <xsl:for-each select="xalan:nodeset($svg_content)/node()">
3695
+ <xsl:call-template name="image_svg">
3696
+ <xsl:with-param name="name" select="$name"/>
3697
+ </xsl:call-template>
3698
+ </xsl:for-each>
3699
+ </xsl:template><xsl:template match="@*|node()" mode="svg_remove_a">
3700
+ <xsl:copy>
3701
+ <xsl:apply-templates select="@*|node()" mode="svg_remove_a"/>
3702
+ </xsl:copy>
3703
+ </xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_remove_a">
3704
+ <xsl:apply-templates mode="svg_remove_a"/>
3705
+ </xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_imagemap_links">
3706
+ <xsl:param name="scale"/>
3707
+ <xsl:variable name="dest">
3708
+ <xsl:choose>
3709
+ <xsl:when test="starts-with(@href, '#')">
3710
+ <xsl:value-of select="substring-after(@href, '#')"/>
3711
+ </xsl:when>
3712
+ <xsl:otherwise>
3713
+ <xsl:value-of select="@href"/>
3714
+ </xsl:otherwise>
3715
+ </xsl:choose>
3716
+ </xsl:variable>
3717
+ <xsl:for-each select="./*[local-name() = 'rect']">
3718
+ <xsl:call-template name="insertSVGMapLink">
3719
+ <xsl:with-param name="left" select="floor(@x * $scale)"/>
3720
+ <xsl:with-param name="top" select="floor(@y * $scale)"/>
3721
+ <xsl:with-param name="width" select="floor(@width * $scale)"/>
3722
+ <xsl:with-param name="height" select="floor(@height * $scale)"/>
3723
+ <xsl:with-param name="dest" select="$dest"/>
3724
+ </xsl:call-template>
3725
+ </xsl:for-each>
3726
+
3727
+ <xsl:for-each select="./*[local-name() = 'polygon']">
3728
+ <xsl:variable name="points">
3729
+ <xsl:call-template name="split">
3730
+ <xsl:with-param name="pText" select="@points"/>
3731
+ </xsl:call-template>
3732
+ </xsl:variable>
3733
+ <xsl:variable name="x_coords">
3734
+ <xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 1]">
3735
+ <xsl:sort select="." data-type="number"/>
3736
+ <x><xsl:value-of select="."/></x>
3737
+ </xsl:for-each>
3738
+ </xsl:variable>
3739
+ <xsl:variable name="y_coords">
3740
+ <xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 0]">
3741
+ <xsl:sort select="." data-type="number"/>
3742
+ <y><xsl:value-of select="."/></y>
3743
+ </xsl:for-each>
3744
+ </xsl:variable>
3745
+ <xsl:variable name="x" select="xalan:nodeset($x_coords)//x[1]"/>
3746
+ <xsl:variable name="y" select="xalan:nodeset($y_coords)//y[1]"/>
3747
+ <xsl:variable name="width" select="xalan:nodeset($x_coords)//x[last()] - $x"/>
3748
+ <xsl:variable name="height" select="xalan:nodeset($y_coords)//y[last()] - $y"/>
3749
+ <xsl:call-template name="insertSVGMapLink">
3750
+ <xsl:with-param name="left" select="floor($x * $scale)"/>
3751
+ <xsl:with-param name="top" select="floor($y * $scale)"/>
3752
+ <xsl:with-param name="width" select="floor($width * $scale)"/>
3753
+ <xsl:with-param name="height" select="floor($height * $scale)"/>
3754
+ <xsl:with-param name="dest" select="$dest"/>
3755
+ </xsl:call-template>
3756
+ </xsl:for-each>
3757
+
3758
+ <xsl:for-each select="./*[local-name() = 'circle']">
3759
+ <xsl:call-template name="insertSVGMapLink">
3760
+ <xsl:with-param name="left" select="floor((@cx - @r) * $scale)"/>
3761
+ <xsl:with-param name="top" select="floor((@cy - @r) * $scale)"/>
3762
+ <xsl:with-param name="width" select="floor(@r * 2 * $scale)"/>
3763
+ <xsl:with-param name="height" select="floor(@r * 2 * $scale)"/>
3764
+ <xsl:with-param name="dest" select="$dest"/>
3765
+ </xsl:call-template>
3766
+ </xsl:for-each>
3767
+ <xsl:for-each select="./*[local-name() = 'ellipse']">
3768
+ <xsl:call-template name="insertSVGMapLink">
3769
+ <xsl:with-param name="left" select="floor((@cx - @rx) * $scale)"/>
3770
+ <xsl:with-param name="top" select="floor((@cy - @ry) * $scale)"/>
3771
+ <xsl:with-param name="width" select="floor(@rx * 2 * $scale)"/>
3772
+ <xsl:with-param name="height" select="floor(@ry * 2 * $scale)"/>
3773
+ <xsl:with-param name="dest" select="$dest"/>
3774
+ </xsl:call-template>
3775
+ </xsl:for-each>
3776
+ </xsl:template><xsl:template name="insertSVGMapLink">
3777
+ <xsl:param name="left"/>
3778
+ <xsl:param name="top"/>
3779
+ <xsl:param name="width"/>
3780
+ <xsl:param name="height"/>
3781
+ <xsl:param name="dest"/>
3782
+ <fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
3783
+ <fo:block font-size="1pt">
3784
+ <fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
3785
+ <fo:inline-container inline-progression-dimension="100%">
3786
+ <fo:block-container height="{$height - 1}px" width="100%">
3787
+ <!-- DEBUG <xsl:if test="local-name()='polygon'">
3788
+ <xsl:attribute name="background-color">magenta</xsl:attribute>
3789
+ </xsl:if> -->
3790
+ <fo:block> </fo:block></fo:block-container>
3791
+ </fo:inline-container>
3792
+ </fo:basic-link>
3793
+ </fo:block>
3794
+ </fo:block-container>
3554
3795
  </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">
3555
3796
  <xsl:apply-templates mode="contents"/>
3556
3797
  <xsl:text> </xsl:text>
@@ -3579,28 +3820,39 @@
3579
3820
  <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
3580
3821
  <xsl:for-each select="xalan:nodeset($contents)/doc">
3581
3822
  <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
3823
+ <xsl:if test="@bundle = 'true'">
3824
+ <xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
3825
+ </xsl:if>
3582
3826
  <fo:bookmark-title>
3583
- <xsl:variable name="bookmark-title_">
3584
- <xsl:call-template name="getLangVersion">
3585
- <xsl:with-param name="lang" select="@lang"/>
3586
- <xsl:with-param name="doctype" select="@doctype"/>
3587
- <xsl:with-param name="title" select="@title-part"/>
3588
- </xsl:call-template>
3589
- </xsl:variable>
3590
3827
  <xsl:choose>
3591
- <xsl:when test="normalize-space($bookmark-title_) != ''">
3592
- <xsl:value-of select="normalize-space($bookmark-title_)"/>
3593
- </xsl:when>
3594
- <xsl:otherwise>
3828
+ <xsl:when test="not(normalize-space(@bundle) = 'true')"> <!-- 'bundle' means several different documents (not language versions) in one xml -->
3829
+ <xsl:variable name="bookmark-title_">
3830
+ <xsl:call-template name="getLangVersion">
3831
+ <xsl:with-param name="lang" select="@lang"/>
3832
+ <xsl:with-param name="doctype" select="@doctype"/>
3833
+ <xsl:with-param name="title" select="@title-part"/>
3834
+ </xsl:call-template>
3835
+ </xsl:variable>
3595
3836
  <xsl:choose>
3596
- <xsl:when test="@lang = 'en'">English</xsl:when>
3597
- <xsl:when test="@lang = 'fr'">Français</xsl:when>
3598
- <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3599
- <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3837
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
3838
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
3839
+ </xsl:when>
3840
+ <xsl:otherwise>
3841
+ <xsl:choose>
3842
+ <xsl:when test="@lang = 'en'">English</xsl:when>
3843
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
3844
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3845
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3846
+ </xsl:choose>
3847
+ </xsl:otherwise>
3600
3848
  </xsl:choose>
3849
+ </xsl:when>
3850
+ <xsl:otherwise>
3851
+ <xsl:value-of select="@title-part"/>
3601
3852
  </xsl:otherwise>
3602
3853
  </xsl:choose>
3603
3854
  </fo:bookmark-title>
3855
+
3604
3856
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
3605
3857
 
3606
3858
  <xsl:call-template name="insertFigureBookmarks">
@@ -3699,16 +3951,23 @@
3699
3951
  <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
3700
3952
  </xsl:choose>
3701
3953
  </xsl:template><xsl:template match="item" mode="bookmark">
3702
- <fo:bookmark internal-destination="{@id}" starting-state="hide">
3703
- <fo:bookmark-title>
3704
- <xsl:if test="@section != ''">
3705
- <xsl:value-of select="@section"/>
3706
- <xsl:text> </xsl:text>
3707
- </xsl:if>
3708
- <xsl:value-of select="normalize-space(title)"/>
3709
- </fo:bookmark-title>
3710
- <xsl:apply-templates mode="bookmark"/>
3711
- </fo:bookmark>
3954
+ <xsl:choose>
3955
+ <xsl:when test="@id != ''">
3956
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
3957
+ <fo:bookmark-title>
3958
+ <xsl:if test="@section != ''">
3959
+ <xsl:value-of select="@section"/>
3960
+ <xsl:text> </xsl:text>
3961
+ </xsl:if>
3962
+ <xsl:value-of select="normalize-space(title)"/>
3963
+ </fo:bookmark-title>
3964
+ <xsl:apply-templates mode="bookmark"/>
3965
+ </fo:bookmark>
3966
+ </xsl:when>
3967
+ <xsl:otherwise>
3968
+ <xsl:apply-templates mode="bookmark"/>
3969
+ </xsl:otherwise>
3970
+ </xsl:choose>
3712
3971
  </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">
3713
3972
  <xsl:if test="normalize-space() != ''">
3714
3973
  <fo:block xsl:use-attribute-sets="figure-name-style">
@@ -4265,6 +4524,7 @@
4265
4524
  </xsl:if>
4266
4525
 
4267
4526
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4527
+
4268
4528
  <xsl:if test="normalize-space(@citeas) = ''">
4269
4529
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
4270
4530
  </xsl:if>