metanorma-iho 1.1.3 → 1.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -153,74 +153,131 @@
153
153
  <!-- Cover Page -->
154
154
  <fo:page-sequence master-reference="cover">
155
155
  <fo:flow flow-name="xsl-region-body">
156
- <fo:block-container position="absolute" left="14.25mm" top="12mm" id="__internal_layout__coverpage_{generate-id()}">
157
- <fo:table table-layout="fixed" width="181.1mm">
158
- <fo:table-column column-width="26mm"/>
159
- <fo:table-column column-width="19.4mm"/>
160
- <fo:table-column column-width="135.7mm"/>
161
- <fo:table-body>
162
- <fo:table-row>
163
- <fo:table-cell><fo:block> </fo:block></fo:table-cell>
164
- <fo:table-cell>
165
- <fo:block-container width="19.4mm" height="21mm" background-color="rgb(241, 234, 202)" border-bottom="0.05pt solid rgb(0, 21, 50)" text-align="center" display-align="center" font-size="10pt" font-weight="bold">
166
- <fo:block>
167
- <xsl:value-of select="$docidentifier"/>
168
- </fo:block>
169
- </fo:block-container>
170
- </fo:table-cell>
171
- <fo:table-cell><fo:block> </fo:block></fo:table-cell>
172
- </fo:table-row>
173
- <fo:table-row>
174
- <fo:table-cell display-align="after" text-align="right">
175
- <fo:block font-size="1">
176
- <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-IHO))}" width="25.9mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image IHO"/>
177
- </fo:block>
178
- </fo:table-cell>
179
- <fo:table-cell number-columns-spanned="2" border="0.5pt solid rgb(0, 21, 50)" font-weight="bold" color="rgb(0, 0, 76)" padding-top="3mm">
180
- <fo:block-container height="165mm" width="115mm">
181
- <fo:block-container margin-left="10mm">
182
- <fo:block-container margin-left="0mm">
183
- <fo:block-container display-align="center" height="90mm">
184
- <fo:block font-size="28pt" role="H1" line-height="115%">
185
- <xsl:copy-of select="$title-en"/>
186
- </fo:block>
187
- </fo:block-container>
188
- <fo:block font-size="14pt">
189
- <xsl:value-of select="$edition"/>
190
- <xsl:if test="normalize-space($month_year) != ''">
191
- <xsl:text> – </xsl:text>
192
- <xsl:value-of select="$month_year"/>
156
+
157
+ <xsl:variable name="isCoverPageImage" select="normalize-space(/*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'coverpage-image']/*[local-name() = 'value']/*[local-name() = 'image'] and 1 = 1)"/>
158
+
159
+ <xsl:variable name="document_scheme" select="normalize-space(/*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'document-scheme']/*[local-name() = 'value'])"/>
160
+
161
+ <xsl:choose>
162
+ <xsl:when test="$document_scheme != '' and $document_scheme != '2019' and $isCoverPageImage = 'true'">
163
+ <xsl:call-template name="insertBackgroundPageImage"/>
164
+ </xsl:when>
165
+ <xsl:otherwise>
166
+
167
+ <fo:block-container position="absolute" left="14.25mm" top="12mm" id="__internal_layout__coverpage_{generate-id()}">
168
+ <fo:table table-layout="fixed" width="181.1mm">
169
+ <fo:table-column column-width="26mm"/>
170
+ <fo:table-column column-width="19.4mm"/>
171
+ <fo:table-column column-width="135.7mm"/>
172
+ <fo:table-body>
173
+ <fo:table-row>
174
+ <fo:table-cell><fo:block> </fo:block></fo:table-cell>
175
+ <fo:table-cell>
176
+ <fo:block-container width="19.4mm" height="21mm" background-color="rgb(241, 234, 202)" border-bottom="0.05pt solid rgb(0, 21, 50)" text-align="center" display-align="center" font-size="10pt" font-weight="bold">
177
+ <xsl:if test="$isCoverPageImage = 'true'">
178
+ <xsl:attribute name="width">42.5mm</xsl:attribute>
179
+ </xsl:if>
180
+ <fo:block>
181
+ <xsl:value-of select="$docidentifier"/>
182
+ <xsl:if test="$isCoverPageImage = 'true'">
183
+ <xsl:text> </xsl:text><xsl:value-of select="$edition"/>
193
184
  </xsl:if>
194
185
  </fo:block>
195
186
  </fo:block-container>
196
- </fo:block-container>
197
- </fo:block-container>
198
- </fo:table-cell>
199
- </fo:table-row>
200
- <fo:table-row>
201
- <fo:table-cell>
202
- <fo:block font-size="1">
203
- <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Logo-IHO))}" width="25.9mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image Logo IHO"/>
204
- </fo:block>
205
- </fo:table-cell>
206
- <fo:table-cell>
207
- <fo:block font-size="1">
208
- <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Text-IHO))}" width="25.8mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image Text IHO"/>
209
- </fo:block>
210
- </fo:table-cell>
211
- <fo:table-cell>
212
- <fo:block-container width="79mm" height="72mm" margin-left="56.8mm" background-color="rgb(0, 172, 158)" text-align="right" display-align="after">
213
- <fo:block-container margin-left="0mm">
214
- <fo:block font-size="8pt" color="white" margin-right="5mm" margin-bottom="5mm" line-height-shift-adjustment="disregard-shifts">
215
- <xsl:apply-templates select="/iho:metanorma/iho:boilerplate/iho:feedback-statement"/>
187
+ </fo:table-cell>
188
+ <fo:table-cell><fo:block> </fo:block></fo:table-cell>
189
+ </fo:table-row>
190
+ <fo:table-row>
191
+ <fo:table-cell display-align="after" text-align="right">
192
+ <fo:block font-size="1">
193
+ <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-IHO))}" width="25.9mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image IHO"/>
216
194
  </fo:block>
