metanorma-un 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: 24fe47575535e25483251e6ed1b2f278df382c1fe7878560b986a0bf9220eb9b
4
- data.tar.gz: 2ed7c0507c32d4733ffe26f91a8b9f1f4a019105d5dbd61c3edc1f8fbd7eccc0
3
+ metadata.gz: 0a5c20da9a001c0acd4087934cf4f9cbc82a2120c3d2f5b3e7a5d5d044faa5cb
4
+ data.tar.gz: 4d454c978e7dd64bc99b623e7369f85c0217b77cca1e528de503fababdea145b
5
5
  SHA512:
6
- metadata.gz: 2503fe478117ca61d6cf544b59fdacabfa136e8e72faa5cec74867323daa883156f3564579714bb62b8c960580fb419d16f97aa4ab68e998329fd1518e0c8b28
7
- data.tar.gz: 19b1cda0b57151e0b5c51b8780f72de396e581947450bf7f8b39118d240e3b9d92438139a758e7f14fe4bf843a175ed59f3c536ec179e7ded65c959806a8e3b3
6
+ metadata.gz: 83bff8b909f59c56c86e1d1a034a0e5d637e7897ebd9578fe7a9d9202a366f7b59607fea61cd297bdd7c8d63697ebbf0db3bd3de888b662a59a15fadf62ad6b9
7
+ data.tar.gz: 8195c49d3f5ab27d550170f76f3047a0a48bc479f5f718a7482ca0a2c95f3e219b08463262be6c09056e0c7c6ba7e0d92975f4eb307797b1094ad8d06c5380fc
@@ -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"/>
@@ -11,8 +11,12 @@
11
11
 
12
12
 
13
13
 
14
- <xsl:variable name="pageWidth" select="'210mm'"/>
15
- <xsl:variable name="pageHeight" select="'297mm'"/>
14
+ <xsl:variable name="pageWidth" select="210"/>
15
+ <xsl:variable name="pageHeight" select="297"/>
16
+ <xsl:variable name="marginLeftRight1" select="40"/>
17
+ <xsl:variable name="marginLeftRight2" select="40"/>
18
+ <xsl:variable name="marginTop" select="30"/>
19
+ <xsl:variable name="marginBottom" select="40"/>
16
20
 
17
21
  <xsl:variable name="debug">false</xsl:variable>
18
22
 
@@ -42,7 +46,7 @@
42
46
  <fo:root font-family="Times New Roman, STIX Two Math, Source Han Sans" font-size="10pt" xml:lang="{$lang}">
43
47
  <fo:layout-master-set>
44
48
  <!-- Cover page -->
45
- <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
49
+ <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
46
50
  <fo:region-body margin-top="17.5mm" margin-bottom="10mm" margin-left="20mm" margin-right="20mm"/>
47
51
  <fo:region-before extent="17.5mm"/>
48
52
  <fo:region-after extent="10mm"/>
@@ -51,20 +55,20 @@
51
55
  </fo:simple-page-master>
52
56
 
53
57
  <!-- Document odd pages -->
54
- <fo:simple-page-master master-name="odd" page-width="{$pageWidth}" page-height="{$pageHeight}">
55
- <fo:region-body margin-top="30mm" margin-bottom="40mm" margin-left="40mm" margin-right="40mm"/>
58
+ <fo:simple-page-master master-name="odd" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
59
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight1}mm" margin-right="{$marginLeftRight2}mm"/>
56
60
  <fo:region-before region-name="header-odd" extent="26mm"/>
57
- <fo:region-after region-name="footer-odd" extent="40mm"/>
58
- <fo:region-start region-name="left-region" extent="40mm"/>
59
- <fo:region-end region-name="right-region" extent="40mm"/>
61
+ <fo:region-after region-name="footer-odd" extent="{$marginBottom}mm"/>
62
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight1}mm"/>
63
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight2}mm"/>
60
64
  </fo:simple-page-master>
61
65
  <!-- Document even pages -->
