metanorma-ieee 1.4.4 → 1.4.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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 1099fe4242aec2d3b7adac9d66d0b03c6d119c8b79332434062b37f9e284fc43
4
- data.tar.gz: c0d5669b8bcb4da6c5d9900c6f91d16406a48104eebee444d00bd04a430edceb
3
+ metadata.gz: 23aed03427f39e05c59b8fb66fb555503ed1807c60809815427325c2150d6f94
4
+ data.tar.gz: b39444a29add41e3c8d9991b06505a468756d81320fee90977c3b0921be50ff6
5
5
  SHA512:
6
- metadata.gz: d877c966ec63e08b0589407624a67e0f2441eb83eebafae47afd6ba64c02705892e1107f8d5f4f1ade73eded1dc137758a1a43d69917a39d3f0f1bf568c2dada
7
- data.tar.gz: 92ff522c55c1e06a4c3a1a3ffc1bea34ce1461fe4638c7c27fb3e23c03ef114fe4525882587a3b5fd207870af8779690c334a59c7adf5c25525c674f7ca1b412
6
+ metadata.gz: 384870e47ca420c52a526ef2665fa9a34d7ebe95c1d22820d84b491523192de790fafc208083cc0470737279603528b7c927484bdf898f51a2cc1e63d603f113
7
+ data.tar.gz: 869e5854cbcaeb23da8958638376c7f854e34ae08a17ee8f77fa9b7bc31055e29727bca1770b218d7806563b1f5d3f8d0d36727f70fc9b3cb4f98732a0e2b53c
@@ -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">
@@ -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>
@@ -15785,16 +15880,24 @@
15785
15880
  <xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_step1">
15786
15881
  <xsl:element name="title" namespace="{$namespace_full}">
15787
15882
  <xsl:copy-of select="@*"/>
15883
+ <xsl:call-template name="addNamedDestinationAttribute"/>
15884
+
15788
15885
  <xsl:apply-templates mode="update_xml_step1"/>
15789
15886
  </xsl:element>
15790
15887
  </xsl:template>
15791
15888
  <xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_pres">
15792
15889
  <xsl:element name="title" namespace="{$namespace_full}">
15793
15890
  <xsl:copy-of select="@*"/>
15891
+ <xsl:call-template name="addNamedDestinationAttribute"/>
15892
+
15794
15893
  <xsl:apply-templates mode="update_xml_pres"/>
15795
15894
  </xsl:element>
15796
15895
  </xsl:template>
15797
15896
 
15897
+ <xsl:template name="addNamedDestinationAttribute">
15898
+
15899
+ </xsl:template>
15900
+
15798
15901
  <xsl:template match="*[local-name() = 'fmt-name']"/>
15799
15902
  <xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_step1">
15800
15903
  <xsl:choose>
@@ -15804,6 +15907,8 @@
15804
15907
  <xsl:otherwise>
15805
15908
  <xsl:element name="name" namespace="{$namespace_full}">
15806
15909
  <xsl:copy-of select="@*"/>
15910
+ <xsl:call-template name="addNamedDestinationAttribute"/>
15911
+
15807
15912
  <xsl:apply-templates mode="update_xml_step1"/>
15808
15913
  </xsl:element>
15809
15914
  </xsl:otherwise>
@@ -15817,6 +15922,8 @@
15817
15922
  <xsl:otherwise>
15818
15923
  <xsl:element name="name" namespace="{$namespace_full}">
15819
15924
  <xsl:copy-of select="@*"/>
15925
+ <xsl:call-template name="addNamedDestinationAttribute"/>
15926
+
15820
15927
  <xsl:apply-templates mode="update_xml_pres"/>
15821
15928
  </xsl:element>
15822
15929
  </xsl:otherwise>
@@ -17376,6 +17483,24 @@
17376
17483
  </xsl:attribute>
17377
17484
  </xsl:template>
17378
17485
 
17486
+ <xsl:template name="setIDforNamedDestination">
17487
+ <xsl:if test="@named_dest">
17488
+ <xsl:attribute name="id"><xsl:value-of select="@named_dest"/></xsl:attribute>
17489
+ </xsl:if>
17490
+ </xsl:template>
17491
+
17492
+ <xsl:template name="setNamedDestination">
17493
+ <!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
17494
+ <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'">
17495
+ <fox:destination internal-destination="{@id}"/>
17496
+ </xsl:if>
17497
+ <xsl:for-each select=". | *[local-name() = 'title'] | *[local-name() = 'name']">
17498
+ <xsl:if test="@named_dest">
17499
+ <fox:destination internal-destination="{@named_dest}"/>
17500
+ </xsl:if>
17501
+ </xsl:for-each>
17502
+ </xsl:template>
17503
+
17379
17504
  <xsl:template name="add-letter-spacing">
