metanorma-ieee 1.6.7 → 1.6.8

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: 2dd71904ed39cf33217f1b53dbc5ed4bc10e54b282e4889f7db7200ce8c911b3
4
- data.tar.gz: 7591b738d3cdac2bab2d77493e85e082403838a2d6b5c1a3a448dd09e38765f9
3
+ metadata.gz: bd77e9a6f2808976fa516ebded4007707d61d2277ab64b41b301f22a41974130
4
+ data.tar.gz: c76e2d441f83db79dc5fc0117d07e251294879db3bb9ad04545b2f4ced4dd4ca
5
5
  SHA512:
6
- metadata.gz: fd178cb19b16da4d7ab2f65c74eb8bdfb8934a89acfe91b53c052e67e0959ead14ae1667f776d0925e9138b919899db57e9a576fd5d745d2dc92bdc0451b308f
7
- data.tar.gz: c34996899332716f34e1aba35e5d20e9789ed8c768393ab71120af634591590937b599a7a638cd8d6b4a82354d0f4faffacef8228cdebb4dbad29d57a38fa949
6
+ metadata.gz: 8b9415b1e7bd620714f8518e4545e519f0771808f1bf57651b160b46e3f0d7ae90158c677cfc0d51be0b4bea45561831f46243a1ff5c0a3db31d0a5c020f59e2
7
+ data.tar.gz: 4730bad2e5ab16a0360ffe3ac8a4f8efb5d95e5e51ca1174097c7a0cfa172fc57d0da968f00e4b4997ed7ea924f7a185969d4816b3031d1a5b89c08ff7502039
@@ -5,6 +5,8 @@
5
5
  <!-- mandatory 'key' -->
6
6
  <xsl:key name="kfn" match="mn:fn[not(ancestor::*[self::mn:table or self::mn:figure or self::mn:localized-strings] and not(ancestor::mn:fmt-name))]" use="@reference"/>
7
7
 
8
+ <xsl:key name="kid" match="*" use="@id"/>
9
+
8
10
  <!-- mandatory variable -->
9
11
 
10
12
  <!-- mandatory variable -->
@@ -16,10 +18,10 @@
16
18
  <xsl:for-each select="//mn:metanorma">
17
19
  <xsl:variable name="num"><xsl:number level="any" count="mn:metanorma"/></xsl:variable>
18
20
  <xsl:variable name="docnumber"><xsl:value-of select="mn:bibdata/mn:docidentifier[@type = 'IEEE']"/></xsl:variable>
19
- <!-- <xsl:variable name="current_document">
21
+ <xsl:variable name="current_document">
20
22
  <xsl:copy-of select="."/>
21
- </xsl:variable> -->
22
- <xsl:for-each select="."> <!-- xalan:nodeset($current_document) -->
23
+ </xsl:variable>
24
+ <xsl:for-each select="xalan:nodeset($current_document)">
23
25
  <mnx:doc num="{$num}" firstpage_id="firstpage_id_{$num}" title-part="{$docnumber}" bundle="{$bundle}"> <!-- 'bundle' means several different documents (not language versions) in one xml -->
24
26
  <mnx:contents>
25
27
  <xsl:call-template name="processPrefaceSectionsDefault_Contents"/>
@@ -1351,6 +1353,7 @@
1351
1353
 
1352
1354
  <xsl:if test="count(*) = 1 and mn:fmt-title"> <!-- if there isn't user ToC -->
1353
1355
  <fo:block role="TOC">
1356
+ <xsl:copy-of select="@id"/>
1354
1357
  <xsl:if test="$contents/mnx:doc[@num = $num]//mnx:item[@display = 'true']">
1355
1358
  <xsl:choose>
1356
1359
  <xsl:when test="$current_template = 'standard' or $current_template = 'draft'">
@@ -1885,6 +1888,7 @@
1885
1888
  </xsl:template>
1886
1889
 
1887
1890
  <xsl:template match="mn:abstract">
1891
+ <xsl:call-template name="setNamedDestination"/>
1888
1892
  <fo:block>
1889
1893
  <xsl:call-template name="setId"/>
1890
1894
  <xsl:call-template name="addReviewHelper"/>
@@ -2278,6 +2282,7 @@
2278
2282
  </xsl:template>
2279
2283
 
2280
2284
  <xsl:template match="mn:introduction | mn:foreword | mn:acknowledgements">
2285
+ <xsl:call-template name="setNamedDestination"/>
2281
2286
  <fo:block>
2282
2287
  <xsl:call-template name="setId"/>
2283
2288
  <xsl:call-template name="addReviewHelper"/>
@@ -2358,6 +2363,8 @@
2358
2363
  <xsl:call-template name="extractSection"/>