217
- </fo:block-container>
218
- </fo:block-container>
219
- </fo:table-cell>
220
- </fo:table-row>
221
- </fo:table-body>
222
- </fo:table>
223
- </fo:block-container>
195
+ </fo:table-cell>
196
+
197
+ <!-- https://github.com/metanorma/metanorma-iho/issues/288 -->
198
+ <xsl:choose>
199
+ <xsl:when test="$isCoverPageImage = 'true'">
200
+ <fo:table-cell number-columns-spanned="2">
201
+ <fo:block-container font-size="0"> <!-- height="168mm" width="115mm" -->
202
+ <fo:block>
203
+ <xsl:for-each select="/*[local-name() = 'metanorma']/*[local-name() = 'metanorma-extension']/*[local-name() = 'presentation-metadata'][*[local-name() = 'name'] = 'coverpage-image'][1]/*[local-name() = 'value']/*[local-name() = 'image'][1]">
204
+ <xsl:choose>
205
+ <xsl:when test="*[local-name() = 'svg'] or java:endsWith(java:java.lang.String.new(@src), '.svg')">
206
+ <fo:instream-foreign-object fox:alt-text="Image Front">
207
+ <xsl:attribute name="content-height"><xsl:value-of select="$pageHeight"/>mm</xsl:attribute>
208
+ <xsl:call-template name="getSVG"/>
209
+ </fo:instream-foreign-object>
210
+ </xsl:when>
211
+ <xsl:when test="starts-with(@src, 'data:application/pdf;base64')">
212
+ <fo:external-graphic src="{@src}" fox:alt-text="Image Front"/>
213
+ </xsl:when>
214
+ <xsl:otherwise> <!-- bitmap image -->
215
+ <xsl:variable name="coverimage_src" select="normalize-space(@src)"/>
216
+ <xsl:if test="$coverimage_src != ''">
217
+ <xsl:variable name="coverpage">
218
+ <xsl:call-template name="getImageURL">
219
+ <xsl:with-param name="src" select="$coverimage_src"/>
220
+ </xsl:call-template>
221
+ </xsl:variable>
222
+ <fo:external-graphic src="{$coverpage}" width="155.5mm" content-height="scale-to-fit" scaling="uniform" fox:alt-text="Image Front"/>
223
+ </xsl:if>
224
+ </xsl:otherwise>
225
+ </xsl:choose>
226
+ </xsl:for-each>
227
+ </fo:block>
228
+ </fo:block-container>
229
+ </fo:table-cell>
230
+ </xsl:when>
231
+ <xsl:otherwise>
232
+ <fo:table-cell number-columns-spanned="2" border="0.5pt solid rgb(0, 21, 50)" font-weight="bold" color="rgb(0, 0, 76)" padding-top="3mm">
233
+ <fo:block-container height="165mm" width="115mm">
234
+ <fo:block-container margin-left="10mm">
235
+ <fo:block-container margin-left="0mm">
236
+ <fo:block-container display-align="center" height="90mm">
237
+ <fo:block font-size="28pt" role="H1" line-height="115%">
238
+ <xsl:copy-of select="$title-en"/>
239
+ </fo:block>
240
+ </fo:block-container>
241
+ <fo:block font-size="14pt">
242
+ <xsl:value-of select="$edition"/>
243
+ <xsl:if test="normalize-space($month_year) != ''">
244
+ <xsl:text> – </xsl:text>
245
+ <xsl:value-of select="$month_year"/>
246
+ </xsl:if>
247
+ </fo:block>
248
+ </fo:block-container>
249
+ </fo:block-container>
250
+ </fo:block-container>
251
+ </fo:table-cell>
252
+ </xsl:otherwise>
253
+ </xsl:choose>
254
+ </fo:table-row>
255
+ <fo:table-row>
256
+ <fo:table-cell>
257
+ <fo:block font-size="1">
258
+ <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Logo-IHO))}" width="25.9mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image Logo IHO"/>
259
+ </fo:block>
260
+ </fo:table-cell>
261
+ <fo:table-cell>
262
+ <fo:block font-size="1">
263
+ <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Text-IHO))}" width="25.8mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image Text IHO"/>
264
+ </fo:block>
265
+ </fo:table-cell>
266
+ <fo:table-cell>
267
+ <fo:block-container width="79mm" height="72mm" margin-left="56.8mm" background-color="rgb(0, 172, 158)" text-align="right" display-align="after">
268
+ <fo:block-container margin-left="0mm">
269
+ <fo:block font-size="8pt" color="white" margin-right="5mm" margin-bottom="5mm" line-height-shift-adjustment="disregard-shifts">
270
+ <xsl:apply-templates select="/iho:metanorma/iho:boilerplate/iho:feedback-statement"/>
271
+ </fo:block>
272
+ </fo:block-container>
273
+ </fo:block-container>
274
+ </fo:table-cell>
275
+ </fo:table-row>
276
+ </fo:table-body>
277
+ </fo:table>
278
+ </fo:block-container>
279
+ </xsl:otherwise>
280
+ </xsl:choose>
224
281
  </fo:flow>
225
282
  </fo:page-sequence>
226
283
  <!-- End Cover Page -->
@@ -639,6 +696,35 @@
639
696
  <!-- ============================= -->
640
697
  <!-- ============================= -->
641
698
 
699
+ <xsl:template match="*[local-name() = 'requirement'] | *[local-name() = 'recommendation'] | *[local-name() = 'permission']" priority="2" mode="update_xml_step1">
700
+ <xsl:copy>
701
+ <xsl:apply-templates select="@*|node()" mode="update_xml_step1"/>
702
+ </xsl:copy>
703
+ </xsl:template>
704
+
705
+ <xsl:template match="*[local-name() = 'requirement'] | *[local-name() = 'recommendation'] | *[local-name() = 'permission']" priority="2">
706
+ <xsl:call-template name="setNamedDestination"/>
707
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="recommendation-style">
708
+ <fo:block-container margin="2mm">
709
+ <fo:block-container margin="0">
710
+ <fo:block>
711
+ <xsl:apply-templates/>
712
+ </fo:block>
713
+ </fo:block-container>
714
+ </fo:block-container>
715
+ </fo:block-container>
716
+ </xsl:template>
717
+
718
+ <xsl:template match="*[local-name() = 'fmt-provision']" priority="2" mode="update_xml_step1">
719
+ <xsl:copy>
720
+ <xsl:apply-templates select="@*|node()" mode="update_xml_step1"/>
721
+ </xsl:copy>
722
+ </xsl:template>
723
+
724
+ <xsl:template match="*[local-name() = 'fmt-provision']/*[local-name() = 'div']" priority="2">
725
+ <fo:inline><xsl:copy-of select="@id"/><xsl:apply-templates/></fo:inline>
726
+ </xsl:template>
727
+
642
728
  <xsl:template match="/iho:metanorma/iho:bibdata/iho:edition">
643
729
  <xsl:call-template name="capitalize">
644
730
  <xsl:with-param name="str">
@@ -785,6 +871,7 @@
785
871
  <xsl:when test="$inline = 'true'">fo:inline</xsl:when>
786
872
  <xsl:when test="../@inline-header = 'true' and $previous-element = 'title'">fo:inline</xsl:when> <!-- first paragraph after inline title -->
787
873
  <xsl:when test="local-name(..) = 'admonition'">fo:inline</xsl:when>
874
+ <xsl:when test="ancestor::*[local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'permission'] and not(preceding-sibling::*[local-name() = 'p'])">fo:inline</xsl:when>
788
875
  <xsl:otherwise>fo:block</xsl:otherwise>
789
876
  </xsl:choose>
790
877
  </xsl:variable>
@@ -826,6 +913,10 @@
826
913
  <!-- <xsl:attribute name="margin-bottom">12pt</xsl:attribute> -->
827
914
  </xsl:if>
828
915
 
916
+ <xsl:if test="ancestor::*[local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'permission'] and not(following-sibling::*)">
917
+ <xsl:attribute name="space-after">0pt</xsl:attribute>
918
+ </xsl:if>
919
+
829
920
  <xsl:if test=".//iho:fn">
830
921
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
831
922
  </xsl:if>
@@ -834,7 +925,7 @@
834
925
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
835
926
  </xsl:apply-templates>
836
927
  </xsl:element>
837
- <xsl:if test="$element-name = 'fo:inline' and not($inline = 'true') and not(local-name(..) = 'admonition')">
928
+ <xsl:if test="$element-name = 'fo:inline' and not($inline = 'true') and not(local-name(..) = 'admonition') and not(ancestor::*[local-name() = 'recommendation' or local-name() = 'requirement' or local-name() = 'permission'])">
838
929
  <fo:block margin-bottom="12pt">
839
930
  <!-- <xsl:if test="ancestor::iho:annex">
840
931
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
@@ -1496,6 +1587,8 @@
1496
1587
 
1497
1588
  <xsl:attribute-set name="permission-name-style">
1498
1589
 
1590
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1591
+
1499
1592
  </xsl:attribute-set>
1500
1593
 
1501
1594
  <xsl:attribute-set name="permission-label-style">
@@ -1509,6 +1602,8 @@
1509
1602
  <xsl:attribute-set name="requirement-name-style">
1510
1603
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1511
1604
 
1605
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1606
+
1512
1607
  </xsl:attribute-set>
1513
1608
 
1514
1609
  <xsl:attribute-set name="requirement-label-style">
@@ -1541,10 +1636,14 @@
1541
1636
 
1542
1637
  <xsl:attribute-set name="recommendation-style">
1543
1638
 
1639
+ <xsl:attribute name="border">1pt solid black</xsl:attribute>
1640
+
1544
1641
  </xsl:attribute-set>
1545
1642
 
1546
1643
  <xsl:attribute-set name="recommendation-name-style">
1547
1644
 
1645
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1646
+
1548
1647
  </xsl:attribute-set>
1549
1648
 
1550
1649
  <xsl:attribute-set name="recommendation-label-style">
@@ -1595,8 +1694,9 @@
1595
1694
 
1596
1695
  <xsl:attribute-set name="example-p-style">
1597
1696
 