62
- <fo:simple-page-master master-name="even" page-width="{$pageWidth}" page-height="{$pageHeight}">
63
- <fo:region-body margin-top="30mm" margin-bottom="40mm" margin-left="40mm" margin-right="40mm"/>
66
+ <fo:simple-page-master master-name="even" page-width="{$pageWidth}mm" page-height="{$pageHeight}mm">
67
+ <fo:region-body margin-top="{$marginTop}mm" margin-bottom="{$marginBottom}mm" margin-left="{$marginLeftRight2}mm" margin-right="{$marginLeftRight1}mm"/>
64
68
  <fo:region-before region-name="header-even" extent="26mm"/>
65
- <fo:region-after region-name="footer-even" extent="40mm"/>
66
- <fo:region-start region-name="left-region" extent="40mm"/>
67
- <fo:region-end region-name="right-region" extent="40mm"/>
69
+ <fo:region-after region-name="footer-even" extent="{$marginBottom}mm"/>
70
+ <fo:region-start region-name="left-region" extent="{$marginLeftRight2}mm"/>
71
+ <fo:region-end region-name="right-region" extent="{$marginLeftRight1}mm"/>
68
72
  </fo:simple-page-master>
69
73
  <fo:page-sequence-master master-name="document">
70
74
  <fo:repeatable-page-master-alternatives>
@@ -1516,6 +1520,7 @@
1516
1520
 
1517
1521
 
1518
1522
 
1523
+
1519
1524
  <xsl:attribute name="color">blue</xsl:attribute>
1520
1525
 
1521
1526
 
@@ -1720,14 +1725,15 @@
1720
1725
  <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1721
1726
 
1722
1727
  <!-- Normative references -->
1723
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="contents"/>
1728
+ <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"/>
1724
1729
  <!-- Terms and definitions -->
1725
1730
  <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"/>
1726
1731
  <!-- Another main sections -->
1727
1732
  <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"/>
1728
1733
  <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
1729
1734
  <!-- Bibliography -->
1730
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="contents"/>
1735
+ <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"/>
1736
+
1731
1737
  </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1732
1738
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1733
1739
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
@@ -2515,6 +2521,7 @@
2515
2521
 
2516
2522
 
2517
2523
 
2524
+
2518
2525
  <xsl:attribute name="display-align">before</xsl:attribute>
2519
2526
  <xsl:attribute name="padding-left">0mm</xsl:attribute>
2520
2527
  <xsl:attribute name="padding-top">2mm</xsl:attribute>
@@ -2557,6 +2564,7 @@
2557
2564
 
2558
2565
 
2559
2566
 
2567
+
2560
2568
  <fo:inline padding-right="2mm">
2561
2569
 
2562
2570
 
@@ -2610,6 +2618,7 @@
2610
2618
 
2611
2619
 
2612
2620
 
2621
+
2613
2622
  <xsl:value-of select="@reference"/>
2614
2623
 
2615
2624
 
@@ -2754,6 +2763,9 @@
2754
2763
 
2755
2764
 
2756
2765
 
2766
+
2767
+
2768
+
2757
2769
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
2758
2770
 
2759
2771
 
@@ -3653,6 +3665,7 @@
3653
3665
  <fo:inline xsl:use-attribute-sets="link-style">
3654
3666
 
3655
3667
 
3668
+
3656
3669
  <xsl:choose>
3657
3670
  <xsl:when test="$target_text = ''">
3658
3671
  <xsl:apply-templates/>
@@ -4014,6 +4027,234 @@
4014
4027
  <xsl:param name="height"/>
4015
4028
  <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; "/>
4016
4029
  <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; "/>