2359
2364
  </xsl:variable>
2360
2365
 
2366
+ <xsl:call-template name="setNamedDestination"/>
2367
+
2361
2368
  <xsl:choose>
2362
2369
  <xsl:when test="string-length($section) != 0 and $element-name = 'fo:block' and ($current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report') and not(parent::mn:references[not(@normative='true')])">
2363
2370
  <fo:list-block>
@@ -2372,6 +2379,7 @@
2372
2379
  <xsl:if test="$level = 1">
2373
2380
  <xsl:attribute name="color"><xsl:value-of select="$color_blue"/></xsl:attribute>
2374
2381
  </xsl:if>
2382
+ <xsl:call-template name="setIDforNamedDestinationInline"/>
2375
2383
  <xsl:value-of select="$section"/>
2376
2384
  </fo:block>
2377
2385
  </fo:list-item-label>
@@ -2405,6 +2413,8 @@
2405
2413
  </xsl:apply-templates>
2406
2414
  </xsl:if>
2407
2415
 
2416
+ <xsl:call-template name="setIDforNamedDestinationInline"/>
2417
+
2408
2418
  <xsl:apply-templates/>
2409
2419
  <xsl:apply-templates select="following-sibling::*[1][self::mn:variant-title][@type = 'sub']" mode="subtitle"/>
2410
2420
  </xsl:element>
@@ -2470,6 +2480,8 @@
2470
2480
  </xsl:choose>
2471
2481
  </xsl:variable>
2472
2482
 
2483
+ <xsl:call-template name="setNamedDestination"/>
2484
+
2473
2485
  <fo:block margin-bottom="16pt">
2474
2486
  <!-- <xsl:if test="@ancestor = 'sections' and $level &gt; 2"> -->
2475
2487
  <xsl:if test="$level &gt; 2">
@@ -2482,6 +2494,7 @@
2482
2494
  <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
2483
2495
  </xsl:if>
2484
2496
  <!-- term/name -->
2497
+ <xsl:call-template name="setIDforNamedDestination"/>
2485
2498
  <xsl:apply-templates select="mn:fmt-name"/>
2486
2499
  <xsl:text> </xsl:text>
2487
2500
  <xsl:apply-templates select="mn:fmt-preferred"/>
@@ -2519,6 +2532,7 @@
2519
2532
  <!-- ====== -->
2520
2533
 
2521
2534
  <xsl:template match="mn:annex" priority="2">
2535
+ <xsl:call-template name="setNamedDestination"/>
2522
2536
  <fo:block id="{@id}">
2523
2537
  </fo:block>
2524
2538
  <xsl:apply-templates/>
@@ -2544,6 +2558,8 @@
2544
2558
  </xsl:choose>
2545
2559
  </xsl:variable> -->
2546
2560
 
2561
+ <xsl:call-template name="setNamedDestination"/>
2562
+
2547
2563
  <xsl:variable name="p_styles">
2548
2564
  <styles xsl:use-attribute-sets="p-style">
2549
2565
  <xsl:call-template name="refine_p-style"><xsl:with-param name="element-name" select="$element-name"/></xsl:call-template>
@@ -4548,6 +4564,46 @@
4548
4564
  </xsl:template>
4549
4565
 
4550
4566
  <xsl:template name="addNamedDestinationAttribute">