1598
- <xsl:attribute name="font-size">11pt</xsl:attribute>
1599
- <xsl:attribute name="margin-left">12.7mm</xsl:attribute>
1697
+ <!-- <xsl:attribute name="font-size">11pt</xsl:attribute>
1698
+ <xsl:attribute name="margin-left">12.7mm</xsl:attribute> -->
1699
+ <xsl:attribute name="space-before">2pt</xsl:attribute>
1600
1700
 
1601
1701
  </xsl:attribute-set> <!-- example-p-style -->
1602
1702
 
@@ -1661,6 +1761,7 @@
1661
1761
  </xsl:template> <!-- refine_table-style -->
1662
1762
 
1663
1763
  <xsl:attribute-set name="table-name-style">
1764
+ <xsl:attribute name="role">Caption</xsl:attribute>
1664
1765
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1665
1766
 
1666
1767
  <xsl:attribute name="text-align">center</xsl:attribute>
@@ -1672,6 +1773,9 @@
1672
1773
 
1673
1774
  <xsl:template name="refine_table-name-style">
1674
1775
  <xsl:param name="continued"/>
1776
+ <xsl:if test="$continued = 'true'">
1777
+ <xsl:attribute name="role">SKIP</xsl:attribute>
1778
+ </xsl:if>
1675
1779
 
1676
1780
  </xsl:template> <!-- refine_table-name-style -->
1677
1781
 
@@ -3303,8 +3407,14 @@
3303
3407
  </xsl:choose>
3304
3408
  </xsl:variable>
3305
3409
 
3410
+ <xsl:call-template name="setNamedDestination"/>
3411
+
3306
3412
  <fo:block-container xsl:use-attribute-sets="table-container-style" role="SKIP">
3307
3413
 
3414
+ <xsl:for-each select="*[local-name() = 'name']">
3415
+ <xsl:call-template name="setIDforNamedDestination"/>
3416
+ </xsl:for-each>
3417
+
3308
3418
  <xsl:call-template name="refine_table-container-style">
3309
3419
  <xsl:with-param name="margin-side" select="$margin-side"/>
3310
3420
  </xsl:call-template>
@@ -3448,7 +3558,7 @@
3448
3558
  </xsl:if>
3449
3559
 
3450
3560
  </fo:block-container>
3451
- </xsl:variable>
3561
+ </xsl:variable> <!-- END: variable name="table" -->
3452
3562
 
3453
3563
  <xsl:variable name="isAdded" select="@added"/>
3454
3564
  <xsl:variable name="isDeleted" select="@deleted"/>
@@ -3458,14 +3568,14 @@
3458
3568
 
3459
3569
  <!-- centered table when table name is centered (see table-name-style) -->
3460
3570
 
3461
- <fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table-container-style">
3571
+ <fo:table table-layout="fixed" width="100%" xsl:use-attribute-sets="table-container-style" role="SKIP">
3462
3572
 
3463
3573
  <fo:table-column column-width="proportional-column-width(1)"/>
3464
3574
  <fo:table-column column-width="{@width}"/>
3465
3575
  <fo:table-column column-width="proportional-column-width(1)"/>
3466
- <fo:table-body>
3467
- <fo:table-row>
3468
- <fo:table-cell column-number="2">
3576
+ <fo:table-body role="SKIP">
3577
+ <fo:table-row role="SKIP">
3578
+ <fo:table-cell column-number="2" role="SKIP">
3469
3579
  <xsl:copy-of select="$table-preamble"/>
3470
3580
  <fo:block role="SKIP">
3471
3581
  <xsl:call-template name="setTrackChangesStyles">
@@ -3506,11 +3616,13 @@
3506
3616
 
3507
3617
  </xsl:template>
3508
3618
 
3619
+ <!-- table/name-->
3509
3620
  <xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
3510
3621
  <xsl:param name="continued"/>
3622
+ <xsl:param name="cols-count"/>
3511
3623
  <xsl:if test="normalize-space() != ''">
3512
3624
 
3513
- <fo:block xsl:use-attribute-sets="table-name-style" role="SKIP">
3625
+ <fo:block xsl:use-attribute-sets="table-name-style">
3514
3626
 
3515
3627
  <xsl:call-template name="refine_table-name-style">
3516
3628
  <xsl:with-param name="continued" select="$continued"/>
@@ -3529,9 +3641,30 @@
3529
3641
 
3530
3642
  <!-- <xsl:if test="$namespace = 'bsi' or $namespace = 'iec' or $namespace = 'iso'"> -->
3531
3643
  <xsl:if test="$continued = 'true'">
3532
- <fo:block text-align="right">
3533
- <xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
3534
- </fo:block>
3644
+
3645
+ <!-- to prevent the error 'THead element may contain only TR elements' -->
3646
+
3647
+ <xsl:choose>
3648
+ <xsl:when test="string(number($cols-count)) != 'NaN'">
3649
+ <fo:table width="100%" table-layout="fixed" role="SKIP">
3650
+ <fo:table-body role="SKIP">
3651
+ <fo:table-row>
3652
+ <fo:table-cell role="TH" number-columns-spanned="{$cols-count}">
3653
+ <fo:block text-align="right" role="SKIP">
3654
+ <xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
3655
+ </fo:block>
3656
+ </fo:table-cell>
3657
+ </fo:table-row>
3658
+ </fo:table-body>
3659
+ </fo:table>
3660
+ </xsl:when>
3661
+ <xsl:otherwise>
3662
+ <fo:block text-align="right">
3663
+ <xsl:apply-templates select="../*[local-name() = 'note'][@type = 'units']/node()"/>
3664
+ </fo:block>
3665
+ </xsl:otherwise>
3666
+ </xsl:choose>
3667
+
3535
3668
  </xsl:if>
3536
3669
  <!-- </xsl:if> -->
3537
3670
 
@@ -3924,6 +4057,7 @@
3924
4057
 
3925
4058
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
3926
4059
  <xsl:with-param name="continued">true</xsl:with-param>
4060
+ <xsl:with-param name="cols-count" select="$cols-count"/>
3927
4061
  </xsl:apply-templates>
3928
4062
 
3929
4063
  <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
@@ -3987,7 +4121,7 @@
3987
4121
 
3988
4122
  <xsl:variable name="tableWithNotesAndFootnotes">
3989
4123
 
3990
- <fo:table keep-with-previous="always">
4124
+ <fo:table keep-with-previous="always" role="SKIP">
3991
4125
  <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
3992
4126
  <xsl:variable name="name" select="local-name()"/>
3993
4127
  <xsl:choose>
@@ -4018,9 +4152,9 @@
4018
4152
  </xsl:otherwise>
4019
4153
  </xsl:choose>
4020
4154
 
4021
- <fo:table-body>
4022
- <fo:table-row>
4023
- <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
4155
+ <fo:table-body role="SKIP">
4156
+ <fo:table-row role="SKIP">
4157
+ <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}" role="SKIP">
4024
4158
 
4025
4159
  <xsl:call-template name="refine_table-footer-cell-style"/>
4026
4160
 
@@ -4305,8 +4439,8 @@
4305
4439
  <xsl:for-each select="xalan:nodeset($styles__)/item">
4306
4440
  <xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
4307
4441
  <xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
4308
- <xsl:if test="$key = 'color' or $key = 'background-color'">
4309
- <style name="{$key}"><xsl:value-of select="$value"/></style>
4442
+ <xsl:if test="$key = 'color' or $key = 'background-color' or $key = 'border' or $key = 'border-top' or $key = 'border-right' or $key = 'border-left' or $key = 'border-bottom' or $key = 'border-style' or $key = 'border-width' or $key = 'border-color' or $key = 'border-top-style' or $key = 'border-top-width' or $key = 'border-top-color' or $key = 'border-right-style' or $key = 'border-right-width' or $key = 'border-right-color' or $key = 'border-left-style' or $key = 'border-left-width' or $key = 'border-left-color' or $key = 'border-bottom-style' or $key = 'border-bottom-width' or $key = 'border-bottom-color'">
4443
+ <style name="{$key}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($value), 'currentColor', 'inherit')"/></style>
4310
4444
  </xsl:if>
4311
4445
  </xsl:for-each>