4030
+ </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">
4031
+ <xsl:param name="name"/>
4032
+
4033
+ <xsl:variable name="svg_content">
4034
+ <xsl:apply-templates select="." mode="svg_update"/>
4035
+ </xsl:variable>
4036
+
4037
+ <xsl:variable name="alt-text">
4038
+ <xsl:choose>
4039
+ <xsl:when test="normalize-space(../*[local-name() = 'name']) != ''">
4040
+ <xsl:value-of select="../*[local-name() = 'name']"/>
4041
+ </xsl:when>
4042
+ <xsl:when test="normalize-space($name) != ''">
4043
+ <xsl:value-of select="$name"/>
4044
+ </xsl:when>
4045
+ <xsl:otherwise>Figure</xsl:otherwise>
4046
+ </xsl:choose>
4047
+ </xsl:variable>
4048
+
4049
+ <xsl:choose>
4050
+ <xsl:when test=".//*[local-name() = 'a'][*[local-name() = 'rect'] or *[local-name() = 'polygon'] or *[local-name() = 'circle'] or *[local-name() = 'ellipse']]">
4051
+ <fo:block>
4052
+ <xsl:variable name="width" select="@width"/>
4053
+ <xsl:variable name="height" select="@height"/>
4054
+
4055
+ <xsl:variable name="scale_x">
4056
+ <xsl:choose>
4057
+ <xsl:when test="$width &gt; $width_effective_px">
4058
+ <xsl:value-of select="$width_effective_px div $width"/>
4059
+ </xsl:when>
4060
+ <xsl:otherwise>1</xsl:otherwise>
4061
+ </xsl:choose>
4062
+ </xsl:variable>
4063
+
4064
+ <xsl:variable name="scale_y">
4065
+ <xsl:choose>
4066
+ <xsl:when test="$height * $scale_x &gt; $height_effective_px">
4067
+ <xsl:value-of select="$height_effective_px div ($height * $scale_x)"/>
4068
+ </xsl:when>
4069
+ <xsl:otherwise>1</xsl:otherwise>
4070
+ </xsl:choose>
4071
+ </xsl:variable>
4072
+
4073
+ <xsl:variable name="scale">
4074
+ <xsl:choose>
4075
+ <xsl:when test="$scale_y != 1">
4076
+ <xsl:value-of select="$scale_x * $scale_y"/>
4077
+ </xsl:when>
4078
+ <xsl:otherwise>
4079
+ <xsl:value-of select="$scale_x"/>
4080
+ </xsl:otherwise>
4081
+ </xsl:choose>
4082
+ </xsl:variable>
4083
+
4084
+ <xsl:variable name="width_scale" select="round($width * $scale)"/>
4085
+ <xsl:variable name="height_scale" select="round($height * $scale)"/>
4086
+
4087
+ <fo:table table-layout="fixed" width="100%">
4088
+ <fo:table-column column-width="proportional-column-width(1)"/>
4089
+ <fo:table-column column-width="{$width_scale}px"/>
4090
+ <fo:table-column column-width="proportional-column-width(1)"/>
4091
+ <fo:table-body>
4092
+ <fo:table-row>
4093
+ <fo:table-cell column-number="2">
4094
+ <fo:block>
4095
+ <fo:block-container width="{$width_scale}px" height="{$height_scale}px">
4096
+ <xsl:if test="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
4097
+ <fo:block line-height="0" font-size="0">
4098
+ <xsl:for-each select="../*[local-name() = 'name']/*[local-name() = 'bookmark']">
4099
+ <xsl:call-template name="bookmark"/>
4100
+ </xsl:for-each>
4101
+ </fo:block>
4102
+ </xsl:if>
4103
+ <fo:block text-depth="0" line-height="0" font-size="0">
4104
+
4105
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}">
4106
+ <xsl:attribute name="width">100%</xsl:attribute>
4107
+ <xsl:attribute name="content-height">100%</xsl:attribute>
4108
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4109
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
4110
+
4111
+ <xsl:apply-templates select="xalan:nodeset($svg_content)" mode="svg_remove_a"/>
4112
+ </fo:instream-foreign-object>
4113
+ </fo:block>
4114
+
4115
+ <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">
4116
+ <xsl:with-param name="scale" select="$scale"/>
4117
+ </xsl:apply-templates>
4118
+ </fo:block-container>
4119
+ </fo:block>
4120
+ </fo:table-cell>
4121
+ </fo:table-row>
4122
+ </fo:table-body>
4123
+ </fo:table>
4124
+ </fo:block>
4125
+
4126
+ </xsl:when>
4127
+ <xsl:otherwise>
4128
+ <fo:block xsl:use-attribute-sets="image-style">
4129
+ <fo:instream-foreign-object fox:alt-text="{$alt-text}">
4130
+ <xsl:attribute name="width">100%</xsl:attribute>
4131
+ <xsl:attribute name="content-height">100%</xsl:attribute>
4132
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4133
+ <!-- effective height 297 - 27.4 - 13 = 256.6 -->
4134
+ <!-- effective width 210 - 12.5 - 25 = 172.5 -->
4135
+ <!-- effective height / width = 1.48, 1.4 - with title -->
4136
+ <xsl:if test="@height &gt; (@width * 1.4)"> <!-- for images with big height -->
4137
+ <xsl:variable name="width" select="((@width * 1.4) div @height) * 100"/>
4138
+ <xsl:attribute name="width"><xsl:value-of select="$width"/>%</xsl:attribute>
4139
+ </xsl:if>
4140
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
4141
+ <xsl:copy-of select="$svg_content"/>
4142
+ </fo:instream-foreign-object>
4143
+ </fo:block>
4144
+ </xsl:otherwise>
4145
+ </xsl:choose>
4146
+ </xsl:template><xsl:template match="@*|node()" mode="svg_update">
4147
+ <xsl:copy>
4148
+ <xsl:apply-templates select="@*|node()" mode="svg_update"/>
4149
+ </xsl:copy>
4150
+ </xsl:template><xsl:template match="*[local-name() = 'image']/@href" mode="svg_update">
4151
+ <xsl:attribute name="href" namespace="http://www.w3.org/1999/xlink">
4152
+ <xsl:value-of select="."/>
4153
+ </xsl:attribute>
4154
+ </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'image'][@mimetype = 'image/svg+xml' and @src[not(starts-with(., 'data:image/'))]]" priority="2">
4155
+ <xsl:variable name="svg_content" select="document(@src)"/>
4156
+ <xsl:variable name="name" select="ancestor::*[local-name() = 'figure']/*[local-name() = 'name']"/>
4157
+ <xsl:for-each select="xalan:nodeset($svg_content)/node()">
4158
+ <xsl:call-template name="image_svg">
4159
+ <xsl:with-param name="name" select="$name"/>
4160
+ </xsl:call-template>
4161
+ </xsl:for-each>
4162
+ </xsl:template><xsl:template match="@*|node()" mode="svg_remove_a">
4163
+ <xsl:copy>
4164
+ <xsl:apply-templates select="@*|node()" mode="svg_remove_a"/>
4165
+ </xsl:copy>
4166
+ </xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_remove_a">
4167
+ <xsl:apply-templates mode="svg_remove_a"/>
4168
+ </xsl:template><xsl:template match="*[local-name() = 'a']" mode="svg_imagemap_links">
4169
+ <xsl:param name="scale"/>
4170
+ <xsl:variable name="dest">
4171
+ <xsl:choose>
4172
+ <xsl:when test="starts-with(@href, '#')">
4173
+ <xsl:value-of select="substring-after(@href, '#')"/>
4174
+ </xsl:when>
4175
+ <xsl:otherwise>
4176
+ <xsl:value-of select="@href"/>
4177
+ </xsl:otherwise>
4178
+ </xsl:choose>
4179
+ </xsl:variable>
4180
+ <xsl:for-each select="./*[local-name() = 'rect']">
4181
+ <xsl:call-template name="insertSVGMapLink">
4182
+ <xsl:with-param name="left" select="floor(@x * $scale)"/>
4183
+ <xsl:with-param name="top" select="floor(@y * $scale)"/>
4184
+ <xsl:with-param name="width" select="floor(@width * $scale)"/>
4185
+ <xsl:with-param name="height" select="floor(@height * $scale)"/>
4186
+ <xsl:with-param name="dest" select="$dest"/>
4187
+ </xsl:call-template>
4188
+ </xsl:for-each>
4189
+
4190
+ <xsl:for-each select="./*[local-name() = 'polygon']">
4191
+ <xsl:variable name="points">
4192
+ <xsl:call-template name="split">
4193
+ <xsl:with-param name="pText" select="@points"/>
4194
+ </xsl:call-template>
4195
+ </xsl:variable>
4196
+ <xsl:variable name="x_coords">
4197
+ <xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 1]">
4198
+ <xsl:sort select="." data-type="number"/>
4199
+ <x><xsl:value-of select="."/></x>
4200
+ </xsl:for-each>
4201
+ </xsl:variable>
4202
+ <xsl:variable name="y_coords">
4203
+ <xsl:for-each select="xalan:nodeset($points)//item[position() mod 2 = 0]">
4204
+ <xsl:sort select="." data-type="number"/>
4205
+ <y><xsl:value-of select="."/></y>
4206
+ </xsl:for-each>
4207
+ </xsl:variable>
4208
+ <xsl:variable name="x" select="xalan:nodeset($x_coords)//x[1]"/>
4209
+ <xsl:variable name="y" select="xalan:nodeset($y_coords)//y[1]"/>
4210
+ <xsl:variable name="width" select="xalan:nodeset($x_coords)//x[last()] - $x"/>
4211
+ <xsl:variable name="height" select="xalan:nodeset($y_coords)//y[last()] - $y"/>
4212
+ <xsl:call-template name="insertSVGMapLink">
4213
+ <xsl:with-param name="left" select="floor($x * $scale)"/>
4214
+ <xsl:with-param name="top" select="floor($y * $scale)"/>
4215
+ <xsl:with-param name="width" select="floor($width * $scale)"/>
4216
+ <xsl:with-param name="height" select="floor($height * $scale)"/>
4217
+ <xsl:with-param name="dest" select="$dest"/>
4218
+ </xsl:call-template>
4219
+ </xsl:for-each>
4220
+
4221
+ <xsl:for-each select="./*[local-name() = 'circle']">
4222
+ <xsl:call-template name="insertSVGMapLink">
4223
+ <xsl:with-param name="left" select="floor((@cx - @r) * $scale)"/>
4224
+ <xsl:with-param name="top" select="floor((@cy - @r) * $scale)"/>
4225
+ <xsl:with-param name="width" select="floor(@r * 2 * $scale)"/>
4226
+ <xsl:with-param name="height" select="floor(@r * 2 * $scale)"/>
4227
+ <xsl:with-param name="dest" select="$dest"/>
4228
+ </xsl:call-template>
4229
+ </xsl:for-each>
4230
+ <xsl:for-each select="./*[local-name() = 'ellipse']">
4231
+ <xsl:call-template name="insertSVGMapLink">
4232
+ <xsl:with-param name="left" select="floor((@cx - @rx) * $scale)"/>
4233
+ <xsl:with-param name="top" select="floor((@cy - @ry) * $scale)"/>
4234
+ <xsl:with-param name="width" select="floor(@rx * 2 * $scale)"/>
4235
+ <xsl:with-param name="height" select="floor(@ry * 2 * $scale)"/>
4236
+ <xsl:with-param name="dest" select="$dest"/>
4237
+ </xsl:call-template>
4238
+ </xsl:for-each>
4239
+ </xsl:template><xsl:template name="insertSVGMapLink">
4240
+ <xsl:param name="left"/>
4241
+ <xsl:param name="top"/>
4242
+ <xsl:param name="width"/>
4243
+ <xsl:param name="height"/>
4244
+ <xsl:param name="dest"/>
4245
+ <fo:block-container position="absolute" left="{$left}px" top="{$top}px" width="{$width}px" height="{$height}px">
4246
+ <fo:block font-size="1pt">
4247
+ <fo:basic-link internal-destination="{$dest}" fox:alt-text="svg link">
4248
+ <fo:inline-container inline-progression-dimension="100%">
4249
+ <fo:block-container height="{$height - 1}px" width="100%">
4250
+ <!-- DEBUG <xsl:if test="local-name()='polygon'">
4251
+ <xsl:attribute name="background-color">magenta</xsl:attribute>
4252
+ </xsl:if> -->
4253
+ <fo:block> </fo:block></fo:block-container>
4254
+ </fo:inline-container>
4255
+ </fo:basic-link>
4256
+ </fo:block>
4257
+ </fo:block-container>
4017
4258
  </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">
