metanorma-ieee 1.4.4 → 1.4.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: 1099fe4242aec2d3b7adac9d66d0b03c6d119c8b79332434062b37f9e284fc43
4
- data.tar.gz: c0d5669b8bcb4da6c5d9900c6f91d16406a48104eebee444d00bd04a430edceb
3
+ metadata.gz: cc2daee357485b4efad7fe5220314a233d273c83aa17c858659e10a0487d463e
4
+ data.tar.gz: a0e2c4f055714a807b8aac206e807704524772a06963b55fc970726dcc3d08e4
5
5
  SHA512:
6
- metadata.gz: d877c966ec63e08b0589407624a67e0f2441eb83eebafae47afd6ba64c02705892e1107f8d5f4f1ade73eded1dc137758a1a43d69917a39d3f0f1bf568c2dada
7
- data.tar.gz: 92ff522c55c1e06a4c3a1a3ffc1bea34ce1461fe4638c7c27fb3e23c03ef114fe4525882587a3b5fd207870af8779690c334a59c7adf5c25525c674f7ca1b412
6
+ metadata.gz: 6775149a0ee2a0012029ea3587db49c0d8e238fb73600bae1e1c06e956a5c635351ad0d843475735334f1be17174fdaaaf70e6cebe4a97d15c6e265c536d1a0e
7
+ data.tar.gz: 908a354df2bacab753c6dea448b0426447359ee92fb3f6b73ee9ba87ccae1e9c972f4f6edd0715bd9828ef2ec4b809f93162f7404ba9620da623e2f1f9231e79
@@ -1,3 +1,4 @@
1
+ <div id="boilerplate-copyright-destination"/>
1
2
  <div id="boilerplate-legal-destination"/>
2
3
  <div id="boilerplate-license-destination"/>
3
4
 
@@ -6183,8 +6183,14 @@
6183
6183
  </xsl:choose>
6184
6184
  </xsl:variable>
6185
6185
 
6186
+ <xsl:call-template name="setNamedDestination"/>
6187
+
6186
6188
  <fo:block-container xsl:use-attribute-sets="table-container-style" role="SKIP">
6187
6189
 
6190
+ <xsl:for-each select="*[local-name() = 'name']">
6191
+ <xsl:call-template name="setIDforNamedDestination"/>
6192
+ </xsl:for-each>
6193
+
6188
6194
  <xsl:call-template name="refine_table-container-style">
6189
6195
  <xsl:with-param name="margin-side" select="$margin-side"/>
6190
6196
  </xsl:call-template>
@@ -6375,6 +6381,7 @@
6375
6381
  <!-- table/name-->
6376
6382
  <xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
6377
6383
  <xsl:param name="continued"/>
6384
+ <xsl:param name="cols-count"/>
6378
6385
  <xsl:if test="normalize-space() != ''">
6379
6386
 
6380
6387
  <fo:inline role="SKIP">
@@ -6958,7 +6965,8 @@
6958
6965
 
6959
6966
  <!-- if there isn't 'thead' and there is a table's title -->
6960
6967
  <xsl:if test="not(ancestor::*[local-name()='table']/*[local-name()='thead']) and ancestor::*[local-name()='table']/*[local-name()='name']">
6961
- <fo:table-header role="Caption">
6968
+ <fo:table-header>
6969
+
6962
6970
  <xsl:call-template name="table-header-title">
6963
6971
  <xsl:with-param name="cols-count" select="$cols-count"/>
6964
6972
  </xsl:call-template>
@@ -7212,8 +7220,8 @@
7212
7220
  <xsl:for-each select="xalan:nodeset($styles__)/item">
7213
7221
  <xsl:variable name="key" select="normalize-space(substring-before(., ':'))"/>
7214
7222
  <xsl:variable name="value" select="normalize-space(substring-after(translate(.,$quot,''), ':'))"/>
7215
- <xsl:if test="$key = 'color' or $key = 'background-color'">
7216
- <style name="{$key}"><xsl:value-of select="$value"/></style>
7223
+ <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'">
7224
+ <style name="{$key}"><xsl:value-of select="java:replaceAll(java:java.lang.String.new($value), 'currentColor', 'inherit')"/></style>
7217
7225
  </xsl:if>
7218
7226
  </xsl:for-each>
7219
7227
  </xsl:variable>