4312
4446
  </xsl:variable>
@@ -4370,6 +4504,7 @@
4370
4504
  <!-- table/note, table/example, table/tfoot//note, table/tfoot//example -->
4371
4505
  <xsl:template match="*[local-name()='table']/*[local-name()='note' or local-name() = 'example'] | *[local-name()='table']/*[local-name()='tfoot']//*[local-name()='note' or local-name() = 'example']" priority="2">
4372
4506
 
4507
+ <xsl:call-template name="setNamedDestination"/>
4373
4508
  <fo:block xsl:use-attribute-sets="table-note-style">
4374
4509
  <xsl:copy-of select="@id"/>
4375
4510
 
@@ -4417,6 +4552,7 @@
4417
4552
  <!-- footnotes in text (title, bibliography, main body), not for tables, figures and names --> <!-- table's, figure's names -->
4418
4553
  <!-- fn in text -->
4419
4554
  <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" priority="2" name="fn">
4555
+ <xsl:param name="footnote_body_from_table">false</xsl:param>
4420
4556
 
4421
4557
  <!-- list of unique footnotes -->
4422
4558
  <xsl:variable name="p_fn_">
@@ -4482,7 +4618,7 @@
4482
4618
  <xsl:copy-of select="$footnote_inline"/>
4483
4619
  </xsl:when>
4484
4620
  <!-- <xsl:when test="$footnotes//*[local-name() = 'fmt-fn-body'][@id = $ref_id] or normalize-space(@skip_footnote_body) = 'false'"> -->
4485
- <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false'">
4621
+ <xsl:when test="$p_fn//fn[@gen_id = $gen_id] or normalize-space(@skip_footnote_body) = 'false' or $footnote_body_from_table = 'true'">
4486
4622
 
4487
4623
  <fo:footnote xsl:use-attribute-sets="fn-style" role="SKIP">
4488
4624
  <xsl:copy-of select="$footnote_inline"/>
@@ -4891,39 +5027,51 @@
4891
5027
  <!-- fn reference in the table rendering (for instance, 'some text 1) some text' ) -->
4892
5028
  <!-- fn --> <!-- in table --> <!-- for figure see <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/> -->
4893
5029
  <xsl:template match="*[local-name()='fn']">
4894
- <fo:inline xsl:use-attribute-sets="fn-reference-style">
4895
-
4896
- <xsl:call-template name="refine_fn-reference-style"/>
5030
+ <xsl:variable name="target" select="@target"/>
5031
+ <xsl:choose>
5032
+ <!-- case for footnotes in Requirement tables (https://github.com/metanorma/metanorma-ogc/issues/791) -->
5033
+ <xsl:when test="not(ancestor::*[local-name() = 'table'][1]//*[local-name() = 'fmt-footnote-container']/*[local-name() = 'fmt-fn-body'][@id = $target]) and $footnotes/*[local-name() = 'fmt-fn-body'][@id = $target]">
5034
+ <xsl:call-template name="fn">
5035
+ <xsl:with-param name="footnote_body_from_table">true</xsl:with-param>
5036
+ </xsl:call-template>
5037
+ </xsl:when>
5038
+ <xsl:otherwise>
4897
5039
 
4898
- <!-- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> --> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
4899
- <fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
4900
- <!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
4901
- <!-- <xsl:attribute name="internal-destination">
4902
- <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
4903
- </xsl:attribute>
4904
- </xsl:if>
4905
- <xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
4906
- <xsl:attribute name="internal-destination">
4907
- <xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
4908
- <xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
4909
- </xsl:attribute>
4910
- </xsl:if> -->
4911
- <!-- <xsl:if test="$namespace = 'plateau'">
4912
- <xsl:text>※</xsl:text>
4913
- </xsl:if> -->
4914
- <!-- <xsl:value-of select="@reference"/> -->
5040
+ <fo:inline xsl:use-attribute-sets="fn-reference-style">
4915
5041
 
4916
- <xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
5042
+ <xsl:call-template name="refine_fn-reference-style"/>
4917
5043
 
4918
- <!-- <xsl:if test="$namespace = 'bsi'">
4919
- <xsl:text>)</xsl:text>
4920
- </xsl:if> -->
4921
- <!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
4922
- <!-- <xsl:if test="$namespace = 'jis'">
4923
- <fo:inline font-weight="normal">)</fo:inline>
4924
- </xsl:if> -->
4925
- </fo:basic-link>
4926
- </fo:inline>
5044
+ <!-- <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="footnote {@reference}"> --> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
5045
+ <fo:basic-link internal-destination="{@target}" fox:alt-text="footnote {@reference}">
5046
+ <!-- <xsl:if test="ancestor::*[local-name()='table'][1]/@id"> --> <!-- for footnotes in tables -->
5047
+ <!-- <xsl:attribute name="internal-destination">
5048
+ <xsl:value-of select="concat(@reference, '_', ancestor::*[local-name()='table'][1]/@id)"/>
5049
+ </xsl:attribute>
5050
+ </xsl:if>
5051
+ <xsl:if test="$namespace = 'ogc' or $namespace = 'ogc-white-paper'">
5052
+ <xsl:attribute name="internal-destination">
5053
+ <xsl:value-of select="@reference"/><xsl:text>_</xsl:text>
5054
+ <xsl:value-of select="ancestor::*[local-name()='table'][1]/@id"/>
5055
+ </xsl:attribute>
5056
+ </xsl:if> -->
5057
+ <!-- <xsl:if test="$namespace = 'plateau'">
5058
+ <xsl:text>※</xsl:text>
5059
+ </xsl:if> -->
5060
+ <!-- <xsl:value-of select="@reference"/> -->
5061
+
5062
+ <xsl:value-of select="normalize-space(*[local-name() = 'fmt-fn-label'])"/>
5063
+
5064
+ <!-- <xsl:if test="$namespace = 'bsi'">
5065
+ <xsl:text>)</xsl:text>
5066
+ </xsl:if> -->
5067
+ <!-- commented, https://github.com/metanorma/isodoc/issues/614 -->
5068
+ <!-- <xsl:if test="$namespace = 'jis'">
5069
+ <fo:inline font-weight="normal">)</fo:inline>
5070
+ </xsl:if> -->
5071
+ </fo:basic-link>
5072
+ </fo:inline>
5073
+ </xsl:otherwise>
5074
+ </xsl:choose>
4927
5075
  </xsl:template> <!-- fn -->
4928
5076
 
4929
5077
  <!-- fn/text() -->
@@ -4978,6 +5126,10 @@
4978
5126
  <!-- <dl><xsl:copy-of select="."/></dl> -->
4979
5127
  <fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
4980
5128
 
5129
+ <xsl:if test="@key = 'true' and ancestor::*[local-name() = 'figure']">
5130
+ <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
5131
+ </xsl:if>
5132
+
4981
5133
  <xsl:call-template name="setBlockSpanAll"/>
4982
5134
 
4983
5135
  <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
@@ -5273,7 +5425,7 @@
5273
5425
 
5274
5426
  <!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
5275
5427
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
5276
- <fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
5428
+ <fo:block text-align="left" margin-bottom="12pt" keep-with-next="always" keep-with-previous="always">
5277
5429
  <xsl:call-template name="refine_figure_key_style"/>
5278
5430
  <xsl:apply-templates/>
5279
5431
  </fo:block>
@@ -5528,6 +5680,7 @@
5528
5680
 
5529
5681
  <xsl:call-template name="refine_dt-cell-style"/>
5530
5682
 
5683
+ <xsl:call-template name="setNamedDestination"/>
5531
5684
  <fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
5532
5685
 
5533
5686
  <xsl:choose>
@@ -5963,7 +6116,7 @@
5963
6116
  <!-- ================= -->
5964
6117
 
5965
6118
  <!-- highlight text -->
5966
- <xsl:template match="*[local-name()='hi']">
6119
+ <xsl:template match="*[local-name()='hi'] | *[local-name() = 'span'][@class = 'fmt-hi']" priority="3">
5967
6120
  <fo:inline background-color="yellow">