4018
4259
  <xsl:apply-templates mode="contents"/>
4019
4260
  <xsl:text> </xsl:text>
@@ -4042,28 +4283,39 @@
4042
4283
  <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
4043
4284
  <xsl:for-each select="xalan:nodeset($contents)/doc">
4044
4285
  <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
4286
+ <xsl:if test="@bundle = 'true'">
4287
+ <xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
4288
+ </xsl:if>
4045
4289
  <fo:bookmark-title>
4046
- <xsl:variable name="bookmark-title_">
4047
- <xsl:call-template name="getLangVersion">
4048
- <xsl:with-param name="lang" select="@lang"/>
4049
- <xsl:with-param name="doctype" select="@doctype"/>
4050
- <xsl:with-param name="title" select="@title-part"/>
4051
- </xsl:call-template>
4052
- </xsl:variable>
4053
4290
  <xsl:choose>
4054
- <xsl:when test="normalize-space($bookmark-title_) != ''">
4055
- <xsl:value-of select="normalize-space($bookmark-title_)"/>
4056
- </xsl:when>
4057
- <xsl:otherwise>
4291
+ <xsl:when test="not(normalize-space(@bundle) = 'true')"> <!-- 'bundle' means several different documents (not language versions) in one xml -->
4292
+ <xsl:variable name="bookmark-title_">
4293
+ <xsl:call-template name="getLangVersion">
4294
+ <xsl:with-param name="lang" select="@lang"/>
4295
+ <xsl:with-param name="doctype" select="@doctype"/>
4296
+ <xsl:with-param name="title" select="@title-part"/>
4297
+ </xsl:call-template>
4298
+ </xsl:variable>
4058
4299
  <xsl:choose>