@@ -7277,6 +7285,7 @@
7277
7285
  <!-- table/note, table/example, table/tfoot//note, table/tfoot//example -->
7278
7286
  <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">
7279
7287
 
7288
+ <xsl:call-template name="setNamedDestination"/>
7280
7289
  <fo:block xsl:use-attribute-sets="table-note-style">
7281
7290
  <xsl:copy-of select="@id"/>
7282
7291
 
@@ -7802,7 +7811,7 @@
7802
7811
  <xsl:variable name="target" select="@target"/>
7803
7812
  <xsl:choose>
7804
7813
  <!-- case for footnotes in Requirement tables (https://github.com/metanorma/metanorma-ogc/issues/791) -->
7805
- <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]">
7814
+ <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]">
7806
7815
  <xsl:call-template name="fn">
7807
7816
  <xsl:with-param name="footnote_body_from_table">true</xsl:with-param>
7808
7817
  </xsl:call-template>
@@ -7898,6 +7907,10 @@
7898
7907
  <!-- <dl><xsl:copy-of select="."/></dl> -->
7899
7908
  <fo:block-container xsl:use-attribute-sets="dl-block-style" role="SKIP">
7900
7909
 
7910
+ <xsl:if test="@key = 'true' and ancestor::*[local-name() = 'figure']">
7911
+ <xsl:attribute name="keep-together.within-column">always</xsl:attribute>
7912
+ </xsl:if>
7913
+
7901
7914
  <xsl:call-template name="setBlockSpanAll"/>
7902
7915
 
7903
7916
  <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
@@ -8191,7 +8204,7 @@
8191
8204
 
8192
8205
  <!-- caption for figure key and another caption, https://github.com/metanorma/isodoc/issues/607 -->
8193
8206
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'p'][@keep-with-next = 'true' and *[local-name() = 'strong']]" priority="3">
8194
- <fo:block text-align="left" margin-bottom="12pt" keep-with-next="always">
8207
+ <fo:block text-align="left" margin-bottom="12pt" keep-with-next="always" keep-with-previous="always">
8195
8208
  <xsl:call-template name="refine_figure_key_style"/>
8196
8209
  <xsl:apply-templates/>
8197
8210
  </fo:block>
@@ -8442,6 +8455,7 @@
8442
8455
 
8443
8456
  <xsl:call-template name="refine_dt-cell-style"/>
8444
8457
 
8458
+ <xsl:call-template name="setNamedDestination"/>
8445
8459
  <fo:block xsl:use-attribute-sets="dt-block-style" role="SKIP">
8446
8460
 
8447
8461
  <xsl:choose>
@@ -8876,7 +8890,7 @@
8876
8890
  <!-- ================= -->
8877
8891
 
8878
8892
  <!-- highlight text -->
8879
- <xsl:template match="*[local-name()='hi']">
8893
+ <xsl:template match="*[local-name()='hi'] | *[local-name() = 'span'][@class = 'fmt-hi']" priority="3">
8880
8894
  <fo:inline background-color="yellow">
8881
8895
  <xsl:apply-templates/>
8882
8896
  </fo:inline>
@@ -10473,6 +10487,7 @@
10473
10487
  <!-- Appendix processing -->
10474
10488
  <!-- ======================== -->
10475
10489
  <xsl:template match="*[local-name()='appendix']">
10490
+ <xsl:call-template name="setNamedDestination"/>
10476
10491
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
10477
10492
  <xsl:apply-templates select="*[local-name()='title']"/>
10478
10493
  </fo:block>
@@ -10483,13 +10498,14 @@
10483
10498
  <xsl:variable name="level">
10484
10499
  <xsl:call-template name="getLevel"/>
10485
10500
  </xsl:variable>
10486
- <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
10501
+ <fo:inline role="H{$level}"><xsl:call-template name="setIDforNamedDestination"/><xsl:apply-templates/></fo:inline>
10487
10502
  </xsl:template>
10488
10503
  <!-- ======================== -->
10489
10504
  <!-- END Appendix processing -->
10490
10505
  <!-- ======================== -->
10491
10506
 
10492
10507
  <xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
10508
+ <xsl:call-template name="setNamedDestination"/>
10493
10509
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
10494
10510
  <xsl:apply-templates select="*[local-name()='name']"/>
10495
10511
  </fo:block>