5968
6121
  <xsl:apply-templates/>
5969
6122
  </fo:inline>
@@ -7629,6 +7782,7 @@
7629
7782
  <!-- Appendix processing -->
7630
7783
  <!-- ======================== -->
7631
7784
  <xsl:template match="*[local-name()='appendix']">
7785
+ <xsl:call-template name="setNamedDestination"/>
7632
7786
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
7633
7787
  <xsl:apply-templates select="*[local-name()='title']"/>
7634
7788
  </fo:block>
@@ -7639,13 +7793,14 @@
7639
7793
  <xsl:variable name="level">
7640
7794
  <xsl:call-template name="getLevel"/>
7641
7795
  </xsl:variable>
7642
- <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
7796
+ <fo:inline role="H{$level}"><xsl:call-template name="setIDforNamedDestination"/><xsl:apply-templates/></fo:inline>
7643
7797
  </xsl:template>
7644
7798
  <!-- ======================== -->
7645
7799
  <!-- END Appendix processing -->
7646
7800
  <!-- ======================== -->
7647
7801
 
7648
7802
  <xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
7803
+ <xsl:call-template name="setNamedDestination"/>
7649
7804
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
7650
7805
  <xsl:apply-templates select="*[local-name()='name']"/>
7651
7806
  </fo:block>
@@ -7675,6 +7830,7 @@
7675
7830
  <xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
7676
7831
  <xsl:param name="callout"/>
7677
7832
  <fo:inline id="{@id}">
7833
+ <xsl:call-template name="setNamedDestination"/>
7678
7834
  <!-- for first p in annotation, put <x> -->
7679
7835
  <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
7680
7836
  <xsl:apply-templates/>
@@ -7721,6 +7877,7 @@
7721
7877
 
7722
7878
  </xsl:if>
7723
7879
  <fo:block-container margin-left="0mm" role="SKIP">
7880
+ <xsl:call-template name="setNamedDestination"/>
7724
7881
  <fo:block id="{@id}">
7725
7882
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
7726
7883
  </fo:block>
@@ -7766,8 +7923,13 @@
7766
7923
  </fo:block>
7767
7924
  </fo:table-cell>
7768
7925
  <fo:table-cell display-align="center">
7926
+
7769
7927
  <fo:block xsl:use-attribute-sets="formula-stem-number-style" role="SKIP">
7770
7928
 
7929
+ <xsl:for-each select="../*[local-name() = 'name']">
7930
+ <xsl:call-template name="setIDforNamedDestination"/>
7931
+ </xsl:for-each>
7932
+
7771
7933
  <xsl:call-template name="refine_formula-stem-number-style"/>
7772
7934
 
7773
7935
  <xsl:apply-templates select="../*[local-name() = 'name']"/>
@@ -7802,6 +7964,8 @@
7802
7964
 
7803
7965
  <xsl:template match="*[local-name() = 'note']" name="note">
7804
7966
 
7967
+ <xsl:call-template name="setNamedDestination"/>
7968
+
7805
7969
  <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
7806
7970
 
7807
7971
  <xsl:call-template name="setBlockSpanAll"/>
@@ -7866,6 +8030,7 @@
7866
8030
  </xsl:template>
7867
8031
 
7868
8032
  <xsl:template match="*[local-name() = 'termnote']">
8033
+ <xsl:call-template name="setNamedDestination"/>
7869
8034
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
7870
8035
 
7871
8036
  <xsl:call-template name="setBlockSpanAll"/>
@@ -7972,12 +8137,14 @@
7972
8137
 
7973
8138
  <xsl:template match="*[local-name() = 'terms']">
7974
8139
  <!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
8140
+ <xsl:call-template name="setNamedDestination"/>
7975
8141
  <fo:block id="{@id}">
7976
8142
  <xsl:apply-templates/>
7977
8143
  </fo:block>
7978
8144
  </xsl:template>
7979
8145
 
7980
8146
  <xsl:template match="*[local-name() = 'term']">
8147
+ <xsl:call-template name="setNamedDestination"/>
7981
8148
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
7982
8149
 
7983
8150
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
@@ -8009,6 +8176,7 @@
8009
8176
  <xsl:template match="*[local-name() = 'figure']" name="figure">
8010
8177
  <xsl:variable name="isAdded" select="@added"/>
8011
8178
  <xsl:variable name="isDeleted" select="@deleted"/>
8179
+ <xsl:call-template name="setNamedDestination"/>
8012
8180
  <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
8013
8181
  <xsl:call-template name="refine_figure-block-style"/>
8014
8182
 
@@ -8025,6 +8193,11 @@
8025
8193
  </xsl:variable>
8026
8194
 
8027
8195
  <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
8196
+
8197
+ <xsl:for-each select="*[local-name() = 'name']"> <!-- set context -->
8198
+ <xsl:call-template name="setIDforNamedDestination"/>
8199
+ </xsl:for-each>
8200
+
8028
8201
  <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
8029
8202
  </fo:block>
8030
8203
 
@@ -8057,6 +8230,7 @@
8057
8230
  </xsl:template>
8058
8231
 
8059
8232
  <xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
8233
+ <xsl:call-template name="setNamedDestination"/>
8060
8234
  <fo:block id="{@id}">
8061
8235
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
8062
8236
  </fo:block>
@@ -8070,6 +8244,7 @@
8070
8244
  </xsl:template>
8071
8245
 
8072
8246
  <!-- SOURCE: ... -->
8247
+ <!-- figure/source -->
8073
8248
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'source']" priority="2">
8074
8249
 
8075
8250
  <xsl:call-template name="termsource"/>
@@ -8995,6 +9170,13 @@
8995
9170
  <xsl:apply-templates select="."/>
8996
9171
  </xsl:template>
8997
9172
 
9173
+ <!-- prevent missing stem for table and figures in ToC -->
9174
+ <xsl:template match="*[local-name() = 'name' or local-name() = 'fmt-name']//*[local-name() = 'stem']" mode="contents">
9175
+ <xsl:if test="not(following-sibling::*[1][local-name() = 'fmt-stem'])">
9176
+ <xsl:apply-templates select="."/>
9177
+ </xsl:if>
9178
+ </xsl:template>
9179
+
8998
9180
  <xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/>
8999
9181
 
9000
9182
  <xsl:template match="*[local-name() = 'references']/*[local-name() = 'bibitem']" mode="contents"/>
@@ -9218,7 +9400,8 @@
9218
9400
 
9219
9401
  <xsl:for-each select="$contents_nodes//tables/table">
9220
9402
  <fo:bookmark internal-destination="{@id}">
9221
- <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title>
9403
+ <!-- <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title> -->
9404
+ <fo:bookmark-title><xsl:apply-templates mode="bookmark_clean"/></fo:bookmark-title>
9222
9405
  </fo:bookmark>
9223
9406
  </xsl:for-each>
9224
9407
  </fo:bookmark>
@@ -9227,6 +9410,26 @@
9227
9410
  </xsl:template> <!-- insertTableBookmarks -->
9228
9411
  <!-- End Bookmarks -->
9229
9412
 
9413
+ <!-- ============================ -->
9414
+ <!-- mode="bookmark_clean" -->
9415
+ <!-- ============================ -->
9416
+ <xsl:template match="node()" mode="bookmark_clean">
9417
+ <xsl:apply-templates select="node()" mode="bookmark_clean"/>
9418
+ </xsl:template>
9419
+
9420
+ <xsl:template match="text()" mode="bookmark_clean">
9421
+ <xsl:value-of select="."/>
9422
+ </xsl:template>
9423
+
9424
+ <xsl:template match="*[local-name() = 'math']" mode="bookmark_clean">
9425
+ <xsl:value-of select="normalize-space(.)"/>
9426
+ </xsl:template>
9427
+
9428
+ <xsl:template match="*[local-name() = 'asciimath']" mode="bookmark_clean"/>
9429
+ <!-- ============================ -->
9430
+ <!-- END: mode="bookmark_clean" -->
9431
+ <!-- ============================ -->
9432
+
9230
9433
  <xsl:template name="getLangVersion">