17380
17505
  <xsl:param name="text"/>
17381
17506
  <xsl:param name="letter-spacing" select="'0.15'"/>
@@ -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">
@@ -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>
@@ -15785,16 +15880,24 @@
15785
15880
  <xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_step1">
15786
15881
  <xsl:element name="title" namespace="{$namespace_full}">
15787
15882
  <xsl:copy-of select="@*"/>
15883
+ <xsl:call-template name="addNamedDestinationAttribute"/>
15884
+
15788
15885
  <xsl:apply-templates mode="update_xml_step1"/>
15789
15886
  </xsl:element>
15790
15887
  </xsl:template>
15791
15888
  <xsl:template match="*[local-name() = 'fmt-title']" mode="update_xml_pres">
15792
15889
  <xsl:element name="title" namespace="{$namespace_full}">
15793
15890
  <xsl:copy-of select="@*"/>
15891
+ <xsl:call-template name="addNamedDestinationAttribute"/>
15892
+
15794
15893
  <xsl:apply-templates mode="update_xml_pres"/>
15795
15894
  </xsl:element>
15796
15895
  </xsl:template>
15797
15896
 
15897
+ <xsl:template name="addNamedDestinationAttribute">
15898
+
15899
+ </xsl:template>
15900
+
15798
15901
  <xsl:template match="*[local-name() = 'fmt-name']"/>
15799
15902
  <xsl:template match="*[local-name() = 'fmt-name']" mode="update_xml_step1">
15800
15903
  <xsl:choose>
@@ -15804,6 +15907,8 @@
15804
15907
  <xsl:otherwise>
15805
15908
  <xsl:element name="name" namespace="{$namespace_full}">
15806
15909
  <xsl:copy-of select="@*"/>
15910
+ <xsl:call-template name="addNamedDestinationAttribute"/>
15911
+
15807
15912
  <xsl:apply-templates mode="update_xml_step1"/>
15808
15913
  </xsl:element>
15809
15914
  </xsl:otherwise>
@@ -15817,6 +15922,8 @@
15817
15922
  <xsl:otherwise>
15818
15923
  <xsl:element name="name" namespace="{$namespace_full}">
15819
15924
  <xsl:copy-of select="@*"/>
15925
+ <xsl:call-template name="addNamedDestinationAttribute"/>
15926
+
15820
15927
  <xsl:apply-templates mode="update_xml_pres"/>
15821
15928
  </xsl:element>
15822
15929
  </xsl:otherwise>
@@ -17376,6 +17483,24 @@
17376
17483
  </xsl:attribute>
17377
17484
  </xsl:template>
17378
17485
 
17486
+ <xsl:template name="setIDforNamedDestination">
17487
+ <xsl:if test="@named_dest">
17488
+ <xsl:attribute name="id"><xsl:value-of select="@named_dest"/></xsl:attribute>
17489
+ </xsl:if>
17490
+ </xsl:template>
17491
+
17492
+ <xsl:template name="setNamedDestination">
17493
+ <!-- skip GUID, e.g. _33eac3cb-9663-4291-ae26-1d4b6f4635fc -->
17494
+ <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'">
17495
+ <fox:destination internal-destination="{@id}"/>
17496
+ </xsl:if>
17497
+ <xsl:for-each select=". | *[local-name() = 'title'] | *[local-name() = 'name']">
17498
+ <xsl:if test="@named_dest">
17499
+ <fox:destination internal-destination="{@named_dest}"/>
17500
+ </xsl:if>
17501
+ </xsl:for-each>
17502
+ </xsl:template>
17503
+
17379
17504
  <xsl:template name="add-letter-spacing">
17380
17505
  <xsl:param name="text"/>
17381
17506
  <xsl:param name="letter-spacing" select="'0.15'"/>
@@ -31,23 +31,25 @@ module Metanorma
31
31
 
32
32
  # Alphabetic by rendering: author surname or designation, followed by title
33
33
  def sort_biblio_key(bib)
34
- name = designator_or_name(bib)
34
+ name, docid = designator_or_name(bib)
35
35
  title = bib.at("./title[@type = 'main']")&.text ||
36
36
  bib.at("./title")&.text || bib.at("./formattedref")&.text
37
37
  title.gsub!(/[[:punct:]]/, "")
38
- @c.decode("#{name} #{title}").strip.downcase
38
+ @c.decode("#{name} #{title} #{docid}").strip.downcase
39
39
  end