4059
- <xsl:when test="@lang = 'en'">English</xsl:when>
4060
- <xsl:when test="@lang = 'fr'">Français</xsl:when>
4061
- <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
4062
- <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
4300
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
4301
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
4302
+ </xsl:when>
4303
+ <xsl:otherwise>
4304
+ <xsl:choose>
4305
+ <xsl:when test="@lang = 'en'">English</xsl:when>
4306
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
4307
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
4308
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
4309
+ </xsl:choose>
4310
+ </xsl:otherwise>
4063
4311
  </xsl:choose>
4312
+ </xsl:when>
4313
+ <xsl:otherwise>
4314
+ <xsl:value-of select="@title-part"/>
4064
4315
  </xsl:otherwise>
4065
4316
  </xsl:choose>
4066
4317
  </fo:bookmark-title>
4318
+
4067
4319
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
4068
4320
 
4069
4321
  <xsl:call-template name="insertFigureBookmarks">
@@ -4162,16 +4414,23 @@
4162
4414
  <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
4163
4415
  </xsl:choose>
4164
4416
  </xsl:template><xsl:template match="item" mode="bookmark">
4165
- <fo:bookmark internal-destination="{@id}" starting-state="hide">
4166
- <fo:bookmark-title>
4167
- <xsl:if test="@section != ''">
4168
- <xsl:value-of select="@section"/>
4169
- <xsl:text> </xsl:text>
4170
- </xsl:if>
4171
- <xsl:value-of select="normalize-space(title)"/>
4172
- </fo:bookmark-title>
4173
- <xsl:apply-templates mode="bookmark"/>
4174
- </fo:bookmark>
4417
+ <xsl:choose>
4418
+ <xsl:when test="@id != ''">
4419
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
4420
+ <fo:bookmark-title>
4421
+ <xsl:if test="@section != ''">
4422
+ <xsl:value-of select="@section"/>
4423
+ <xsl:text> </xsl:text>
4424
+ </xsl:if>
4425
+ <xsl:value-of select="normalize-space(title)"/>
4426
+ </fo:bookmark-title>
4427
+ <xsl:apply-templates mode="bookmark"/>
4428
+ </fo:bookmark>
4429
+ </xsl:when>
4430
+ <xsl:otherwise>
4431
+ <xsl:apply-templates mode="bookmark"/>
4432
+ </xsl:otherwise>
4433
+ </xsl:choose>
4175
4434
  </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">
4176
4435
  <xsl:if test="normalize-space() != ''">
4177
4436
  <fo:block xsl:use-attribute-sets="figure-name-style">
@@ -4722,6 +4981,7 @@
4722
4981
  </xsl:if>
4723
4982
 
4724
4983
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
4984
+
4725
4985
  <xsl:if test="normalize-space(@citeas) = ''">
4726
4986
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
4727
4987
  </xsl:if>