9231
9434
  <xsl:param name="lang"/>
9232
9435
  <xsl:param name="doctype" select="''"/>
@@ -9274,6 +9477,7 @@
9274
9477
  <xsl:template match="title" mode="bookmark"/>
9275
9478
  <xsl:template match="text()" mode="bookmark"/>
9276
9479
 
9480
+ <!-- figure/name -->
9277
9481
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']">
9278
9482
  <xsl:if test="normalize-space() != ''">
9279
9483
  <fo:block xsl:use-attribute-sets="figure-name-style">
@@ -9989,6 +10193,7 @@
9989
10193
  <!-- permission -->
9990
10194
  <!-- ========== -->
9991
10195
  <xsl:template match="*[local-name() = 'permission']">
10196
+ <xsl:call-template name="setNamedDestination"/>
9992
10197
  <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
9993
10198
  <xsl:apply-templates select="*[local-name()='name']"/>
9994
10199
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
@@ -9997,10 +10202,11 @@
9997
10202
 
9998
10203
  <xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']">
9999
10204
  <xsl:if test="normalize-space() != ''">
10000
- <fo:block xsl:use-attribute-sets="permission-name-style">
10001
- <xsl:apply-templates/>
10002
10205
 
10003
- </fo:block>
10206
+ <fo:inline xsl:use-attribute-sets="permission-name-style">
10207
+ <xsl:apply-templates/><xsl:text>:</xsl:text>
10208
+ </fo:inline>
10209
+
10004
10210
  </xsl:if>
10005
10211
  </xsl:template>
10006
10212
 
@@ -10016,6 +10222,7 @@
10016
10222
  <!-- requirement -->
10017
10223
  <!-- ========== -->
10018
10224
  <xsl:template match="*[local-name() = 'requirement']">
10225
+ <xsl:call-template name="setNamedDestination"/>
10019
10226
  <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
10020
10227
  <xsl:apply-templates select="*[local-name()='name']"/>
10021
10228
  <xsl:apply-templates select="*[local-name()='label']"/>
@@ -10027,11 +10234,11 @@
10027
10234
 
10028
10235
  <xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']">
10029
10236
  <xsl:if test="normalize-space() != ''">
10030
- <fo:block xsl:use-attribute-sets="requirement-name-style">
10031
10237
 
10032
- <xsl:apply-templates/>
10238
+ <fo:inline xsl:use-attribute-sets="requirement-name-style">
10239
+ <xsl:apply-templates/><xsl:text>:</xsl:text>
10240
+ </fo:inline>
10033
10241
 
10034
- </fo:block>
10035
10242
  </xsl:if>
10036
10243
  </xsl:template>
10037
10244
 
@@ -10060,6 +10267,7 @@
10060
10267
  <!-- recommendation -->
10061
10268
  <!-- ========== -->
10062
10269
  <xsl:template match="*[local-name() = 'recommendation']">
10270
+ <xsl:call-template name="setNamedDestination"/>
10063
10271
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
10064
10272
  <xsl:apply-templates select="*[local-name()='name']"/>
10065
10273
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
@@ -10068,10 +10276,11 @@
10068
10276
 
10069
10277
  <xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']">
10070
10278
  <xsl:if test="normalize-space() != ''">
10071
- <fo:block xsl:use-attribute-sets="recommendation-name-style">
10072
- <xsl:apply-templates/>
10073
10279
 
10074
- </fo:block>
10280
+ <fo:inline xsl:use-attribute-sets="recommendation-name-style">
10281
+ <xsl:apply-templates/><xsl:text>:</xsl:text>
10282
+ </fo:inline>
10283
+
10075
10284
  </xsl:if>
10076
10285
  </xsl:template>
10077
10286
 
@@ -10150,6 +10359,7 @@
10150
10359
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
10151
10360
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
10152
10361
  </xsl:if>
10362
+ <xsl:call-template name="setNamedDestination"/>
10153
10363
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
10154
10364
  <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
10155
10365
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
@@ -10259,6 +10469,7 @@
10259
10469
  <!-- termexample -->
10260
10470
  <!-- ====== -->
10261
10471
  <xsl:template match="*[local-name() = 'termexample']">
10472
+ <xsl:call-template name="setNamedDestination"/>
10262
10473
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
10263
10474
  <xsl:call-template name="refine_termexample-style"/>
10264
10475
  <xsl:call-template name="setBlockSpanAll"/>
@@ -10313,6 +10524,7 @@
10313
10524
  -->
10314
10525
  <xsl:template match="*[local-name() = 'example']" name="example">
10315
10526
 
10527
+ <xsl:call-template name="setNamedDestination"/>
10316
10528
  <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
10317
10529
 
10318
10530
  <xsl:call-template name="setBlockSpanAll"/>
@@ -10833,8 +11045,13 @@
10833
11045
  <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
10834
11046
 
10835
11047
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
11048
+
10836
11049
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
10837
11050
 
11051
+ <xsl:for-each select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"><!-- change context -->
11052
+ <xsl:call-template name="setIDforNamedDestination"/>
11053
+ </xsl:for-each>
11054
+
10838
11055
  <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
10839
11056
  </fo:block>
10840
11057
  </xsl:if>
@@ -10954,6 +11171,7 @@
10954
11171
  <!-- main sections -->
10955
11172
  <xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
10956
11173
 
11174
+ <xsl:call-template name="setNamedDestination"/>
10957
11175
  <fo:block>
10958
11176
  <xsl:call-template name="setId"/>
10959
11177
 
@@ -10994,6 +11212,7 @@
10994
11212
 
10995
11213
  <fo:block break-after="page"/>
10996
11214
 
11215
+ <xsl:call-template name="setNamedDestination"/>
10997
11216
  <fo:block>
10998
11217
  <xsl:call-template name="setId"/>
10999
11218
  <xsl:call-template name="addReviewHelper"/>
@@ -11022,6 +11241,7 @@
11022
11241
  </xsl:template>
11023
11242
 
11024
11243
  <xsl:template match="*[local-name() = 'clause'][normalize-space() != '' or *[local-name() = 'figure'] or @id]" name="template_clause"> <!-- if clause isn't empty -->
11244
+ <xsl:call-template name="setNamedDestination"/>
11025
11245
  <fo:block>
11026
11246
  <xsl:if test="parent::*[local-name() = 'copyright-statement']">
11027
11247
  <xsl:attribute name="role">SKIP</xsl:attribute>
@@ -11044,6 +11264,7 @@
11044
11264
  </xsl:template> <!-- refine_clause_style -->
11045
11265
 
11046
11266
  <xsl:template match="*[local-name() = 'definitions']">
11267
+ <xsl:call-template name="setNamedDestination"/>
11047
11268
  <fo:block id="{@id}">
11048
11269
  <xsl:apply-templates/>
11049
11270
  </fo:block>
@@ -11059,6 +11280,8 @@
11059
11280
  <xsl:otherwise>
11060
11281
 
11061
11282
  <fo:block break-after="page"/>
11283
+ <xsl:call-template name="setNamedDestination"/>
11284
+
11062
11285
  <fo:block id="{@id}">
11063
11286
 
11064
11287
  <xsl:call-template name="setBlockSpanAll"/>
@@ -11130,6 +11353,7 @@
11130
11353
  <!-- following-sibling::node()[1][local-name() = 'bookmark'][@id = $source] and
11131
11354
  following-sibling::node()[2][local-name() = 'fmt-review-end'][@source = $source] -->
11132
11355
  <!-- <fo:block id="{$source}" font-size="1pt" role="SKIP"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{$source}" fox:alt-text="Annot___{$source}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block> -->
11356
+ <xsl:call-template name="setNamedDestination"/>
11133
11357
  <fo:block id="{@id}" font-size="1pt" role="SKIP" keep-with-next="always" line-height="0.1"><xsl:value-of select="$hair_space"/><fo:basic-link internal-destination="{@id}" fox:alt-text="Annot___{@id}" role="Annot"><xsl:value-of select="$hair_space"/></fo:basic-link></fo:block>