@@ -10519,6 +10535,7 @@
10519
10535
  <xsl:template match="*[local-name() = 'annotation']/*[local-name() = 'p']">
10520
10536
  <xsl:param name="callout"/>
10521
10537
  <fo:inline id="{@id}">
10538
+ <xsl:call-template name="setNamedDestination"/>
10522
10539
  <!-- for first p in annotation, put <x> -->
10523
10540
  <xsl:if test="not(preceding-sibling::*[local-name() = 'p'])"><xsl:value-of select="$callout"/></xsl:if>
10524
10541
  <xsl:apply-templates/>
@@ -10565,6 +10582,7 @@
10565
10582
 
10566
10583
  </xsl:if>
10567
10584
  <fo:block-container margin-left="0mm" role="SKIP">
10585
+ <xsl:call-template name="setNamedDestination"/>
10568
10586
  <fo:block id="{@id}">
10569
10587
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/> <!-- formula's number will be process in 'stem' template -->
10570
10588
  </fo:block>
@@ -10610,8 +10628,13 @@
10610
10628
  </fo:block>
10611
10629
  </fo:table-cell>
10612
10630
  <fo:table-cell display-align="center">
10631
+
10613
10632
  <fo:block xsl:use-attribute-sets="formula-stem-number-style" role="SKIP">
10614
10633
 
10634
+ <xsl:for-each select="../*[local-name() = 'name']">
10635
+ <xsl:call-template name="setIDforNamedDestination"/>
10636
+ </xsl:for-each>
10637
+
10615
10638
  <xsl:call-template name="refine_formula-stem-number-style"/>
10616
10639
 
10617
10640
  <xsl:apply-templates select="../*[local-name() = 'name']"/>
@@ -10646,6 +10669,8 @@
10646
10669
 
10647
10670
  <xsl:template match="*[local-name() = 'note']" name="note">
10648
10671
 
10672
+ <xsl:call-template name="setNamedDestination"/>
10673
+
10649
10674
  <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style" role="SKIP">
10650
10675
 
10651
10676
  <xsl:call-template name="setBlockSpanAll"/>
@@ -10710,6 +10735,7 @@
10710
10735
  </xsl:template>
10711
10736
 
10712
10737
  <xsl:template match="*[local-name() = 'termnote']">
10738
+ <xsl:call-template name="setNamedDestination"/>
10713
10739
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
10714
10740
 
10715
10741
  <xsl:call-template name="setBlockSpanAll"/>
@@ -10816,12 +10842,14 @@
10816
10842
 
10817
10843
  <xsl:template match="*[local-name() = 'terms']">
10818
10844
  <!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
10845
+ <xsl:call-template name="setNamedDestination"/>
10819
10846
  <fo:block id="{@id}">
10820
10847
  <xsl:apply-templates/>
10821
10848
  </fo:block>
10822
10849
  </xsl:template>
10823
10850
 
10824
10851
  <xsl:template match="*[local-name() = 'term']">
10852
+ <xsl:call-template name="setNamedDestination"/>
10825
10853
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
10826
10854
 
10827
10855
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
@@ -10853,6 +10881,7 @@
10853
10881
  <xsl:template match="*[local-name() = 'figure']" name="figure">
10854
10882
  <xsl:variable name="isAdded" select="@added"/>
10855
10883
  <xsl:variable name="isDeleted" select="@deleted"/>
10884
+ <xsl:call-template name="setNamedDestination"/>
10856
10885
  <fo:block-container id="{@id}" xsl:use-attribute-sets="figure-block-style">
10857
10886
  <xsl:call-template name="refine_figure-block-style"/>
10858
10887
 
@@ -10869,6 +10898,11 @@
10869
10898
  </xsl:variable>
10870
10899
 
10871
10900
  <fo:block xsl:use-attribute-sets="figure-style" role="SKIP">
10901
+
10902
+ <xsl:for-each select="*[local-name() = 'name']"> <!-- set context -->
10903
+ <xsl:call-template name="setIDforNamedDestination"/>
10904
+ </xsl:for-each>
10905
+
10872
10906
  <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note' and @type = 'units')]"/>
10873
10907
  </fo:block>
10874
10908
 
@@ -10901,6 +10935,7 @@
10901
10935
  </xsl:template>
10902
10936
 
10903
10937
  <xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
10938
+ <xsl:call-template name="setNamedDestination"/>
10904
10939
  <fo:block id="{@id}">
10905
10940
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
10906
10941
  </fo:block>
@@ -10914,6 +10949,7 @@
10914
10949
  </xsl:template>
10915
10950
 
10916
10951
  <!-- SOURCE: ... -->
10952
+ <!-- figure/source -->
10917
10953
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'source']" priority="2">
10918
10954
 
10919
10955
  <xsl:call-template name="termsource"/>
@@ -12146,6 +12182,7 @@
12146
12182
  <xsl:template match="title" mode="bookmark"/>
12147
12183
  <xsl:template match="text()" mode="bookmark"/>
12148
12184
 
12185
+ <!-- figure/name -->
12149
12186
  <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']">
12150
12187
  <xsl:if test="normalize-space() != ''">
12151
12188
  <fo:block xsl:use-attribute-sets="figure-name-style">
@@ -12158,11 +12195,11 @@
12158
12195
  </xsl:template>
12159
12196
 
12160
12197
  <!-- figure/fn -->
12161
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'fn']" priority="2"/>
12198
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'fn']" priority="2"/>
12162
12199
  <!-- figure/note -->
12163
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'note']" priority="2"/>
12200
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'note']" priority="2"/>
12164
12201
  <!-- figure/example -->
12165
- <xsl:template match="*[local-name() = 'figure']/*[local-name() = 'example']" priority="2"/>
12202
+ <xsl:template match="*[local-name() = 'figure'][not(@class = 'pseudocode')]/*[local-name() = 'example']" priority="2"/>
12166
12203
 
12167
12204
  <!-- figure/note[@type = 'units'] -->
12168
12205
  <!-- image/note[@type = 'units'] -->
@@ -12860,6 +12897,7 @@
12860
12897
  <!-- permission -->
12861
12898
  <!-- ========== -->
12862
12899
  <xsl:template match="*[local-name() = 'permission']">
12900
+ <xsl:call-template name="setNamedDestination"/>
12863
12901
  <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
12864
12902
  <xsl:apply-templates select="*[local-name()='name']"/>
12865
12903
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
@@ -12868,10 +12906,12 @@
12868
12906
 
12869
12907
  <xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']">
12870
12908
  <xsl:if test="normalize-space() != ''">
12871
- <fo:block xsl:use-attribute-sets="permission-name-style">
12872
- <xsl:apply-templates/>
12873
12909
 
12874
- </fo:block>
12910
+ <fo:block xsl:use-attribute-sets="permission-name-style">
12911
+ <xsl:apply-templates/>
12912
+
12913
+ </fo:block>
12914
+
12875
12915
  </xsl:if>
12876
12916
  </xsl:template>
12877
12917
 
@@ -12887,6 +12927,7 @@
12887
12927
  <!-- requirement -->
12888
12928
  <!-- ========== -->
12889
12929
  <xsl:template match="*[local-name() = 'requirement']">
12930
+ <xsl:call-template name="setNamedDestination"/>
12890
12931
  <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
12891
12932
  <xsl:apply-templates select="*[local-name()='name']"/>
12892
12933
  <xsl:apply-templates select="*[local-name()='label']"/>
@@ -12898,11 +12939,13 @@
12898
12939
 
12899
12940
  <xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']">
12900
12941
  <xsl:if test="normalize-space() != ''">
12901
- <fo:block xsl:use-attribute-sets="requirement-name-style">
12902
12942
 
12903
- <xsl:apply-templates/>
12943
+ <fo:block xsl:use-attribute-sets="requirement-name-style">
12944
+
12945
+ <xsl:apply-templates/>
12946
+
12947
+ </fo:block>
12904
12948
 
12905
- </fo:block>
12906
12949
  </xsl:if>
12907
12950
  </xsl:template>
12908
12951
 
@@ -12931,6 +12974,7 @@
12931
12974
  <!-- recommendation -->
12932
12975
  <!-- ========== -->
12933
12976
  <xsl:template match="*[local-name() = 'recommendation']">
12977
+ <xsl:call-template name="setNamedDestination"/>
12934
12978
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
12935
12979
  <xsl:apply-templates select="*[local-name()='name']"/>
12936
12980
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
@@ -12939,10 +12983,12 @@
12939
12983
 