4567
+ <xsl:variable name="docnum"><xsl:number level="any" count="mn:metanorma"/></xsl:variable>
4568
+ <xsl:variable name="caption_label" select="translate(normalize-space(.//mn:span[@class = 'fmt-caption-label']), ' ()', '')"/>
4569
+
4570
+ <xsl:variable name="named_dest_">
4571
+ <xsl:choose>
4572
+ <xsl:when test="count(ancestor::mn:figure) &gt; 1"/> <!-- prevent id 'a)' -->
4573
+ <xsl:when test="ancestor::mn:note or ancestor::mn:example or ancestor::mn:termnote or ancestor::mn:termexample or ancestor::mn:admonition"/>
4574
+ <xsl:when test="$caption_label = '' and parent::mn:foreword">
4575
+ <xsl:variable name="foreword_number"><xsl:number count="mn:foreword" level="any"/></xsl:variable>
4576
+ <xsl:if test="$foreword_number = 1">Foreword</xsl:if>
4577
+ </xsl:when>
4578
+ <xsl:when test="$caption_label = '' and parent::mn:introduction">
4579
+ <xsl:variable name="introduction_number"><xsl:number count="mn:introduction" level="any"/></xsl:variable>
4580
+ <xsl:if test="$introduction_number = 1">Introduction</xsl:if>
4581
+ </xsl:when>
4582
+ <xsl:when test="$caption_label = ''"/>
4583
+ <xsl:when test="../@unnumbered = 'true'"/>
4584
+ <xsl:when test="normalize-space(java:matches(java:java.lang.String.new($caption_label), '[\x21-\xFF]+')) = 'false'"/>
4585
+ <!-- 1.1 in Appendix 1 -->
4586
+ <xsl:otherwise>
4587
+ <xsl:if test="ancestor::mn:annex and string(number(substring($caption_label, 1, 1))) != 'NaN'">
4588
+ <xsl:variable name="annex_caption_label" select="translate(normalize-space(ancestor::mn:annex[1]/mn:fmt-title//mn:span[@class = 'fmt-caption-label']), ' ()', '')"/>
4589
+ <xsl:value-of select="concat($annex_caption_label, '_')"/>
4590
+ </xsl:if>
4591
+ <xsl:if test="parent::mn:formula">Formula</xsl:if>
4592
+ <xsl:value-of select="$caption_label"/>
4593
+ </xsl:otherwise>
4594
+ </xsl:choose>
4595
+ </xsl:variable>
4596
+ <xsl:variable name="named_dest" select="normalize-space($named_dest_)"/>
4597
+ <xsl:if test="$named_dest != ''">
4598
+ <xsl:variable name="named_dest_doc_">
4599
+ <xsl:value-of select="$named_dest"/>
4600
+ <xsl:if test="$docnum != '1'">_<xsl:value-of select="$docnum"/></xsl:if>
4601
+ </xsl:variable>
4602
+ <xsl:variable name="named_dest_doc" select="normalize-space($named_dest_doc_)"/>
4603
+ <xsl:if test="not(key('kid', $named_dest_doc))"> <!-- if element with id '$named_dest_doc' doesn't exist in the document -->
4604
+ <xsl:attribute name="named_dest"><xsl:value-of select="normalize-space($named_dest_doc)"/></xsl:attribute>
4605
+ </xsl:if>
4606
+ </xsl:if>
4551
4607
  </xsl:template>
4552
4608
 
4553
4609
  <xsl:template match="mn:fmt-name" mode="update_xml_step1">
@@ -5617,9 +5673,11 @@
5617
5673
  </xsl:template>
5618
5674
 
5619
5675
  <xsl:template match="mn:feedback-statement//mn:p">
5676
+ <xsl:param name="skip_id">false</xsl:param>
5620
5677
  <xsl:param name="margin"/>
5621
5678
  <!-- process in the template 'paragraph' -->
5622
5679
  <xsl:call-template name="paragraph">
5680
+ <xsl:with-param name="skip_id" select="$skip_id"/>
5623
5681
  <xsl:with-param name="margin" select="$margin"/>
5624
5682
  </xsl:call-template>
5625
5683
  </xsl:template>
@@ -12042,7 +12100,12 @@
12042
12100
  <xsl:template match="mn:figure[@class = 'pseudocode']">
12043
12101
  <xsl:call-template name="setNamedDestination"/>
12044
12102
  <fo:block id="{@id}">
12045
- <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
12103
+ <fo:block role="SKIP">
12104
+ <xsl:for-each select="mn:fmt-name"> <!-- set context -->
12105
+ <xsl:call-template name="setIDforNamedDestination"/>
12106
+ </xsl:for-each>
12107
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
12108
+ </fo:block>
12046
12109
  </fo:block>
12047
12110
  <xsl:apply-templates select="mn:fmt-name"/>
12048
12111
  </xsl:template>
@@ -14705,7 +14768,7 @@
14705
14768
  </xsl:variable>
14706
14769
 
14707
14770
  <xsl:template name="index-pages">
14708
- <xsl:variable name="num"><xsl:number level="any" count="mn:metanorma"/></xsl:variable>
14771
+ <xsl:param name="num"/>
14709
14772
 
14710
14773
  <xsl:variable name="docid">
14711
14774
  <xsl:call-template name="getDocumentId"/>
@@ -16657,6 +16720,15 @@
16657
16720
  </xsl:if>
16658
16721
  </xsl:template>
16659
16722
 
16723
+ <!-- debug templates -->
16724
+ <xsl:template name="debug_contents">
16725
+ <xsl:if test="$debug = 'true'">
16726
+ <redirect:write file="contents_.xml"> <!-- {java:getTime(java:java.util.Date.new())} -->
16727
+ <xsl:copy-of select="$contents"/>
16728
+ </redirect:write>
16729
+ </xsl:if>
16730
+ </xsl:template>
16731
+
16660
16732
  <xsl:template name="processPrefaceSectionsDefault">
16661
16733
  <xsl:param name="num"/>
16662
16734
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
@@ -17873,14 +17945,18 @@
17873
17945
  </xsl:template>
17874
17946
 