40
40
 
41
41
  def designator_or_name(bib)
42
- case bib["type"]
43
- when "standard", "techreport" then designator_docid(bib)
44
- else
45
- bib1 = bib.dup
46
- bib1.add_namespace(nil, self.class::XML_NAMESPACE)
47
- n = @i.creatornames(bib1)
48
- n.nil? && bib["type"].nil? and n = designator_docid(bib)
49
- n
50
- end
42
+ id = designator_docid(bib)
43
+ ret = case bib["type"]
44
+ when "standard", "techreport" then id
45
+ else
46
+ bib1 = bib.dup
47
+ bib1.add_namespace(nil, self.class::XML_NAMESPACE)
48
+ n = @i.creatornames(bib1)
49
+ n.nil? && bib["type"].nil? and n = id
50
+ n
51
+ end
52
+ [ret, id]
51
53
  end
52
54
 
53
55
  def designator_docid(bib)
@@ -66,7 +68,7 @@ module Metanorma
66
68
  def normref_no_ordinals(xmldoc)
67
69
  xmldoc.xpath("//references[@normative = 'true']/bibitem/" \
68
70
  "docidentifier[@type = 'metanorma']").each do |d|
69
- /^\[?\d+\]?$/.match?(d.text) and d.remove
71
+ /^\[?\d+\]?$/.match?(d.text) and d.remove
70
72
  end
71
73
  end
72
74
 
@@ -221,7 +223,7 @@ module Metanorma
221
223
  ret = xmldoc.xpath(BIBITEM_NO_AVAIL).detect do |b|
222
224
  has_itu_t = /^ITU-T/.match?(b.at("./docidentifier[@type = 'ITU']")&.text)
223
225
  bib_pubs(b).include?("International Telecommunication Union") &&
224
- (!has_itu_t && !itu_t) || (has_itu_t && itu_t)
226
+ !has_itu_t && !itu_t || (has_itu_t && itu_t)
225
227
  end
226
228
  insert_availability_note(ret, note)
227
229
  end
@@ -33,7 +33,7 @@ module Metanorma
33
33
  end
34
34
  end
35
35
 
36
- def clause_parse(attrs, xml, node)
36
+ def clause_attrs_preprocess(attrs, node)
37
37
  case node.title
38
38
  when "Purpose" then attrs[:type] = "purpose"
39
39
  when "Overview" then attrs[:type] = "overview"
@@ -1,6 +1,6 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
2
  <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
- <!-- VERSION v2.0.3 -->
3
+ <!-- VERSION v2.0.4 -->
4
4
 
5
5
  <!--
6
6
  ALERT: cannot have root comments, because of https://github.com/metanorma/metanorma/issues/437
@@ -1328,6 +1328,7 @@ numbers</a:documentation>
1328
1328
  <ref name="foreword"/>
1329
1329
  <ref name="introduction"/>
1330
1330
  <ref name="acknowledgements"/>
1331
+ <ref name="executivesummary"/>
1331
1332
  </choice>
1332
1333
  </oneOrMore>
1333
1334
  </element>
@@ -1351,6 +1352,11 @@ numbers</a:documentation>
1351
1352
  <ref name="Content-Section"/>
1352
1353
  </element>
1353
1354
  </define>
1355
+ <define name="executivesummary">
1356
+ <element name="executivesummary">
1357
+ <ref name="Content-Section"/>
1358
+ </element>
1359
+ </define>
1354
1360
  <define name="indexsect">
1355
1361
  <element name="indexsect">
1356
1362
  <ref name="Content-Section"/>
@@ -1576,6 +1582,15 @@ used in document amendments</a:documentation>
1576
1582
  <define name="annex">
1577
1583
  <element name="annex">
1578
1584
  <ref name="Annex-Section"/>
1585
+ <zeroOrMore>
1586
+ <ref name="annex-appendix"/>
1587
+ </zeroOrMore>
1588
+ </element>
1589
+ </define>
1590
+ <define name="annex-appendix">
1591
+ <a:documentation>Appendix, distinct subclause type for annexes (annex to annex, rather than subclause to annex)</a:documentation>
1592
+ <element name="appendix">
1593
+ <ref name="Clause-Section"/>
1579
1594
  </element>
1580
1595
  </define>
1581
1596
  <define name="terms">
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ieee
3
- VERSION = "1.4.4".freeze
3
+ VERSION = "1.4.5".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ieee
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.4
4
+ version: 1.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2025-04-14 00:00:00.000000000 Z
11
+ date: 2025-04-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc