metanorma-bipm 2.6.5 → 2.6.6

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: d7b240a5a5ff3e5b523aa69403d7588620dcb73d36583e383c4bbfc38d72b406
4
- data.tar.gz: 02fea96bd1bb67a2eb7fb2952f5ae2647c371f3faa38aedcfd9408d044003c69
3
+ metadata.gz: 4224fd72883c8da722dc4e9e46bd4a5b18fecee5a2c6d790b2ad41a783b8b7cb
4
+ data.tar.gz: c6e7dd239b9907ead50a6ca765842c24b8d59d3318edee0a52ccdaa924f9dcdb
5
5
  SHA512:
6
- metadata.gz: 0b9bfb0e2481510449e8647fa1aba5305b7393298d5fc410323833d226a4ed088601d718c334281972112ffd5536efc900a247fb6e9f464f04ca1fc7089a78ab
7
- data.tar.gz: e8981164539c83278fe4b7498b18047f95a1adf4fe5b5528e21cbd2f1d0187864bc3922403a81b04a576b1366b7a9734dce85ab62f734cbd6cd69cdb8f39221d
6
+ metadata.gz: df36cad0045876008cc3a654d0af5dc258e7d3fd1a052fa02fb108b8369b1835315d7d5e56166e4b714b92f9f083d7e9a72d209b3bc5eaaa46c056d95d495a32
7
+ data.tar.gz: '08cee48d4c976497cc5608f559c55a8a1fe8b85ba94f9a58add7d3b01194d03efc00d1dfe217b700d6389db7eaeeefbe714e7d92f148df7f626828c758f9da95'
@@ -6377,8 +6377,14 @@
6377
6377
  </xsl:choose>
6378
6378
  </xsl:variable>
6379
6379
 
6380
+ <xsl:call-template name="setNamedDestination"/>
6381
+
6380
6382
  <fo:block-container xsl:use-attribute-sets="table-container-style" role="SKIP">
6381
6383
 
6384
+ <xsl:for-each select="*[local-name() = 'name']">
6385
+ <xsl:call-template name="setIDforNamedDestination"/>
6386
+ </xsl:for-each>
6387
+
6382
6388
  <xsl:call-template name="refine_table-container-style">
6383
6389
  <xsl:with-param name="margin-side" select="$margin-side"/>
6384
6390
  </xsl:call-template>
@@ -6585,6 +6591,7 @@
6585
6591
  <!-- table/name-->
6586
6592
  <xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
6587
6593
  <xsl:param name="continued"/>
6594
+ <xsl:param name="cols-count"/>
6588
6595
  <xsl:if test="normalize-space() != ''">
6589
6596
 
6590
6597
  <fo:list-block xsl:use-attribute-sets="table-name-style">
@@ -7009,6 +7016,7 @@
7009
7016
 
7010
7017
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
7011
7018
  <xsl:with-param name="continued">true</xsl:with-param>
7019
+ <xsl:with-param name="cols-count" select="$cols-count"/>
7012
7020
  </xsl:apply-templates>
7013
7021
 
7014
7022
  <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='name'])"> <!-- to prevent empty fo:table-cell in case of missing table's name -->
@@ -7407,8 +7415,8 @@
7407
7415
  <xsl:for-each select="xalan:nodeset($styles__)/item">
7408
7416
  <xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
7409
7417
  <xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
7410
- <xsl:if test="$key = 'color' or $key = 'background-color'">
7411
- <style name="{$key}"><xsl:value-of select="$value"/></style>
7418
+ <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'">
7419
+ <style name="{$key}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($value), 'currentColor', 'inherit')"/></style>
7412
7420
  </xsl:if>
7413
7421
  </xsl:for-each>
7414
7422
  </xsl:variable>
@@ -7481,6 +7489,7 @@
7481
7489
  <!-- table/note, table/example, table/tfoot//note, table/tfoot//example -->
7482
7490
  <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">
7483
7491
 
7492
+ <xsl:call-template name="setNamedDestination"/>
7484
7493
  <fo:block xsl:use-attribute-sets="table-note-style">