17875
17947
  <xsl:template name="setIDforNamedDestination">
17876
- <xsl:if test="@named_dest">
17877
- <xsl:attribute name="id"><xsl:value-of select="@named_dest"/></xsl:attribute>
17948
+ <xsl:if test="$isGenerateTableIF = 'false'">
17949
+ <xsl:if test="@named_dest">
17950
+ <xsl:attribute name="id"><xsl:value-of select="@named_dest"/></xsl:attribute>
17951
+ </xsl:if>
17878
17952
  </xsl:if>
17879
17953
  </xsl:template>
17880
17954
 
17881
17955
  <xsl:template name="setIDforNamedDestinationInline">
17882
- <xsl:if test="@named_dest">
17883
- <fo:inline><xsl:call-template name="setIDforNamedDestination"/></fo:inline>
17956
+ <xsl:if test="$isGenerateTableIF = 'false'">
17957
+ <xsl:if test="@named_dest">
17958
+ <fo:inline><xsl:call-template name="setIDforNamedDestination"/></fo:inline>
17959
+ </xsl:if>
17884
17960
  </xsl:if>
17885
17961
  </xsl:template>
17886
17962
 
@@ -17890,7 +17966,7 @@
17890
17966
  <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'">
17891
17967
  <fox:destination internal-destination="{@id}"/>
17892
17968
  </xsl:if>
17893
- <xsl:for-each select=". | mn:fmt-title | mn:fmt-name">
17969
+ <xsl:for-each select=". | mn:fmt-title[1] | mn:fmt-name[1]">
17894
17970
  <xsl:if test="@named_dest">
17895
17971
  <fox:destination internal-destination="{@named_dest}"/>
17896
17972
  </xsl:if>
@@ -17898,6 +17974,12 @@
17898
17974
  </xsl:if>
17899
17975
  </xsl:template>
17900
17976
 
17977
+ <xsl:template name="copyParagraphId">
17978
+ <xsl:if test="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'">
17979
+ <xsl:copy-of select="@id"/>
17980
+ </xsl:if>
17981
+ </xsl:template>
17982
+
17901
17983
  <xsl:template name="add-letter-spacing">
17902
17984
  <xsl:param name="text"/>
17903
17985
  <xsl:param name="letter-spacing" select="'0.15'"/>
@@ -18120,7 +18202,7 @@
18120
18202
  <xsl:template name="insertCoverPageFullImage">
18121
18203
  <xsl:param name="name">coverpage-image</xsl:param>
18122
18204
  <xsl:for-each select="//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/*[local-name() = $name][1]/mn:image">
18123
- <fo:page-sequence master-reference="cover-page" force-page-count="no-force">
18205
+ <fo:page-sequence master-reference="cover-page" force-page-count="no-force" initial-page-number="1">
18124
18206
  <fo:flow flow-name="xsl-region-body">
18125
18207
  <xsl:call-template name="insertBackgroundPageImage">
18126
18208
  <xsl:with-param name="number" select="position()"/>
@@ -18584,6 +18666,18 @@
18584
18666
  </xsl:attribute>
18585
18667
  </xsl:template>
18586
18668
 
18669
+ <xsl:template name="insert_firstpage_id">
18670
+ <xsl:param name="num"/>
18671
+ <fo:wrapper role="artifact">
18672
+ <fo:block-container absolute-position="fixed" top="1mm">
18673
+ <xsl:if test="$num = 1">
18674
+ <xsl:attribute name="id">firstpage_id_0</xsl:attribute>
18675
+ </xsl:if>
18676
+ <fo:block id="firstpage_id_{$num}" role="SKIP"> </fo:block>
18677
+ </fo:block-container>
18678
+ </fo:wrapper>
18679
+ </xsl:template>
18680
+
18587
18681
  <xsl:template name="getCharByCodePoint">
18588
18682
  <xsl:param name="codepoint"/>
18589
18683
  <xsl:param name="radix">16</xsl:param>
@@ -5,6 +5,8 @@
5
5
  <!-- mandatory 'key' -->
6
6
  <xsl:key name="kfn" match="mn:fn[not(ancestor::*[self::mn:table or self::mn:figure or self::mn:localized-strings] and not(ancestor::mn:fmt-name))]" use="@reference"/>
7
7
 
8
+ <xsl:key name="kid" match="*" use="@id"/>
9
+
8
10
  <!-- mandatory variable -->
9
11
 
10
12
  <!-- mandatory variable -->
@@ -16,10 +18,10 @@
16
18
  <xsl:for-each select="//mn:metanorma">
17
19
  <xsl:variable name="num"><xsl:number level="any" count="mn:metanorma"/></xsl:variable>