12940
12984
  <xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']">
12941
12985
  <xsl:if test="normalize-space() != ''">
12942
- <fo:block xsl:use-attribute-sets="recommendation-name-style">
12943
- <xsl:apply-templates/>
12944
12986
 
12945
- </fo:block>
12987
+ <fo:block xsl:use-attribute-sets="recommendation-name-style">
12988
+ <xsl:apply-templates/>
12989
+
12990
+ </fo:block>
12991
+
12946
12992
  </xsl:if>
12947
12993
  </xsl:template>
12948
12994
 
@@ -13021,6 +13067,7 @@
13021
13067
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
13022
13068
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
13023
13069
  </xsl:if>
13070
+ <xsl:call-template name="setNamedDestination"/>
13024
13071
  <fo:block-container margin-left="0mm" margin-right="0mm" role="SKIP">
13025
13072
  <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
13026
13073
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
@@ -13130,6 +13177,7 @@
13130
13177
  <!-- termexample -->
13131
13178
  <!-- ====== -->
13132
13179
  <xsl:template match="*[local-name() = 'termexample']">
13180
+ <xsl:call-template name="setNamedDestination"/>
13133
13181
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
13134
13182
  <xsl:call-template name="refine_termexample-style"/>
13135
13183
  <xsl:call-template name="setBlockSpanAll"/>
@@ -13188,6 +13236,7 @@
13188
13236
  -->
13189
13237
  <xsl:template match="*[local-name() = 'example']" name="example">
13190
13238
 
13239
+ <xsl:call-template name="setNamedDestination"/>
13191
13240
  <fo:block-container id="{@id}" xsl:use-attribute-sets="example-style" role="SKIP">
13192
13241
 
13193
13242
  <xsl:call-template name="setBlockSpanAll"/>
@@ -13700,8 +13749,13 @@
13700
13749
  <fo:block font-size="{normalize-space($font-size)}" role="H{$levelTerm}" xsl:use-attribute-sets="preferred-block-style">
13701
13750
 
13702
13751
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'preferred'])"> <!-- if first preffered in term, then display term's name -->
13752
+
13703
13753
  <fo:block xsl:use-attribute-sets="term-name-style" role="SKIP">
13704
13754
 
13755
+ <xsl:for-each select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"><!-- change context -->
13756
+ <xsl:call-template name="setIDforNamedDestination"/>
13757
+ </xsl:for-each>
13758
+
13705
13759
  <xsl:apply-templates select="ancestor::*[local-name() = 'term'][1]/*[local-name() = 'name']"/>
13706
13760
  </fo:block>
13707
13761
  </xsl:if>
@@ -13821,6 +13875,7 @@
13821
13875
  <!-- main sections -->
13822
13876
  <xsl:template match="/*/*[local-name() = 'sections']/*" name="sections_node" priority="2">
13823
13877
 
13878
+ <xsl:call-template name="setNamedDestination"/>
13824
13879
  <fo:block>
13825
13880
  <xsl:call-template name="setId"/>
13826
13881
 
@@ -13861,6 +13916,7 @@
13861
13916
 
13862
13917
  <fo:block break-after="page"/>
13863
13918
 
13919
+ <xsl:call-template name="setNamedDestination"/>
13864
13920
  <fo:block>
13865
13921
  <xsl:call-template name="setId"/>
13866
13922
  <xsl:call-template name="addReviewHelper"/>
@@ -13889,6 +13945,7 @@
13889
13945
  </xsl:template>
13890
13946
 
13891
13947
  <xsl:template match="*[local-name() = 'clause'][normalize-space() != '' or *[local-name() = 'figure'] or @id]" name="template_clause"> <!-- if clause isn't empty -->
13948
+ <xsl:call-template name="setNamedDestination"/>
13892
13949
  <fo:block>
13893
13950
  <xsl:if test="parent::*[local-name() = 'copyright-statement']">
13894
13951
  <xsl:attribute name="role">SKIP</xsl:attribute>
@@ -13911,6 +13968,7 @@
13911
13968
  </xsl:template> <!-- refine_clause_style -->
13912
13969
 
13913
13970
  <xsl:template match="*[local-name() = 'definitions']">
13971
+ <xsl:call-template name="setNamedDestination"/>
13914
13972
  <fo:block id="{@id}">
13915
13973
  <xsl:apply-templates/>
13916
13974
  </fo:block>
@@ -13926,6 +13984,8 @@
13926
13984
  <xsl:otherwise>
13927
13985
 
13928
13986
  <fo:block break-after="page"/>
13987
+ <xsl:call-template name="setNamedDestination"/>
13988
+
13929
13989
  <fo:block id="{@id}">
13930
13990
 
13931
13991
  <xsl:call-template name="setBlockSpanAll"/>
@@ -13997,6 +14057,7 @@
13997
14057
  <!-- following-sibling::node()[1][local-name() = 'bookmark'][@id = $source] and
13998
14058
  following-sibling::node()[2][local-name() = 'fmt-review-end'][@source = $source] -->
13999
14059
  <!-- <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> -->
14060
+ <xsl:call-template name="setNamedDestination"/>
14000
14061
  <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>
14001
14062
  <!-- </xsl:if> -->
14002
14063
  </xsl:if>
@@ -14723,6 +14784,7 @@
14723
14784
  <!-- Normative references -->
14724
14785
  <xsl:template match="*[local-name() = 'references'][@normative='true']" priority="2">
14725
14786
 
14787
+ <xsl:call-template name="setNamedDestination"/>
14726
14788
  <fo:block id="{@id}">
14727
14789
  <xsl:apply-templates/>
14728
14790
 
@@ -14741,6 +14803,7 @@
14741
14803
  </xsl:if>
14742
14804
  </xsl:if> -->
14743
14805
 
14806
+ <xsl:call-template name="setNamedDestination"/>
14744
14807
  <fo:block id="{@id}"/>
14745
14808
 
14746
14809
  <xsl:apply-templates select="*[local-name() = 'title'][@columns = 1]"/>
@@ -14760,6 +14823,7 @@
14760
14823
  <xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2">
14761
14824
  <xsl:param name="skip" select="normalize-space(preceding-sibling::*[1][local-name() = 'bibitem'] and 1 = 1)"/> <!-- current bibiitem is non-first -->
14762
14825
 
14826
+ <xsl:call-template name="setNamedDestination"/>
14763
14827
  <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
14764
14828
 
14765
14829
  <xsl:call-template name="processBibitem"/>
@@ -14773,6 +14837,7 @@
14773
14837
  <!-- $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'ieee' or $namespace = 'iso' or $namespace = 'jcgm' or $namespace = 'm3d' or
14774
14838
  $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' -->
14775
14839
  <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
14840
+ <xsl:call-template name="setNamedDestination"/>
14776
14841
  <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
14777
14842
 
14778
14843
  <xsl:variable name="bibitem_label">
@@ -14815,6 +14880,7 @@
14815
14880
  <xsl:choose>
14816
14881
  <xsl:when test="@hidden = 'true'"><!-- skip --></xsl:when>
14817
14882
  <xsl:otherwise>
14883
+ <xsl:call-template name="setNamedDestination"/>
14818
14884
  <fo:list-item id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-item-style">
14819
14885
 
14820
14886
  <fo:list-item-label end-indent="label-end()">
@@ -15214,6 +15280,7 @@
15214
15280
  <xsl:template match="*[local-name() = 'admonition']">
15215
15281
 
15216
15282
  <!-- text in the box -->
15283
+ <xsl:call-template name="setNamedDestination"/>
15217
15284
  <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
15218
15285
 
15219
15286
  <xsl:call-template name="setBlockSpanAll"/>
@@ -15503,7 +15570,7 @@
15503
15570
  </xsl:template>
15504
15571
 
15505
15572
  <!-- Example with 'class': <span class="stdpublisher">ISO</span> <span class="stddocNumber">10303</span>-<span class="stddocPartNumber">1</span>:<span class="stdyear">1994</span> -->
15506
- <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">
15573
+ <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">
15507
15574
  <xsl:copy>
15508
15575
  <xsl:copy-of select="@*"/>
15509
15576
  <xsl:apply-templates mode="update_xml_step1"/>
@@ -15535,28 +15602,56 @@
15535
15602
  <xsl:template match="*[local-name() = 'stem']" mode="update_xml_step1"/>
15536
15603
  <xsl:template match="*[local-name() = 'stem']" mode="update_xml_pres"/>
15537
15604
 