11134
11358
  <!-- </xsl:if> -->
11135
11359
  </xsl:if>
@@ -11232,9 +11456,15 @@
11232
11456
  <xsl:when test="local-name(..) = 'ul'">
11233
11457
  <xsl:choose>
11234
11458
  <xsl:when test="normalize-space($processing_instruction_type) = 'simple'"/>
11459
+ <!-- https://github.com/metanorma/isodoc/issues/675 -->
11460
+ <xsl:when test="@label"><xsl:value-of select="@label"/></xsl:when>
11235
11461
  <xsl:otherwise><xsl:call-template name="setULLabel"/></xsl:otherwise>
11236
11462
  </xsl:choose>
11237
11463
  </xsl:when>
11464
+ <!-- https://github.com/metanorma/isodoc/issues/675 -->
11465
+ <xsl:when test="local-name(..) = 'ol' and @label and @full = 'true'"> <!-- @full added in the template li/fmt-name -->
11466
+ <xsl:value-of select="@label"/>
11467
+ </xsl:when>
11238
11468
  <xsl:when test="local-name(..) = 'ol' and @label"> <!-- for ordered lists 'ol', and if there is @label, for instance label="1.1.2" -->
11239
11469
 
11240
11470
  <xsl:variable name="type" select="../@type"/>
@@ -11359,7 +11589,7 @@
11359
11589
 
11360
11590
  </xsl:otherwise>
11361
11591
  </xsl:choose>
11362
- </xsl:template>
11592
+ </xsl:template> <!-- getListItemFormat -->
11363
11593
 
11364
11594
  <xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
11365
11595
  <xsl:param name="indent">0</xsl:param>
@@ -11491,6 +11721,11 @@
11491
11721
 
11492
11722
  <xsl:call-template name="refine_list-item-label-style"/>
11493
11723
 
11724
+ <xsl:if test="local-name(..) = 'ul'">
11725
+ <xsl:variable name="li_label" select="@label"/>
11726
+ <xsl:copy-of select="$ul_labels//label[. = $li_label]/@*[not(local-name() = 'level')]"/>
11727
+ </xsl:if>
11728
+
11494
11729
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
11495
11730
  <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
11496
11731
  <xsl:call-template name="append_add-style"/>
@@ -11837,6 +12072,7 @@
11837
12072
  <!-- Normative references -->
11838
12073
  <xsl:template match="*[local-name() = 'references'][@normative='true']" priority="2">
11839
12074
 
12075
+ <xsl:call-template name="setNamedDestination"/>
11840
12076
  <fo:block id="{@id}">
11841
12077
  <xsl:apply-templates/>
11842
12078
 
@@ -11855,6 +12091,7 @@
11855
12091
  </xsl:if>
11856
12092
  </xsl:if> -->
11857
12093
 
12094
+ <xsl:call-template name="setNamedDestination"/>
11858
12095
  <fo:block id="{@id}"/>
11859
12096
 
11860
12097
  <xsl:apply-templates select="*[local-name() = 'title'][@columns = 1]"/>
@@ -11874,6 +12111,7 @@
11874
12111
  <xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2">
11875
12112
  <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
11876
12113
 
12114
+ <xsl:call-template name="setNamedDestination"/>
11877
12115
  <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-normative-list-style">
11878
12116
 
11879
12117
  <xsl:variable name="docidentifier">
@@ -11923,6 +12161,7 @@
11923
12161
  <xsl:choose>
11924
12162
  <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
11925
12163
  <xsl:otherwise>
12164
+ <xsl:call-template name="setNamedDestination"/>
11926
12165
  <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
11927
12166
 
11928
12167
  <fo:list-item-label end-indent="label-end()">
@@ -12317,6 +12556,7 @@
12317
12556
  <xsl:template match="*[local-name() = 'admonition']">
12318
12557
 
12319
12558
  <!-- text in the box -->
12559
+ <xsl:call-template name="setNamedDestination"/>
12320
12560
  <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
12321
12561
 
12322
12562
  <xsl:call-template name="setBlockSpanAll"/>
@@ -12570,7 +12810,7 @@
12570
12810
  </xsl:template>
12571
12811
 
12572
12812
  <!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
12573
- <xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear' or @class = 'horizontal' or @class = 'norotate' or @class = 'halffontsize']" mode="update_xml_step1" priority="2">
12813
+ <xsl:template match="*[local-name() = 'span'][@style or @class = 'stdpublisher' or @class = 'stddocNumber' or @class = 'stddocPartNumber' or @class = 'stdyear' or @class = 'fmt-hi' or @class = 'horizontal' or @class = 'norotate' or @class = 'halffontsize']" mode="update_xml_step1" priority="2">
12574
12814
  <xsl:copy>
12575
12815
  <xsl:copy-of select="@*"/>
12576
12816
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -12602,28 +12842,56 @@
12602
12842
  <xsl:template match="*[local-name() = 'stem']" mode="update_xml_step1"/>
12603
12843
  <xsl:template match="*[local-name() = 'stem']" mode="update_xml_pres"/>
12604
12844
 
12605
- <xsl:template match="*[local-name() = 'fmt-stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])]" mode="update_xml_step1">
12845
+ <xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_step1">
12606
12846
  <xsl:element name="stem" namespace="{$namespace_full}">
12607
12847
  <xsl:copy-of select="@*"/>
12608
12848
  <xsl:choose>
12609
12849
  <xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
12610
- <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
12850
+ <xsl:choose>
12851
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
12852
+ <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
12853
+ </xsl:when>
12854
+ <xsl:otherwise>
12855
+ <xsl:apply-templates select="*[local-name() = 'semx']/node()" mode="update_xml_step1"/>
12856
+ </xsl:otherwise>
12857
+ </xsl:choose>
12611
12858
  </xsl:when>
12612
12859
  <xsl:otherwise>
12613
- <xsl:copy-of select="node()"/>
12860
+ <xsl:choose>
12861
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
12862
+ <xsl:copy-of select="node()"/>
12863
+ </xsl:when>
12864
+ <xsl:otherwise>
12865
+ <xsl:apply-templates select="node()" mode="update_xml_step1"/>
12866
+ </xsl:otherwise>
12867
+ </xsl:choose>
12614
12868
  </xsl:otherwise>
12615
12869
  </xsl:choose>
12616
12870
  </xsl:element>
12617
12871
  </xsl:template>
12618
- <xsl:template match="*[local-name() = 'fmt-stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])]" mode="update_xml_pres">
12872
+ <xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_pres">
12619
12873
  <xsl:element name="stem" namespace="{$namespace_full}">
12620
12874
  <xsl:copy-of select="@*"/>
12621
12875
  <xsl:choose>
12622
12876
  <xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
12623
- <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
12877
+ <xsl:choose>
12878
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
12879
+ <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
12880
+ </xsl:when>
12881
+ <xsl:otherwise>
12882
+ <xsl:apply-templates select="*[local-name() = 'semx']/node()" mode="update_xml_pres"/>
12883
+ </xsl:otherwise>
12884
+ </xsl:choose>
12624
12885
  </xsl:when>
12625
12886
  <xsl:otherwise>
12626
- <xsl:copy-of select="node()"/>
12887
+ <xsl:choose>
12888
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
12889
+ <xsl:copy-of select="node()"/>
12890
+ </xsl:when>
12891
+ <xsl:otherwise>
12892
+ <xsl:apply-templates select="node()" mode="update_xml_pres"/>
12893
+ </xsl:otherwise>
12894
+ </xsl:choose>
12627
12895
  </xsl:otherwise>
12628
12896
  </xsl:choose>
12629
12897
  </xsl:element>
@@ -12852,16 +13120,24 @@
12852
13120
  <xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_step1">
12853
13121
  <xsl:element name="title" namespace="{$namespace_full}">
12854
13122
  <xsl:copy-of select="@*"/>
13123
+ <xsl:call-template name="addNamedDestinationAttribute"/>
13124
+
12855
13125
  <xsl:apply-templates mode="update_xml_step1"/>
12856
13126
  </xsl:element>
12857
13127
  </xsl:template>