18
20
  <xsl:variable name="docnumber"><xsl:value-of select="mn:bibdata/mn:docidentifier[@type = 'IEEE']"/></xsl:variable>
19
- <!-- <xsl:variable name="current_document">
21
+ <xsl:variable name="current_document">
20
22
  <xsl:copy-of select="."/>
21
- </xsl:variable> -->
22
- <xsl:for-each select="."> <!-- xalan:nodeset($current_document) -->
23
+ </xsl:variable>
24
+ <xsl:for-each select="xalan:nodeset($current_document)">
23
25
  <mnx:doc num="{$num}" firstpage_id="firstpage_id_{$num}" title-part="{$docnumber}" bundle="{$bundle}"> <!-- 'bundle' means several different documents (not language versions) in one xml -->
24
26
  <mnx:contents>
25
27
  <xsl:call-template name="processPrefaceSectionsDefault_Contents"/>
@@ -1351,6 +1353,7 @@
1351
1353
 
1352
1354
  <xsl:if test="count(*) = 1 and mn:fmt-title"> <!-- if there isn't user ToC -->
1353
1355
  <fo:block role="TOC">
1356
+ <xsl:copy-of select="@id"/>
1354
1357
  <xsl:if test="$contents/mnx:doc[@num = $num]//mnx:item[@display = 'true']">
1355
1358
  <xsl:choose>
1356
1359
  <xsl:when test="$current_template = 'standard' or $current_template = 'draft'">
@@ -1885,6 +1888,7 @@
1885
1888
  </xsl:template>
1886
1889
 
1887
1890
  <xsl:template match="mn:abstract">
1891
+ <xsl:call-template name="setNamedDestination"/>
1888
1892
  <fo:block>
1889
1893
  <xsl:call-template name="setId"/>
1890
1894
  <xsl:call-template name="addReviewHelper"/>
@@ -2278,6 +2282,7 @@
2278
2282
  </xsl:template>
2279
2283
 
2280
2284
  <xsl:template match="mn:introduction | mn:foreword | mn:acknowledgements">
2285
+ <xsl:call-template name="setNamedDestination"/>
2281
2286
  <fo:block>
2282
2287
  <xsl:call-template name="setId"/>
2283
2288
  <xsl:call-template name="addReviewHelper"/>
@@ -2358,6 +2363,8 @@
2358
2363
  <xsl:call-template name="extractSection"/>
2359
2364
  </xsl:variable>
2360
2365
 
2366
+ <xsl:call-template name="setNamedDestination"/>
2367
+
2361
2368
  <xsl:choose>
2362
2369
  <xsl:when test="string-length($section) != 0 and $element-name = 'fo:block' and ($current_template = 'whitepaper' or $current_template = 'icap-whitepaper' or $current_template = 'industry-connection-report') and not(parent::mn:references[not(@normative='true')])">
2363
2370
  <fo:list-block>
@@ -2372,6 +2379,7 @@
2372
2379
  <xsl:if test="$level = 1">
2373
2380
  <xsl:attribute name="color"><xsl:value-of select="$color_blue"/></xsl:attribute>
2374
2381
  </xsl:if>
2382
+ <xsl:call-template name="setIDforNamedDestinationInline"/>
2375
2383
  <xsl:value-of select="$section"/>
2376
2384
  </fo:block>
2377
2385
  </fo:list-item-label>
@@ -2405,6 +2413,8 @@
2405
2413
  </xsl:apply-templates>
2406
2414
  </xsl:if>
2407
2415
 
2416
+ <xsl:call-template name="setIDforNamedDestinationInline"/>
2417
+
2408
2418
  <xsl:apply-templates/>
2409
2419
  <xsl:apply-templates select="following-sibling::*[1][self::mn:variant-title][@type = 'sub']" mode="subtitle"/>
2410
2420
  </xsl:element>
@@ -2470,6 +2480,8 @@
2470
2480
  </xsl:choose>
2471
2481
  </xsl:variable>
2472
2482
 
2483
+ <xsl:call-template name="setNamedDestination"/>
2484
+
2473
2485
  <fo:block margin-bottom="16pt">
2474
2486
  <!-- <xsl:if test="@ancestor = 'sections' and $level &gt; 2"> -->
2475
2487
  <xsl:if test="$level &gt; 2">
@@ -2482,6 +2494,7 @@
2482
2494
  <xsl:attribute name="margin-bottom">2pt</xsl:attribute>
2483
2495
  </xsl:if>
2484
2496
  <!-- term/name -->
2497
+ <xsl:call-template name="setIDforNamedDestination"/>
2485
2498
  <xsl:apply-templates select="mn:fmt-name"/>
2486
2499
  <xsl:text> </xsl:text>