7485
7494
  <xsl:copy-of select="@id"/>
7486
7495
 
@@ -8012,7 +8021,7 @@
8012
8021
  <xsl:variable name="target" select="@target"/>
8013
8022
  <xsl:choose>
8014
8023
  <!-- case for footnotes in Requirement tables (https://github.com/metanorma/metanorma-ogc/issues/791) -->
8015
- <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]">
8024
+ <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]">
8016
8025
  <xsl:call-template name="fn">
8017
8026
  <xsl:with-param name="footnote_body_from_table">true</xsl:with-param>
8018
8027
  </xsl:call-template>
@@ -8111,6 +8120,10 @@
8111
8120
  <!-- <dl><xsl:copy-of select="."/></dl> -->
8112
8121
  <fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
8113
8122
 
8123
+ <xsl:if test="@key = 'true' and ancestor::*[local-name() = 'figure']">
8124
+ <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
8125
+ </xsl:if>
8126
+
8114
8127
  <xsl:call-template name="setBlockSpanAll"/>
8115
8128
 
8116
8129
  <xsl:if test="not(ancestor::*[local-name() = 'li'])">
@@ -8405,7 +8418,7 @@
8405
8418
 
8406
8419
  <!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
8407
8420
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
8408
- <fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
8421
+ <fo:block text-align="left" margin-bottom="12pt" keep-with-next="always" keep-with-previous="always">
8409
8422
  <xsl:call-template name="refine_figure_key_style"/>
8410
8423
  <xsl:apply-templates/>
8411
8424
  </fo:block>
@@ -8656,6 +8669,7 @@
8656
8669
 
8657
8670
  <xsl:call-template name="refine_dt-cell-style"/>
8658
8671
 
8672
+ <xsl:call-template name="setNamedDestination"/>
8659
8673
  <fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
8660
8674
 
8661
8675
  <xsl:choose>
@@ -9090,7 +9104,7 @@
9090
9104
  <!-- ================= -->
9091
9105
 
9092
9106
  <!-- highlight text -->
9093
- <xsl:template match="*[local-name()='hi']">
9107
+ <xsl:template match="*[local-name()='hi'] | *[local-name() = 'span'][@class = 'fmt-hi']" priority="3">
9094
9108
  <fo:inline background-color="yellow">
9095
9109
  <xsl:apply-templates/>
9096
9110
  </fo:inline>
@@ -10717,6 +10731,7 @@
10717
10731
  <!-- Appendix processing -->
10718
10732
  <!-- ======================== -->
10719
10733
  <xsl:template match="*[local-name()='appendix']">
10734
+ <xsl:call-template name="setNamedDestination"/>
10720
10735
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
10721
10736
  <xsl:apply-templates select="*[local-name()='title']"/>
10722
10737
  </fo:block>
@@ -10727,13 +10742,14 @@
10727
10742
  <xsl:variable name="level">
10728
10743
  <xsl:call-template name="getLevel"/>
10729
10744
  </xsl:variable>
10730
- <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
10745
+ <fo:inline role="H{$level}"><xsl:call-template name="setIDforNamedDestination"/><xsl:apply-templates/></fo:inline>
10731
10746
  </xsl:template>
10732
10747
  <!-- ======================== -->
10733
10748
  <!-- END Appendix processing -->
10734
10749
  <!-- ======================== -->
10735
10750
 
10736
10751
  <xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
10752
+ <xsl:call-template name="setNamedDestination"/>
10737
10753
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
10738
10754
  <xsl:apply-templates select="*[local-name()='name']"/>
10739
10755
  </fo:block>
@@ -10763,6 +10779,7 @@
10763
10779
  <xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
10764
10780
  <xsl:param name="callout"/>
10765
10781
  <fo:inline id="{@id}">
10782
+ <xsl:call-template name="setNamedDestination"/>
10766
10783
  <!-- for first p in annotation, put <x> -->
10767
10784
  <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
10768
10785
  <xsl:apply-templates/>
@@ -10809,6 +10826,7 @@
10809
10826
 