15538
- <xsl:template match="*[local-name() = 'fmt-stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])]" mode="update_xml_step1">
15605
+ <xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_step1">
15539
15606
  <xsl:element name="stem" namespace="{$namespace_full}">
15540
15607
  <xsl:copy-of select="@*"/>
15541
15608
  <xsl:choose>
15542
15609
  <xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
15543
- <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
15610
+ <xsl:choose>
15611
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
15612
+ <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
15613
+ </xsl:when>
15614
+ <xsl:otherwise>
15615
+ <xsl:apply-templates select="*[local-name() = 'semx']/node()" mode="update_xml_step1"/>
15616
+ </xsl:otherwise>
15617
+ </xsl:choose>
15544
15618
  </xsl:when>
15545
15619
  <xsl:otherwise>
15546
- <xsl:copy-of select="node()"/>
15620
+ <xsl:choose>
15621
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
15622
+ <xsl:copy-of select="node()"/>
15623
+ </xsl:when>
15624
+ <xsl:otherwise>
15625
+ <xsl:apply-templates select="node()" mode="update_xml_step1"/>
15626
+ </xsl:otherwise>
15627
+ </xsl:choose>
15547
15628
  </xsl:otherwise>
15548
15629
  </xsl:choose>
15549
15630
  </xsl:element>
15550
15631
  </xsl:template>
15551
- <xsl:template match="*[local-name() = 'fmt-stem'][not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])]" mode="update_xml_pres">
15632
+ <xsl:template match="*[local-name() = 'fmt-stem']" mode="update_xml_pres">
15552
15633
  <xsl:element name="stem" namespace="{$namespace_full}">
15553
15634
  <xsl:copy-of select="@*"/>
15554
15635
  <xsl:choose>
15555
15636
  <xsl:when test="*[local-name() = 'semx'] and count(node()) = 1">
15556
- <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
15637
+ <xsl:choose>
15638
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
15639
+ <xsl:copy-of select="*[local-name() = 'semx']/node()"/>
15640
+ </xsl:when>
15641
+ <xsl:otherwise>
15642
+ <xsl:apply-templates select="*[local-name() = 'semx']/node()" mode="update_xml_pres"/>
15643
+ </xsl:otherwise>
15644
+ </xsl:choose>
15557
15645
  </xsl:when>
15558
15646
  <xsl:otherwise>
15559
- <xsl:copy-of select="node()"/>
15647
+ <xsl:choose>
15648
+ <xsl:when test="not(.//*[local-name() = 'passthrough']) and not(.//*[@linebreak])">
15649
+ <xsl:copy-of select="node()"/>
15650
+ </xsl:when>
15651
+ <xsl:otherwise>
15652
+ <xsl:apply-templates select="node()" mode="update_xml_pres"/>
15653
+ </xsl:otherwise>
15654
+ </xsl:choose>
15560
15655
  </xsl:otherwise>
15561
15656
  </xsl:choose>
15562
15657
  </xsl:element>
@@ -15651,6 +15746,9 @@
15651
15746
  <xsl:template match="*[local-name() = 'quote']/*[local-name() = 'author']" mode="update_xml_pres"/>
15652
15747
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_step1"/>
15653
15748
  <xsl:template match="*[local-name() = 'amend']" mode="update_xml_pres"/>
15749
+ <!-- https://github.com/metanorma/isodoc/issues/687 -->
15750
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_step1"/>
15751
+ <xsl:template match="*[local-name() = 'source']" mode="update_xml_pres"/>
15654
15752
 
15655
15753
  <xsl:template match="*[local-name() = 'metanorma-extension']/*[local-name() = 'attachment']" mode="update_xml_step1">
15656
15754
  <xsl:copy>
@@ -15785,16 +15883,24 @@
15785
15883
  <xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_step1">
15786
15884
  <xsl:element name="title" namespace="{$namespace_full}">
15787
15885
  <xsl:copy-of select="@*"/>
15886
+ <xsl:call-template name="addNamedDestinationAttribute"/>
15887
+
15788
15888
  <xsl:apply-templates mode="update_xml_step1"/>
15789
15889
  </xsl:element>
15790
15890
  </xsl:template>
15791
15891
  <xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_pres">
15792
15892
  <xsl:element name="title" namespace="{$namespace_full}">
15793
15893
  <xsl:copy-of select="@*"/>