2487
2500
  <xsl:apply-templates select="mn:fmt-preferred"/>
@@ -2519,6 +2532,7 @@
2519
2532
  <!-- ====== -->
2520
2533
 
2521
2534
  <xsl:template match="mn:annex" priority="2">
2535
+ <xsl:call-template name="setNamedDestination"/>
2522
2536
  <fo:block id="{@id}">
2523
2537
  </fo:block>
2524
2538
  <xsl:apply-templates/>
@@ -2544,6 +2558,8 @@
2544
2558
  </xsl:choose>
2545
2559
  </xsl:variable> -->
2546
2560
 
2561
+ <xsl:call-template name="setNamedDestination"/>
2562
+
2547
2563
  <xsl:variable name="p_styles">
2548
2564
  <styles xsl:use-attribute-sets="p-style">
2549
2565
  <xsl:call-template name="refine_p-style"><xsl:with-param name="element-name" select="$element-name"/></xsl:call-template>
@@ -4548,6 +4564,46 @@
4548
4564
  </xsl:template>
4549
4565
 
4550
4566
  <xsl:template name="addNamedDestinationAttribute">
4567
+ <xsl:variable name="docnum"><xsl:number level="any" count="mn:metanorma"/></xsl:variable>
4568
+ <xsl:variable name="caption_label" select="translate(normalize-space(.//mn:span[@class = 'fmt-caption-label']), ' ()', '')"/>
4569
+
4570
+ <xsl:variable name="named_dest_">
4571
+ <xsl:choose>
4572
+ <xsl:when test="count(ancestor::mn:figure) &gt; 1"/> <!-- prevent id 'a)' -->
4573
+ <xsl:when test="ancestor::mn:note or ancestor::mn:example or ancestor::mn:termnote or ancestor::mn:termexample or ancestor::mn:admonition"/>
4574
+ <xsl:when test="$caption_label = '' and parent::mn:foreword">
4575
+ <xsl:variable name="foreword_number"><xsl:number count="mn:foreword" level="any"/></xsl:variable>
4576
+ <xsl:if test="$foreword_number = 1">Foreword</xsl:if>
4577
+ </xsl:when>
4578
+ <xsl:when test="$caption_label = '' and parent::mn:introduction">
4579
+ <xsl:variable name="introduction_number"><xsl:number count="mn:introduction" level="any"/></xsl:variable>
4580
+ <xsl:if test="$introduction_number = 1">Introduction</xsl:if>
4581
+ </xsl:when>
4582
+ <xsl:when test="$caption_label = ''"/>
4583
+ <xsl:when test="../@unnumbered = 'true'"/>
4584
+ <xsl:when test="normalize-space(java:matches(java:java.lang.String.new($caption_label), '[\x21-\xFF]+')) = 'false'"/>
4585
+ <!-- 1.1 in Appendix 1 -->
4586
+ <xsl:otherwise>
4587
+ <xsl:if test="ancestor::mn:annex and string(number(substring($caption_label, 1, 1))) != 'NaN'">
4588
+ <xsl:variable name="annex_caption_label" select="translate(normalize-space(ancestor::mn:annex[1]/mn:fmt-title//mn:span[@class = 'fmt-caption-label']), ' ()', '')"/>
4589
+ <xsl:value-of select="concat($annex_caption_label, '_')"/>
4590
+ </xsl:if>
4591
+ <xsl:if test="parent::mn:formula">Formula</xsl:if>
4592
+ <xsl:value-of select="$caption_label"/>
4593
+ </xsl:otherwise>
4594
+ </xsl:choose>
4595
+ </xsl:variable>
4596
+ <xsl:variable name="named_dest" select="normalize-space($named_dest_)"/>
4597
+ <xsl:if test="$named_dest != ''">
4598
+ <xsl:variable name="named_dest_doc_">
4599
+ <xsl:value-of select="$named_dest"/>
4600
+ <xsl:if test="$docnum != '1'">_<xsl:value-of select="$docnum"/></xsl:if>
4601
+ </xsl:variable>
4602
+ <xsl:variable name="named_dest_doc" select="normalize-space($named_dest_doc_)"/>
4603
+ <xsl:if test="not(key('kid', $named_dest_doc))"> <!-- if element with id '$named_dest_doc' doesn't exist in the document -->
4604
+ <xsl:attribute name="named_dest"><xsl:value-of select="normalize-space($named_dest_doc)"/></xsl:attribute>
4605
+ </xsl:if>
4606
+ </xsl:if>
4551
4607
  </xsl:template>
4552
4608
 
4553
4609
  <xsl:template match="mn:fmt-name" mode="update_xml_step1">
@@ -5617,9 +5673,11 @@
5617
5673
  </xsl:template>
5618
5674
 