10810
10827
  </xsl:if>
10811
10828
  <fo:block-container margin-left="0mm" role="SKIP">
10829
+ <xsl:call-template name="setNamedDestination"/>
10812
10830
  <fo:block id="{@id}">
10813
10831
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
10814
10832
  </fo:block>
@@ -10854,8 +10872,13 @@
10854
10872
  </fo:block>
10855
10873
  </fo:table-cell>
10856
10874
  <fo:table-cell display-align="center">
10875
+
10857
10876
  <fo:block xsl:use-attribute-sets="formula-stem-number-style" role="SKIP">
10858
10877
 
10878
+ <xsl:for-each select="../*[local-name() = 'name']">
10879
+ <xsl:call-template name="setIDforNamedDestination"/>
10880
+ </xsl:for-each>
10881
+
10859
10882
  <xsl:call-template name="refine_formula-stem-number-style"/>
10860
10883
 
10861
10884
  <xsl:apply-templates select="../*[local-name() = 'name']"/>
@@ -10890,6 +10913,8 @@
10890
10913
 
10891
10914
  <xsl:template match="*[local-name() = 'note']" name="note">
10892
10915
 
10916
+ <xsl:call-template name="setNamedDestination"/>
10917
+
10893
10918
  <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
10894
10919
 
10895
10920
  <xsl:call-template name="setBlockSpanAll"/>
@@ -10961,6 +10986,7 @@
10961
10986
  </xsl:template>
10962
10987
 
10963
10988
  <xsl:template match="*[local-name() = 'termnote']">
10989
+ <xsl:call-template name="setNamedDestination"/>
10964
10990
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
10965
10991
 
10966
10992
  <xsl:call-template name="setBlockSpanAll"/>
@@ -11081,12 +11107,14 @@
11081
11107
 
11082
11108
  <xsl:template match="*[local-name() = 'terms']">
11083
11109
  <!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
11110
+ <xsl:call-template name="setNamedDestination"/>
11084
11111
  <fo:block id="{@id}">
11085
11112
  <xsl:apply-templates/>
11086
11113
  </fo:block>
11087
11114
  </xsl:template>
11088
11115
 
11089
11116
  <xsl:template match="*[local-name() = 'term']">
11117
+ <xsl:call-template name="setNamedDestination"/>
11090
11118
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
11091
11119
 
11092
11120
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
@@ -11118,6 +11146,7 @@
11118
11146
  <xsl:template match="*[local-name() = 'figure']" name="figure">
11119
11147
  <xsl:variable name="isAdded" select="@added"/>
11120
11148
  <xsl:variable name="isDeleted" select="@deleted"/>
11149
+ <xsl:call-template name="setNamedDestination"/>
11121
11150
  <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
11122
11151
  <xsl:call-template name="refine_figure-block-style"/>
11123
11152
 
@@ -11134,6 +11163,11 @@
11134
11163
  </xsl:variable>
11135
11164
 
11136
11165
  <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
11166
+
11167
+ <xsl:for-each select="*[local-name() = 'name']"> <!-- set context -->
11168
+ <xsl:call-template name="setIDforNamedDestination"/>
11169
+ </xsl:for-each>
11170
+
11137
11171
  <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
11138
11172
  </fo:block>
11139
11173
 
@@ -11166,6 +11200,7 @@
11166
11200
  </xsl:template>
11167
11201
 
11168
11202
  <xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
11203
+ <xsl:call-template name="setNamedDestination"/>
11169
11204
  <fo:block id="{@id}">
11170
11205
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
11171
11206
  </fo:block>
@@ -11179,6 +11214,7 @@
11179
11214
  </xsl:template>
11180
11215
 
11181
11216
  <!-- SOURCE: ... -->
11217
+ <!-- figure/source -->
11182
11218
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'source']" priority="2">
11183
11219
 
11184
11220
  <xsl:call-template name="termsource"/>
@@ -12425,6 +12461,7 @@
12425
12461
  <xsl:template match="title" mode="bookmark"/>