15894
+ <xsl:call-template name="addNamedDestinationAttribute"/>
15895
+
15794
15896
  <xsl:apply-templates mode="update_xml_pres"/>
15795
15897
  </xsl:element>
15796
15898
  </xsl:template>
15797
15899
 
15900
+ <xsl:template name="addNamedDestinationAttribute">
15901
+
15902
+ </xsl:template>
15903
+
15798
15904
  <xsl:template match="*[local-name() = 'fmt-name']"/>
15799
15905
  <xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_step1">
15800
15906
  <xsl:choose>
@@ -15804,6 +15910,8 @@
15804
15910
  <xsl:otherwise>
15805
15911
  <xsl:element name="name" namespace="{$namespace_full}">
15806
15912
  <xsl:copy-of select="@*"/>
15913
+ <xsl:call-template name="addNamedDestinationAttribute"/>
15914
+
15807
15915
  <xsl:apply-templates mode="update_xml_step1"/>
15808
15916
  </xsl:element>
15809
15917
  </xsl:otherwise>
@@ -15817,6 +15925,8 @@
15817
15925
  <xsl:otherwise>
15818
15926
  <xsl:element name="name" namespace="{$namespace_full}">
15819
15927
  <xsl:copy-of select="@*"/>
15928
+ <xsl:call-template name="addNamedDestinationAttribute"/>
15929
+
15820
15930
  <xsl:apply-templates mode="update_xml_pres"/>
15821
15931
  </xsl:element>
15822
15932
  </xsl:otherwise>
@@ -15921,6 +16031,20 @@
15921
16031
  </xsl:element>
15922
16032
  </xsl:template>
15923
16033
 
16034
+ <xsl:template match="*[local-name() = 'fmt-source']"/>
16035
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_step1">
16036
+ <xsl:element name="source" namespace="{$namespace_full}">
16037
+ <xsl:copy-of select="@*"/>
16038
+ <xsl:apply-templates mode="update_xml_step1"/>
16039
+ </xsl:element>
16040
+ </xsl:template>
16041
+ <xsl:template match="*[local-name() = 'fmt-source']" mode="update_xml_pres">
16042
+ <xsl:element name="source" namespace="{$namespace_full}">
16043
+ <xsl:copy-of select="@*"/>
16044
+ <xsl:apply-templates mode="update_xml_pres"/>
16045
+ </xsl:element>
16046
+ </xsl:template>
16047
+
15924
16048
  <xsl:template match="*[local-name() = 'span'][ @class = 'fmt-caption-label' or @class = 'fmt-element-name' or @class = 'fmt-caption-delim' or @class = 'fmt-autonum-delim']" mode="update_xml_step1" priority="3">
15925
16049
  <xsl:apply-templates mode="update_xml_step1"/>
15926
16050
  </xsl:template>
@@ -17376,6 +17500,30 @@
17376
17500
  </xsl:attribute>
17377
17501
  </xsl:template>
17378
17502
 
17503
+ <xsl:template name="setIDforNamedDestination">
17504
+ <xsl:if test="@named_dest">
17505
+ <xsl:attribute name="id"><xsl:value-of select="@named_dest"/></xsl:attribute>
17506
+ </xsl:if>
17507
+ </xsl:template>
17508
+
17509
+ <xsl:template name="setIDforNamedDestinationInline">
17510
+ <xsl:if test="@named_dest">
17511
+ <fo:inline><xsl:call-template name="setIDforNamedDestination"/></fo:inline>
17512
+ </xsl:if>
17513
+ </xsl:template>
17514
+
17515
+ <xsl:template name="setNamedDestination">
17516
+ <!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
17517
+ <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'">
17518
+ <fox:destination internal-destination="{@id}"/>
17519
+ </xsl:if>
17520
+ <xsl:for-each select=". | *[local-name() = 'title'] | *[local-name() = 'name']">
17521
+ <xsl:if test="@named_dest">
17522
+ <fox:destination internal-destination="{@named_dest}"/>
17523
+ </xsl:if>
17524
+ </xsl:for-each>
17525
+ </xsl:template>
17526
+
17379
17527
  <xsl:template name="add-letter-spacing">
17380
17528
  <xsl:param name="text"/>
17381
17529
  <xsl:param name="letter-spacing" select="'0.15'"/>