12858
13128
  <xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_pres">
12859
13129
  <xsl:element name="title" namespace="{$namespace_full}">
12860
13130
  <xsl:copy-of select="@*"/>
13131
+ <xsl:call-template name="addNamedDestinationAttribute"/>
13132
+
12861
13133
  <xsl:apply-templates mode="update_xml_pres"/>
12862
13134
  </xsl:element>
12863
13135
  </xsl:template>
12864
13136
 
13137
+ <xsl:template name="addNamedDestinationAttribute">
13138
+
13139
+ </xsl:template>
13140
+
12865
13141
  <xsl:template match="*[local-name() = 'fmt-name']"/>
12866
13142
  <xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_step1">
12867
13143
  <xsl:choose>
@@ -12871,6 +13147,8 @@
12871
13147
  <xsl:otherwise>
12872
13148
  <xsl:element name="name" namespace="{$namespace_full}">
12873
13149
  <xsl:copy-of select="@*"/>
13150
+ <xsl:call-template name="addNamedDestinationAttribute"/>
13151
+
12874
13152
  <xsl:apply-templates mode="update_xml_step1"/>
12875
13153
  </xsl:element>
12876
13154
  </xsl:otherwise>
@@ -12884,12 +13162,24 @@
12884
13162
  <xsl:otherwise>
12885
13163
  <xsl:element name="name" namespace="{$namespace_full}">
12886
13164
  <xsl:copy-of select="@*"/>
13165
+ <xsl:call-template name="addNamedDestinationAttribute"/>
13166
+
12887
13167
  <xsl:apply-templates mode="update_xml_pres"/>
12888
13168
  </xsl:element>
12889
13169
  </xsl:otherwise>
12890
13170
  </xsl:choose>
12891
13171
  </xsl:template>
12892
13172
 
13173
+ <!-- li/fmt-name -->
13174
+ <xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_step1">
13175
+ <xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
13176
+ <xsl:attribute name="full">true</xsl:attribute>
13177
+ </xsl:template>
13178
+ <xsl:template match="*[local-name() = 'li']/*[local-name() = 'fmt-name']" priority="2" mode="update_xml_pres">
13179
+ <xsl:attribute name="label"><xsl:value-of select="."/></xsl:attribute>
13180
+ <xsl:attribute name="full">true</xsl:attribute>
13181
+ </xsl:template>
13182
+
12893
13183
  <xsl:template match="*[local-name() = 'fmt-preferred']"/>
12894
13184
  <xsl:template match="*[local-name() = 'fmt-preferred'][*[local-name() = 'p']]" mode="update_xml_step1">
12895
13185
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -13704,6 +13994,64 @@
13704
13994
  <fo:inline xml:lang="none"><xsl:value-of select="."/></fo:inline>
13705
13995
  </xsl:template>
13706
13996
 
13997
+ <!-- ===================================== -->
13998
+ <!-- ===================================== -->
13999
+ <!-- Ruby text (CJK languages) rendering -->
14000
+ <!-- ===================================== -->
14001
+ <!-- ===================================== -->
14002
+ <xsl:template match="*[local-name() = 'ruby']">
14003
+ <fo:inline-container text-indent="0mm" last-line-end-indent="0mm">
14004
+ <xsl:if test="not(ancestor::*[local-name() = 'ruby'])">
14005
+ <xsl:attribute name="alignment-baseline">central</xsl:attribute>
14006
+ </xsl:if>
14007
+ <xsl:variable name="rt_text" select="*[local-name() = 'rt']"/>
14008
+ <xsl:variable name="rb_text" select=".//*[local-name() = 'rb'][not(*[local-name() = 'ruby'])]"/>
14009
+ <!-- Example: width="2em" -->
14010
+ <xsl:variable name="text_rt_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rt_text, $font_main, 6)"/>
14011
+ <xsl:variable name="text_rb_width" select="java:org.metanorma.fop.Util.getStringWidthByFontSize($rb_text, $font_main, 10)"/>
14012
+ <xsl:variable name="text_width">
14013
+ <xsl:choose>
14014
+ <xsl:when test="$text_rt_width &gt;= $text_rb_width"><xsl:value-of select="$text_rt_width"/></xsl:when>
14015
+ <xsl:otherwise><xsl:value-of select="$text_rb_width"/></xsl:otherwise>
14016
+ </xsl:choose>
14017
+ </xsl:variable>
14018
+ <xsl:attribute name="width"><xsl:value-of select="$text_width div 10"/>em</xsl:attribute>
14019
+
14020
+ <xsl:choose>
14021
+ <xsl:when test="ancestor::*[local-name() = 'ruby']">
14022
+ <xsl:apply-templates select="*[local-name() = 'rb']"/>
14023
+ <xsl:apply-templates select="*[local-name() = 'rt']"/>
14024
+ </xsl:when>
14025
+ <xsl:otherwise>
14026
+ <xsl:apply-templates select="*[local-name() = 'rt']"/>
14027
+ <xsl:apply-templates select="*[local-name() = 'rb']"/>
14028
+ </xsl:otherwise>
14029
+ </xsl:choose>
14030
+
14031
+ <xsl:apply-templates select="node()[not(local-name() = 'rt') and not(local-name() = 'rb')]"/>
14032
+ </fo:inline-container>
14033
+ </xsl:template>
14034
+
14035
+ <xsl:template match="*[local-name() = 'rb']">
14036
+ <fo:block line-height="1em" text-align="center"><xsl:apply-templates/></fo:block>
14037
+ </xsl:template>
14038
+
14039
+ <xsl:template match="*[local-name() = 'rt']">
14040
+ <fo:block font-size="0.5em" text-align="center" line-height="1.2em" space-before="-1.4em" space-before.conditionality="retain"> <!-- -->
14041
+ <xsl:if test="ancestor::*[local-name() = 'ruby'][last()]//*[local-name() = 'ruby'] or ancestor::*[local-name() = 'rb']">
14042
+ <xsl:attribute name="space-before">0em</xsl:attribute>
14043
+ </xsl:if>
14044
+ <xsl:apply-templates/>
14045
+ </fo:block>
14046
+
14047
+ </xsl:template>
14048
+
14049
+ <!-- ===================================== -->
14050
+ <!-- ===================================== -->
14051
+ <!-- END: Ruby text (CJK languages) rendering -->
14052
+ <!-- ===================================== -->
14053
+ <!-- ===================================== -->
14054
+
13707
14055
  <xsl:template name="printEdition">
13708
14056
  <xsl:variable name="edition_i18n" select="normalize-space((//*[local-name() = 'metanorma'])[1]/*[local-name() = 'bibdata']/*[local-name() = 'edition'][normalize-space(@language) != ''])"/>
13709
14057
 
@@ -14273,6 +14621,24 @@
14273
14621
  </xsl:attribute>
14274
14622
  </xsl:template>
14275
14623
 
14624
+ <xsl:template name="setIDforNamedDestination">
14625
+ <xsl:if test="@named_dest">
14626
+ <xsl:attribute name="id"><xsl:value-of select="@named_dest"/></xsl:attribute>
14627
+ </xsl:if>
14628
+ </xsl:template>
14629
+
14630
+ <xsl:template name="setNamedDestination">
14631
+ <!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
14632
+ <xsl:if test="@id and normalize-space(java:matches(java:java.lang.String.new(@id), '_[0-9a-z]{8}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{4}-[0-9a-z]{12}')) = 'false'">
14633
+ <fox:destination internal-destination="{@id}"/>
14634
+ </xsl:if>
14635
+ <xsl:for-each select=". | *[local-name() = 'title'] | *[local-name() = 'name']">
14636
+ <xsl:if test="@named_dest">
14637
+ <fox:destination internal-destination="{@named_dest}"/>
14638
+ </xsl:if>
14639
+ </xsl:for-each>
14640
+ </xsl:template>
14641
+
14276
14642
  <xsl:template name="add-letter-spacing">
14277
14643
  <xsl:param name="text"/>
14278
14644
  <xsl:param name="letter-spacing" select="'0.15'"/>