12426
12462
  <xsl:template match="text()" mode="bookmark"/>
12427
12463
 
12464
+ <!-- figure/name -->
12428
12465
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']">
12429
12466
  <xsl:if test="normalize-space() != ''">
12430
12467
  <fo:block xsl:use-attribute-sets="figure-name-style">
@@ -13139,6 +13176,7 @@
13139
13176
  <!-- permission -->
13140
13177
  <!-- ========== -->
13141
13178
  <xsl:template match="*[local-name() = 'permission']">
13179
+ <xsl:call-template name="setNamedDestination"/>
13142
13180
  <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
13143
13181
  <xsl:apply-templates select="*[local-name()='name']"/>
13144
13182
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
@@ -13147,10 +13185,12 @@
13147
13185
 
13148
13186
  <xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']">
13149
13187
  <xsl:if test="normalize-space() != ''">
13150
- <fo:block xsl:use-attribute-sets="permission-name-style">
13151
- <xsl:apply-templates/>
13152
13188
 
13153
- </fo:block>
13189
+ <fo:block xsl:use-attribute-sets="permission-name-style">
13190
+ <xsl:apply-templates/>
13191
+
13192
+ </fo:block>
13193
+
13154
13194
  </xsl:if>
13155
13195
  </xsl:template>
13156
13196
 
@@ -13166,6 +13206,7 @@
13166
13206
  <!-- requirement -->
13167
13207
  <!-- ========== -->
13168
13208
  <xsl:template match="*[local-name() = 'requirement']">
13209
+ <xsl:call-template name="setNamedDestination"/>
13169
13210
  <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
13170
13211
  <xsl:apply-templates select="*[local-name()='name']"/>
13171
13212
  <xsl:apply-templates select="*[local-name()='label']"/>
@@ -13177,11 +13218,13 @@
13177
13218
 
13178
13219
  <xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']">
13179
13220
  <xsl:if test="normalize-space() != ''">
13180
- <fo:block xsl:use-attribute-sets="requirement-name-style">
13181
13221
 
13182
- <xsl:apply-templates/>
13222
+ <fo:block xsl:use-attribute-sets="requirement-name-style">
13223
+
13224
+ <xsl:apply-templates/>
13225
+
13226
+ </fo:block>
13183
13227
 
13184
- </fo:block>
13185
13228
  </xsl:if>
13186
13229
  </xsl:template>
13187
13230
 
@@ -13210,6 +13253,7 @@
13210
13253
  <!-- recommendation -->
13211
13254
  <!-- ========== -->
13212
13255
  <xsl:template match="*[local-name() = 'recommendation']">
13256
+ <xsl:call-template name="setNamedDestination"/>
13213
13257
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
13214
13258
  <xsl:apply-templates select="*[local-name()='name']"/>
13215
13259
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
@@ -13218,10 +13262,12 @@
13218
13262
 
13219
13263
  <xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']">
13220
13264
  <xsl:if test="normalize-space() != ''">
13221
- <fo:block xsl:use-attribute-sets="recommendation-name-style">
13222
- <xsl:apply-templates/>
13223
13265
 
13224
- </fo:block>
13266
+ <fo:block xsl:use-attribute-sets="recommendation-name-style">
13267
+ <xsl:apply-templates/>
13268
+
13269
+ </fo:block>
13270
+
13225
13271
  </xsl:if>
13226
13272
  </xsl:template>
13227
13273
 
@@ -13300,6 +13346,7 @@
13300
13346
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
13301
13347
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
13302
13348
  </xsl:if>
13349
+ <xsl:call-template name="setNamedDestination"/>
13303
13350
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
13304
13351
  <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
13305
13352
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
@@ -13409,6 +13456,7 @@
13409
13456
  <!-- termexample -->
13410
13457
  <!-- ====== -->
13411
13458
  <xsl:template match="*[local-name() = 'termexample']">
13459
+ <xsl:call-template name="setNamedDestination"/>
13412
13460
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
13413
13461
  <xsl:call-template name="refine_termexample-style"/>