5619
5675
  <xsl:template match="mn:feedback-statement//mn:p">
5676
+ <xsl:param name="skip_id">false</xsl:param>
5620
5677
  <xsl:param name="margin"/>
5621
5678
  <!-- process in the template 'paragraph' -->
5622
5679
  <xsl:call-template name="paragraph">
5680
+ <xsl:with-param name="skip_id" select="$skip_id"/>
5623
5681
  <xsl:with-param name="margin" select="$margin"/>
5624
5682
  </xsl:call-template>
5625
5683
  </xsl:template>
@@ -12042,7 +12100,12 @@
12042
12100
  <xsl:template match="mn:figure[@class = 'pseudocode']">
12043
12101
  <xsl:call-template name="setNamedDestination"/>
12044
12102
  <fo:block id="{@id}">
12045
- <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
12103
+ <fo:block role="SKIP">
12104
+ <xsl:for-each select="mn:fmt-name"> <!-- set context -->
12105
+ <xsl:call-template name="setIDforNamedDestination"/>
12106
+ </xsl:for-each>
12107
+ <xsl:apply-templates select="node()[not(self::mn:fmt-name)]"/>
12108
+ </fo:block>
12046
12109
  </fo:block>
12047
12110
  <xsl:apply-templates select="mn:fmt-name"/>
12048
12111
  </xsl:template>
@@ -14705,7 +14768,7 @@
14705
14768
  </xsl:variable>
14706
14769
 
14707
14770
  <xsl:template name="index-pages">
14708
- <xsl:variable name="num"><xsl:number level="any" count="mn:metanorma"/></xsl:variable>
14771
+ <xsl:param name="num"/>
14709
14772
 
14710
14773
  <xsl:variable name="docid">
14711
14774
  <xsl:call-template name="getDocumentId"/>
@@ -16657,6 +16720,15 @@
16657
16720
  </xsl:if>
16658
16721
  </xsl:template>
16659
16722
 
16723
+ <!-- debug templates -->
16724
+ <xsl:template name="debug_contents">
16725
+ <xsl:if test="$debug = 'true'">
16726
+ <redirect:write file="contents_.xml"> <!-- {java:getTime(java:java.util.Date.new())} -->
16727
+ <xsl:copy-of select="$contents"/>
16728
+ </redirect:write>
16729
+ </xsl:if>
16730
+ </xsl:template>
16731
+
16660
16732
  <xsl:template name="processPrefaceSectionsDefault">
16661
16733
  <xsl:param name="num"/>
16662
16734
  <xsl:for-each select="/*/mn:preface/*[not(self::mn:note or self::mn:admonition)]">
@@ -17873,14 +17945,18 @@
17873
17945
  </xsl:template>
17874
17946
 
17875
17947
  <xsl:template name="setIDforNamedDestination">
17876
- <xsl:if test="@named_dest">
17877
- <xsl:attribute name="id"><xsl:value-of select="@named_dest"/></xsl:attribute>
17948
+ <xsl:if test="$isGenerateTableIF = 'false'">
17949
+ <xsl:if test="@named_dest">
17950
+ <xsl:attribute name="id"><xsl:value-of select="@named_dest"/></xsl:attribute>
17951
+ </xsl:if>
17878
17952
  </xsl:if>
17879
17953
  </xsl:template>
17880
17954
 
17881
17955
  <xsl:template name="setIDforNamedDestinationInline">
17882
- <xsl:if test="@named_dest">
17883
- <fo:inline><xsl:call-template name="setIDforNamedDestination"/></fo:inline>
17956
+ <xsl:if test="$isGenerateTableIF = 'false'">
17957
+ <xsl:if test="@named_dest">
17958
+ <fo:inline><xsl:call-template name="setIDforNamedDestination"/></fo:inline>
17959
+ </xsl:if>
17884
17960
  </xsl:if>
17885
17961
  </xsl:template>
17886
17962
 
@@ -17890,7 +17966,7 @@
17890
17966
  <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'">
17891
17967
  <fox:destination internal-destination="{@id}"/>
17892
17968
  </xsl:if>
17893
- <xsl:for-each select=". | mn:fmt-title | mn:fmt-name">
17969
+ <xsl:for-each select=". | mn:fmt-title[1] | mn:fmt-name[1]">
17894
17970
  <xsl:if test="@named_dest">
17895
17971
  <fox:destination internal-destination="{@named_dest}"/>
17896
17972
  </xsl:if>
@@ -17898,6 +17974,12 @@
17898
17974
  </xsl:if>
17899
17975
  </xsl:template>
17900
17976
 