13414
13462
  <xsl:call-template name="setBlockSpanAll"/>
@@ -13463,6 +13511,7 @@
13463
13511
  -->
13464
13512
  <xsl:template match="*[local-name() = 'example']" name="example">
13465
13513
 
13514
+ <xsl:call-template name="setNamedDestination"/>
13466
13515
  <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
13467
13516
 
13468
13517
  <xsl:call-template name="setBlockSpanAll"/>
@@ -13986,8 +14035,13 @@
13986
14035
  <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
13987
14036
 
13988
14037
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
14038
+
13989
14039
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
13990
14040
 
14041
+ <xsl:for-each select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"><!-- change context -->
14042
+ <xsl:call-template name="setIDforNamedDestination"/>
14043
+ </xsl:for-each>
14044
+
13991
14045
  <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
13992
14046
  </fo:block>
13993
14047
  </xsl:if>
@@ -14107,6 +14161,7 @@
14107
14161
  <!-- main sections -->
14108
14162
  <xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
14109
14163
 
14164
+ <xsl:call-template name="setNamedDestination"/>
14110
14165
  <fo:block>
14111
14166
  <xsl:call-template name="setId"/>
14112
14167
 
@@ -14147,6 +14202,7 @@
14147
14202
 
14148
14203
  <fo:block break-after="page"/>
14149
14204
 
14205
+ <xsl:call-template name="setNamedDestination"/>
14150
14206
  <fo:block>
14151
14207
  <xsl:call-template name="setId"/>
14152
14208
  <xsl:call-template name="addReviewHelper"/>
@@ -14175,6 +14231,7 @@
14175
14231
  </xsl:template>
14176
14232
 
14177
14233
  <xsl:template match="*[local-name() = 'clause'][normalize-space() != '' or *[local-name() = 'figure'] or @id]" name="template_clause"> <!-- if clause isn't empty -->
14234
+ <xsl:call-template name="setNamedDestination"/>
14178
14235
  <fo:block>
14179
14236
  <xsl:if test="parent::*[local-name() = 'copyright-statement']">
14180
14237
  <xsl:attribute name="role">SKIP</xsl:attribute>
@@ -14199,6 +14256,7 @@
14199
14256
  </xsl:template> <!-- refine_clause_style -->
14200
14257
 
14201
14258
  <xsl:template match="*[local-name() = 'definitions']">
14259
+ <xsl:call-template name="setNamedDestination"/>
14202
14260
  <fo:block id="{@id}">
14203
14261
  <xsl:apply-templates/>
14204
14262
  </fo:block>
@@ -14214,6 +14272,8 @@
14214
14272
  <xsl:otherwise>
14215
14273
 
14216
14274
  <fo:block break-after="page"/>
14275
+ <xsl:call-template name="setNamedDestination"/>
14276
+
14217
14277
  <fo:block id="{@id}">
14218
14278
 
14219
14279
  <xsl:call-template name="setBlockSpanAll"/>
@@ -14285,6 +14345,7 @@
14285
14345
  <!-- following-sibling::node()[1][local-name() = 'bookmark'][@id = $source] and
14286
14346
  following-sibling::node()[2][local-name() = 'fmt-review-end'][@source = $source] -->
14287
14347
  <!-- <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> -->
14348
+ <xsl:call-template name="setNamedDestination"/>
14288
14349
  <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>
14289
14350
  <!-- </xsl:if> -->
14290
14351
  </xsl:if>
@@ -15004,6 +15065,7 @@
15004
15065
  <!-- Normative references -->
15005
15066
  <xsl:template match="*[local-name() = 'references'][@normative='true']" priority="2">
15006
15067
 
15068
+ <xsl:call-template name="setNamedDestination"/>
15007
15069
  <fo:block id="{@id}">
15008
15070
  <xsl:apply-templates/>
15009
15071
 
@@ -15024,6 +15086,7 @@
15024
15086
  </xsl:if>
15025
15087
  </xsl:if> -->
15026
15088
 
15089
+ <xsl:call-template name="setNamedDestination"/>
15027
15090
  <fo:block id="{@id}"/>
15028
15091
 
15029
15092
  <xsl:apply-templates select="*[local-name() = 'title'][@columns = 1]"/>
@@ -15043,6 +15106,7 @@
15043
15106
  <xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2">
15044
15107
  <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
15045
15108
 
15109
+ <xsl:call-template name="setNamedDestination"/>
15046
15110
  <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
15047
15111
 
15048
15112
  <xsl:call-template name="processBibitem"/>
@@ -15055,6 +15119,7 @@
15055
15119
  <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
15056
15120
 
15057
15121
  <!-- start BIPM bibitem processing -->
15122
+ <xsl:call-template name="setNamedDestination"/>
15058
15123
  <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
15059
15124
  <fo:list-item>
15060
15125
  <fo:list-item-label end-indent="label-end()">
@@ -15083,6 +15148,7 @@
15083
15148
  <xsl:choose>
15084
15149
  <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
15085
15150
  <xsl:otherwise>
15151
+ <xsl:call-template name="setNamedDestination"/>
15086
15152
  <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
15087
15153
 
15088
15154
  <fo:list-item-label end-indent="label-end()">
@@ -15477,6 +15543,7 @@
15477
15543
  <xsl:template match="*[local-name() = 'admonition']">
15478
15544
 
15479
15545
  <!-- text in the box -->
15546
+ <xsl:call-template name="setNamedDestination"/>
15480
15547
  <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
15481
15548
 
15482
15549
  <xsl:call-template name="setBlockSpanAll"/>
@@ -15733,7 +15800,7 @@
15733
15800
  </xsl:template>
15734
15801
 
15735
15802
  <!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
15736
- <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">
15803
+ <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">
15737
15804
  <xsl:copy>
15738
15805
  <xsl:copy-of select="@*"/>
15739
15806
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -15765,28 +15832,56 @@
15765
15832
  <xsl:template match="*[local-name() = 'stem']" mode="update_xml_step1"/>
15766
15833
  <xsl:template match="*[local-name() = 'stem']" mode="update_xml_pres"/>
15767
15834
 
15768
- <xsl:template match="*[local-name() = 'fmt-stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])]" mode="update_xml_step1">
15835
+ <xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_step1">
15769
15836
  <xsl:element name="stem" namespace="{$namespace_full}">
15770
15837
  <xsl:copy-of select="@*"/>
15771
15838
  <xsl:choose>
15772
15839
  <xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
15773
- <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
15840
+ <xsl:choose>
15841
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
15842
+ <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
15843
+ </xsl:when>
15844
+ <xsl:otherwise>
15845
+ <xsl:apply-templates select="*[local-name() = 'semx']/node()" mode="update_xml_step1"/>
15846
+ </xsl:otherwise>
15847
+ </xsl:choose>
15774
15848
  </xsl:when>
15775
15849
  <xsl:otherwise>
15776
- <xsl:copy-of select="node()"/>
15850
+ <xsl:choose>
15851
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
15852
+ <xsl:copy-of select="node()"/>
15853
+ </xsl:when>
15854
+ <xsl:otherwise>
15855
+ <xsl:apply-templates select="node()" mode="update_xml_step1"/>
15856
+ </xsl:otherwise>
15857
+ </xsl:choose>
15777
15858
  </xsl:otherwise>
15778
15859
  </xsl:choose>
15779
15860
  </xsl:element>
15780
15861
  </xsl:template>
15781
- <xsl:template match="*[local-name() = 'fmt-stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])]" mode="update_xml_pres">
15862
+ <xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_pres">
15782
15863
  <xsl:element name="stem" namespace="{$namespace_full}">
15783
15864
  <xsl:copy-of select="@*"/>
15784
15865
  <xsl:choose>
15785
15866
  <xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
15786
- <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
15867
+ <xsl:choose>
15868
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
15869
+ <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
15870
+ </xsl:when>
15871
+ <xsl:otherwise>
15872
+ <xsl:apply-templates select="*[local-name() = 'semx']/node()" mode="update_xml_pres"/>
15873
+ </xsl:otherwise>
15874
+ </xsl:choose>
15787
15875
  </xsl:when>