17977
+ <xsl:template name="copyParagraphId">
17978
+ <xsl:if test="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'">
17979
+ <xsl:copy-of select="@id"/>
17980
+ </xsl:if>
17981
+ </xsl:template>
17982
+
17901
17983
  <xsl:template name="add-letter-spacing">
17902
17984
  <xsl:param name="text"/>
17903
17985
  <xsl:param name="letter-spacing" select="'0.15'"/>
@@ -18120,7 +18202,7 @@
18120
18202
  <xsl:template name="insertCoverPageFullImage">
18121
18203
  <xsl:param name="name">coverpage-image</xsl:param>
18122
18204
  <xsl:for-each select="//mn:metanorma/mn:metanorma-extension/mn:presentation-metadata/*[local-name() = $name][1]/mn:image">
18123
- <fo:page-sequence master-reference="cover-page" force-page-count="no-force">
18205
+ <fo:page-sequence master-reference="cover-page" force-page-count="no-force" initial-page-number="1">
18124
18206
  <fo:flow flow-name="xsl-region-body">
18125
18207
  <xsl:call-template name="insertBackgroundPageImage">
18126
18208
  <xsl:with-param name="number" select="position()"/>
@@ -18584,6 +18666,18 @@
18584
18666
  </xsl:attribute>
18585
18667
  </xsl:template>
18586
18668
 
18669
+ <xsl:template name="insert_firstpage_id">
18670
+ <xsl:param name="num"/>
18671
+ <fo:wrapper role="artifact">
18672
+ <fo:block-container absolute-position="fixed" top="1mm">
18673
+ <xsl:if test="$num = 1">
18674
+ <xsl:attribute name="id">firstpage_id_0</xsl:attribute>
18675
+ </xsl:if>
18676
+ <fo:block id="firstpage_id_{$num}" role="SKIP"> </fo:block>
18677
+ </fo:block-container>
18678
+ </fo:wrapper>
18679
+ </xsl:template>
18680
+
18587
18681
  <xsl:template name="getCharByCodePoint">
18588
18682
  <xsl:param name="codepoint"/>
18589
18683
  <xsl:param name="radix">16</xsl:param>
@@ -51,7 +51,9 @@ module IsoDoc
51
51
  template: "{{ creatornames }}",
52
52
  extenttemplate: { (bib["type"] || "misc").to_sym => "{{page}}" },
53
53
  sizetemplate: { (bib["type"] || "misc").to_sym => "{{data}}" })
54
- .render1(RelatonBib::XMLParser.from_xml(bib.to_xml), false)
54
+ .render1(Relaton::Bib::Bibitem.from_xml(
55
+ Nokogiri::XML(bib.to_xml).tap(&:remove_namespaces!).root.to_xml,
56
+ ), false)
55
57
  end
56
58
 
57
59
  def bibliography_bibitem_number1(bibitem, idx, normative)
@@ -35,6 +35,7 @@ module Metanorma
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
+ warn @c.decode("#{name} #{title} #{docid}").strip.downcase
38
39
  @c.decode("#{name} #{title} #{docid}").strip.downcase
39
40
  end
40
41
 
@@ -53,7 +54,7 @@ module Metanorma
53
54
  end
54
55
 
55
56
  def designator_docid(bib)
56
- n = bib.at("./docidentifier[@primary]") ||
57
+ n = bib.at("./docidentifier[@primary = 'true']") ||
57
58
  bib.at("./docidentifier[not(#{@conv.skip_docid})]")
58
59
  n or return "ZZZZ"
59
60
  @isodoc.docid_prefix(n["type"], n.children.to_xml)
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ieee
3
- VERSION = "1.6.7".freeze
3
+ VERSION = "1.6.8".freeze
4
4
  end
5
5
  end
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
25
25
  spec.require_paths = ["lib"]
26
26
  spec.required_ruby_version = Gem::Requirement.new(">= 3.1.0")
27
27
 
28
- spec.add_dependency "metanorma-standoc", "~> 3.3.1"
28
+ spec.add_dependency "metanorma-standoc", "~> 3.4.0"
29
29
  spec.add_dependency "mnconvert", "~> 1.20"
30
30
  spec.add_dependency "pubid"
31
31
 
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.6.7
4
+ version: 1.6.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2026-03-30 00:00:00.000000000 Z
11
+ date: 2026-04-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-standoc
@@ -16,14 +16,14 @@ dependencies:
16
16
  requirements:
17
17
  - - "~>"
18
18
  - !ruby/object:Gem::Version
19
- version: 3.3.1
19
+ version: 3.4.0
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - "~>"
25
25
  - !ruby/object:Gem::Version
26
- version: 3.3.1
26
+ version: 3.4.0
27
27
  - !ruby/object:Gem::Dependency
28
28
  name: mnconvert
29
29
  requirement: !ruby/object:Gem::Requirement