15788
15876
  <xsl:otherwise>
15789
- <xsl:copy-of select="node()"/>
15877
+ <xsl:choose>
15878
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
15879
+ <xsl:copy-of select="node()"/>
15880
+ </xsl:when>
15881
+ <xsl:otherwise>
15882
+ <xsl:apply-templates select="node()" mode="update_xml_pres"/>
15883
+ </xsl:otherwise>
15884
+ </xsl:choose>
15790
15885
  </xsl:otherwise>
15791
15886
  </xsl:choose>
15792
15887
  </xsl:element>
@@ -16015,16 +16110,24 @@
16015
16110
  <xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_step1">
16016
16111
  <xsl:element name="title" namespace="{$namespace_full}">
16017
16112
  <xsl:copy-of select="@*"/>
16113
+ <xsl:call-template name="addNamedDestinationAttribute"/>
16114
+
16018
16115
  <xsl:apply-templates mode="update_xml_step1"/>
16019
16116
  </xsl:element>
16020
16117
  </xsl:template>
16021
16118
  <xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_pres">
16022
16119
  <xsl:element name="title" namespace="{$namespace_full}">
16023
16120
  <xsl:copy-of select="@*"/>
16121
+ <xsl:call-template name="addNamedDestinationAttribute"/>
16122
+
16024
16123
  <xsl:apply-templates mode="update_xml_pres"/>
16025
16124
  </xsl:element>
16026
16125
  </xsl:template>
16027
16126
 
16127
+ <xsl:template name="addNamedDestinationAttribute">
16128
+
16129
+ </xsl:template>
16130
+
16028
16131
  <xsl:template match="*[local-name() = 'fmt-name']"/>
16029
16132
  <xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_step1">
16030
16133
  <xsl:choose>
@@ -16034,6 +16137,8 @@
16034
16137
  <xsl:otherwise>
16035
16138
  <xsl:element name="name" namespace="{$namespace_full}">
16036
16139
  <xsl:copy-of select="@*"/>
16140
+ <xsl:call-template name="addNamedDestinationAttribute"/>
16141
+
16037
16142
  <xsl:apply-templates mode="update_xml_step1"/>
16038
16143
  </xsl:element>
16039
16144
  </xsl:otherwise>
@@ -16047,6 +16152,8 @@
16047
16152
  <xsl:otherwise>
16048
16153
  <xsl:element name="name" namespace="{$namespace_full}">
16049
16154
  <xsl:copy-of select="@*"/>
16155
+ <xsl:call-template name="addNamedDestinationAttribute"/>
16156
+
16050
16157
  <xsl:apply-templates mode="update_xml_pres"/>
16051
16158
  </xsl:element>
16052
16159
  </xsl:otherwise>
@@ -17511,6 +17618,24 @@
17511
17618
  </xsl:attribute>
17512
17619
  </xsl:template>
17513
17620
 
17621
+ <xsl:template name="setIDforNamedDestination">
17622
+ <xsl:if test="@named_dest">
17623
+ <xsl:attribute name="id"><xsl:value-of select="@named_dest"/></xsl:attribute>
17624
+ </xsl:if>
17625
+ </xsl:template>
17626
+
17627
+ <xsl:template name="setNamedDestination">
17628
+ <!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
17629
+ <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'">
17630
+ <fox:destination internal-destination="{@id}"/>
17631
+ </xsl:if>
17632
+ <xsl:for-each select=". | *[local-name() = 'title'] | *[local-name() = 'name']">
17633
+ <xsl:if test="@named_dest">
17634
+ <fox:destination internal-destination="{@named_dest}"/>
17635
+ </xsl:if>
17636
+ </xsl:for-each>
17637
+ </xsl:template>
17638
+
17514
17639
  <xsl:template name="add-letter-spacing">
17515
17640
  <xsl:param name="text"/>
17516
17641
  <xsl:param name="letter-spacing" select="'0.15'"/>