metanorma-ribose 2.0.4 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 9a21ab68ff679fa7e137987eb42da1fe84a3395e0aa4289464a689a7601c2584
4
- data.tar.gz: 5c241f3b5a64623f02d3fd82e48cb9f99da6dd1d3bde0a00aba4932418d31483
3
+ metadata.gz: 1410aafb9e282300aecc28aa9fe281b12398159458a5236aad424e50c836db04
4
+ data.tar.gz: 2d0916cbe4bb8e2dc51e5995da05e9916765295077bc8f9dd052b547bf930580
5
5
  SHA512:
6
- metadata.gz: 24cc694393250970b0c8db8374d7be4c52b3ca473d42cb5e6d1ff6a223d25aa534d435816e0e354dd5b59fcfddab7e10038c478c884d1aa6ce603cd4e2d58b66
7
- data.tar.gz: 11d88a39e147a99cf54fa845f58b69284681483a45f737c5cc83eccbf7cb624aa1cc3f907f17fd87b6af4c1d264319677294427de903b3cf170c1b365b418045
6
+ metadata.gz: 10c99f1cdad23636725a3bc53a5c41e93933b6b01a1f8cceeb61475648f1611cd9f298e1ce12b7f7c6ad1892f98d30e34e1771d3868ec9002e7959abba2a0bc8
7
+ data.tar.gz: 292bc237131ffaa3f1b75306f9b3a82db161a3d84bdfb3199b581b22fc37cc47d7b5af38bf9b642a957f832358b8112eaee7d0e894d3298bb79eb3210a9e1f03
@@ -857,6 +857,26 @@ p.Tablebody, li.Tablebody, div.Tablebody {
857
857
  mso-bidi-font-family: {{bodyfont}};
858
858
  mso-ansi-language: EN-GB; }
859
859
 
860
+ p.TOCTitle, li.TOCTitle, div.TOCTitle {
861
+ mso-style-name: "TOC Title";
862
+ mso-style-unhide: no;
863
+ margin-top: 0in;
864
+ margin-right: 0in;
865
+ margin-bottom: {{normalfontsize}};
866
+ margin-left: 0in;
867
+ text-align: left;
868
+ page-break-after: avoid;
869
+ mso-pagination: none;
870
+ mso-hyphenate: none;
871
+ mso-layout-grid-align: none;
872
+ font-size: {{normalfontsize}};
873
+ mso-bidi-font-size: 10.0pt;
874
+ font-weight: bold;
875
+ font-family: {{headerfont}};
876
+ mso-fareast-font-family: {{headerfont}};
877
+ mso-bidi-font-family: {{headerfont}};
878
+ mso-fareast-language: EN-US; }
879
+
860
880
  /* Page Definitions */
861
881
  @page {
862
882
  size: 612.0pt 792.0pt;
@@ -806,6 +806,25 @@ p.Tablebody, li.Tablebody, div.Tablebody
806
806
  mso-fareast-font-family:$bodyfont;
807
807
  mso-bidi-font-family:$bodyfont;
808
808
  mso-ansi-language:EN-GB;}
809
+ p.TOCTitle, li.TOCTitle, div.TOCTitle
810
+ {mso-style-name:"TOC Title";
811
+ mso-style-unhide:no;
812
+ margin-top:0in;
813
+ margin-right:0in;
814
+ margin-bottom:$normalfontsize;
815
+ margin-left:0in;
816
+ text-align:left;
817
+ page-break-after:avoid;
818
+ mso-pagination:none;
819
+ mso-hyphenate:none;
820
+ mso-layout-grid-align:none;
821
+ font-size:$normalfontsize;
822
+ mso-bidi-font-size:10.0pt;
823
+ font-weight:bold;
824
+ font-family:$headerfont;
825
+ mso-fareast-font-family:$headerfont;
826
+ mso-bidi-font-family:$headerfont;
827
+ mso-fareast-language:EN-US;}
809
828
 
810
829
 
811
830
  /* Page Definitions */
@@ -20,7 +20,7 @@
20
20
  </xsl:variable>
21
21
 
22
22
 
23
- <xsl:variable name="contents">
23
+ <xsl:variable name="contents_">
24
24
  <contents>
25
25
 
26
26
  <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:abstract" mode="contents"/>
@@ -32,9 +32,10 @@
32
32
 
33
33
  <xsl:call-template name="processMainSectionsDefault_Contents"/>
34
34
 
35
+ <xsl:call-template name="processTablesFigures_Contents"/>
35
36
  </contents>
36
37
  </xsl:variable>
37
-
38
+ <xsl:variable name="contents" select="xalan:nodeset($contents_)"/>
38
39
 
39
40
  <xsl:variable name="docnumber_version">
40
41
  <xsl:value-of select="/rsd:rsd-standard/rsd:bibdata/rsd:docidentifier[@type = 'rsd' or @type = 'Ribose']"/>
@@ -399,7 +400,7 @@
399
400
  <fo:page-sequence master-reference="document" force-page-count="no-force"> <!-- master-reference="toc" -->
400
401
  <xsl:call-template name="insertHeaderFooter"/>
401
402
  <fo:flow flow-name="xsl-region-body">
402
- <xsl:if test="xalan:nodeset($contents)//item[@display = 'true']">
403
+ <xsl:if test="$contents//item[@display = 'true']">
403
404
  <fo:block role="TOC">
404
405
  <!-- <fo:block-container absolute-position="fixed" left="13mm" top="15mm"> -->
405
406
  <fo:block font-size="27pt" font-weight="bold" color="black" margin-left="-15mm" margin-bottom="13mm" role="H1">
@@ -411,7 +412,7 @@
411
412
 
412
413
  <fo:block-container margin-left="32mm" margin-right="-17mm">
413
414
  <fo:block-container margin-left="0mm" margin-right="0mm">
414
- <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']">
415
+ <xsl:for-each select="$contents//item[@display = 'true']">
415
416
  <fo:block font-size="13pt" role="TOCI">
416
417
  <xsl:if test="@level = 1">
417
418
  <xsl:if test="preceding-sibling::item[@display = 'true' and @level = 1]">
@@ -434,13 +435,34 @@
434
435
  <xsl:apply-templates select="title"/>
435
436
  <xsl:text>  </xsl:text>
436
437
  <fo:inline>
437
- <fo:leader leader-pattern="rule" rule-thickness="0.2mm"/>
438
- <fo:inline padding-left="2mm"><fo:page-number-citation ref-id="{@id}"/></fo:inline>
439
- </fo:inline>
438
+ <fo:leader leader-pattern="rule" rule-thickness="0.2mm"/>
439
+ <fo:inline padding-left="2mm"><fo:page-number-citation ref-id="{@id}"/></fo:inline>
440
+ </fo:inline>
440
441
  </fo:basic-link>
441
442
  </fo:block>
442
443
  </fo:block>
443
444
  </xsl:for-each>
445
+
446
+ <!-- List of Tables -->
447
+ <xsl:if test="$contents//tables/table">
448
+ <xsl:call-template name="insertListOf_Title">
449
+ <xsl:with-param name="title" select="$title-list-tables"/>
450
+ </xsl:call-template>
451
+ <xsl:for-each select="$contents//tables/table">
452
+ <xsl:call-template name="insertListOf_Item"/>
453
+ </xsl:for-each>
454
+ </xsl:if>
455
+
456
+ <!-- List of Figures -->
457
+ <xsl:if test="$contents//figures/figure">
458
+ <xsl:call-template name="insertListOf_Title">
459
+ <xsl:with-param name="title" select="$title-list-figures"/>
460
+ </xsl:call-template>
461
+ <xsl:for-each select="$contents//figures/figure">
462
+ <xsl:call-template name="insertListOf_Item"/>
463
+ </xsl:for-each>
464
+ </xsl:if>
465
+
444
466
  </fo:block-container>
445
467
  </fo:block-container>
446
468
  </fo:block>
@@ -485,6 +507,30 @@
485
507
  </fo:root>
486
508
  </xsl:template>
487
509
 
510
+ <xsl:template name="insertListOf_Title">
511
+ <xsl:param name="title"/>
512
+ <fo:block font-size="13pt" font-weight="bold" color="black" margin-top="12pt" margin-bottom="12pt" keep-with-next="always">
513
+ <xsl:value-of select="$title"/>
514
+ </fo:block>
515
+ </xsl:template>
516
+
517
+ <xsl:template name="insertListOf_Item">
518
+ <fo:block font-size="13pt" role="TOCI" margin-left="16.5mm" space-before="4pt" space-after="5pt">
519
+ <fo:block text-align-last="justify">
520
+ <fo:basic-link internal-destination="{@id}">
521
+ <xsl:call-template name="setAltText">
522
+ <xsl:with-param name="value" select="@alt-text"/>
523
+ </xsl:call-template>
524
+ <xsl:apply-templates select="." mode="contents"/>
525
+ <xsl:text>  </xsl:text>
526
+ <fo:inline>
527
+ <fo:leader leader-pattern="rule" rule-thickness="0.2mm"/>
528
+ <fo:inline padding-left="2mm"><fo:page-number-citation ref-id="{@id}"/></fo:inline>
529
+ </fo:inline>
530
+ </fo:basic-link>
531
+ </fo:block>
532
+ </fo:block>
533
+ </xsl:template>
488
534
 
489
535
  <xsl:template match="rsd:title" mode="cover_page">
490
536
  <xsl:apply-templates/>
@@ -1163,7 +1209,7 @@
1163
1209
 
1164
1210
 
1165
1211
 
1166
- <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:variable name="lang">
1212
+ <xsl:param name="svg_images"/><xsl:variable name="images" select="document($svg_images)"/><xsl:param name="basepath"/><xsl:param name="external_index"/><xsl:param name="syntax-highlight">false</xsl:param><xsl:key name="bibitems" match="*[local-name() = 'bibitem']" use="@id"/><xsl:key name="bibitems_hidden" match="*[local-name() = 'bibitem'][@hidden='true'] | *[local-name() = 'references'][@hidden='true']//*[local-name() = 'bibitem']" use="@id"/><xsl:variable name="lang">
1167
1213
  <xsl:call-template name="getLang"/>
1168
1214
  </xsl:variable><xsl:variable name="pageWidth_">
1169
1215
  215.9
@@ -1207,7 +1253,7 @@
1207
1253
  <xsl:text>Contents</xsl:text>
1208
1254
 
1209
1255
  </title-toc>
1210
-
1256
+
1211
1257
  <title-descriptors lang="en">Descriptors</title-descriptors>
1212
1258
 
1213
1259
  <title-part lang="en">
@@ -1243,7 +1289,31 @@
1243
1289
  <title-continued lang="en">(continued)</title-continued>
1244
1290
  <title-continued lang="fr">(continué)</title-continued>
1245
1291
 
1246
- </xsl:variable><xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="bibdata">
1292
+ </xsl:variable><xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="title-list-tables">
1293
+ <xsl:variable name="toc_table_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']"/>
1294
+ <xsl:value-of select="$toc_table_title"/>
1295
+ <xsl:if test="normalize-space($toc_table_title) = ''">
1296
+ <xsl:call-template name="getTitle">
1297
+ <xsl:with-param name="name" select="'title-list-tables'"/>
1298
+ </xsl:call-template>
1299
+ </xsl:if>
1300
+ </xsl:variable><xsl:variable name="title-list-figures">
1301
+ <xsl:variable name="toc_figure_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']"/>
1302
+ <xsl:value-of select="$toc_figure_title"/>
1303
+ <xsl:if test="normalize-space($toc_figure_title) = ''">
1304
+ <xsl:call-template name="getTitle">
1305
+ <xsl:with-param name="name" select="'title-list-figures'"/>
1306
+ </xsl:call-template>
1307
+ </xsl:if>
1308
+ </xsl:variable><xsl:variable name="title-list-recommendations">
1309
+ <xsl:variable name="toc_requirement_title" select="//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='requirement']/*[local-name() = 'title']"/>
1310
+ <xsl:value-of select="$toc_requirement_title"/>
1311
+ <xsl:if test="normalize-space($toc_requirement_title) = ''">
1312
+ <xsl:call-template name="getTitle">
1313
+ <xsl:with-param name="name" select="'title-list-recommendations'"/>
1314
+ </xsl:call-template>
1315
+ </xsl:if>
1316
+ </xsl:variable><xsl:variable name="bibdata">
1247
1317
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
1248
1318
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
1249
1319
  </xsl:variable><xsl:variable name="linebreak">&#8232;</xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:variable name="non_breaking_hyphen">‑</xsl:variable><xsl:variable name="thin_space"> </xsl:variable><xsl:variable name="zero_width_space">​</xsl:variable><xsl:variable name="en_dash">–</xsl:variable><xsl:template name="getTitle">
@@ -2551,6 +2621,30 @@
2551
2621
  <xsl:sort select="@displayorder" data-type="number"/>
2552
2622
  <xsl:apply-templates select="." mode="contents"/>
2553
2623
  </xsl:for-each>
2624
+ </xsl:template><xsl:template name="processTablesFigures_Contents">
2625
+ <xsl:param name="always"/>
2626
+ <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='table']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
2627
+ <xsl:call-template name="processTables_Contents"/>
2628
+ </xsl:if>
2629
+ <xsl:if test="(//*[contains(local-name(), '-standard')]/*[local-name() = 'misc-container']/*[local-name() = 'toc'][@type='figure']/*[local-name() = 'title']) or normalize-space($always) = 'true'">
2630
+ <xsl:call-template name="processFigures_Contents"/>
2631
+ </xsl:if>
2632
+ </xsl:template><xsl:template name="processTables_Contents">
2633
+ <tables>
2634
+ <xsl:for-each select="//*[local-name() = 'table'][@id and *[local-name() = 'name'] and normalize-space(@id) != '']">
2635
+ <table id="{@id}" alt-text="{*[local-name() = 'name']}">
2636
+ <xsl:copy-of select="*[local-name() = 'name']"/>
2637
+ </table>
2638
+ </xsl:for-each>
2639
+ </tables>
2640
+ </xsl:template><xsl:template name="processFigures_Contents">
2641
+ <figures>
2642
+ <xsl:for-each select="//*[local-name() = 'figure'][@id and *[local-name() = 'name'] and not(@unnumbered = 'true') and normalize-space(@id) != ''] | //*[@id and starts-with(*[local-name() = 'name'], 'Figure ') and normalize-space(@id) != '']">
2643
+ <figure id="{@id}" alt-text="{*[local-name() = 'name']}">
2644
+ <xsl:copy-of select="*[local-name() = 'name']"/>
2645
+ </figure>
2646
+ </xsl:for-each>
2647
+ </figures>
2554
2648
  </xsl:template><xsl:template name="processPrefaceSectionsDefault">
2555
2649
  <xsl:for-each select="/*/*[local-name()='preface']/*">
2556
2650
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -3331,37 +3425,7 @@
3331
3425
 
3332
3426
  <!-- list of footnotes to calculate actual footnotes number -->
3333
3427
  <xsl:variable name="p_fn_">
3334
- <xsl:choose>
3335
- <xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
3336
- <fn gen_id="{generate-id(.)}">
3337
- <xsl:copy-of select="@*"/>
3338
- <xsl:copy-of select="node()"/>
3339
- </fn>
3340
- </xsl:when>
3341
- <xsl:otherwise>
3342
- <!-- itetation for:
3343
- footnotes in bibdata/title
3344
- footnotes in bibliography
3345
- footnotes in document's body (except table's head/body/foot and figure text)
3346
- -->
3347
- <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
3348
- <fn gen_id="{generate-id(.)}">
3349
- <xsl:copy-of select="@*"/>
3350
- <xsl:copy-of select="node()"/>
3351
- </fn>
3352
- </xsl:for-each>
3353
- <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='preface']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='sections']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='annex'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*">
3354
- <xsl:sort select="@displayorder" data-type="number"/>
3355
- <xsl:for-each select=".//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] | .//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
3356
- <!-- copy unique fn -->
3357
- <fn gen_id="{generate-id(.)}">
3358
- <xsl:copy-of select="@*"/>
3359
- <xsl:copy-of select="node()"/>
3360
- </fn>
3361
- </xsl:for-each>
3362
- </xsl:for-each>
3363
- </xsl:otherwise>
3364
- </xsl:choose>
3428
+ <xsl:call-template name="get_fn_list"/>
3365
3429
  </xsl:variable>
3366
3430
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
3367
3431
 
@@ -3422,6 +3486,38 @@
3422
3486
  <xsl:copy-of select="$footnote_inline"/>
3423
3487
  </xsl:otherwise>
3424
3488
  </xsl:choose>
3489
+ </xsl:template><xsl:template name="get_fn_list">
3490
+ <xsl:choose>
3491
+ <xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
3492
+ <fn gen_id="{generate-id(.)}">
3493
+ <xsl:copy-of select="@*"/>
3494
+ <xsl:copy-of select="node()"/>
3495
+ </fn>
3496
+ </xsl:when>
3497
+ <xsl:otherwise>
3498
+ <!-- itetation for:
3499
+ footnotes in bibdata/title
3500
+ footnotes in bibliography
3501
+ footnotes in document's body (except table's head/body/foot and figure text)
3502
+ -->
3503
+ <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
3504
+ <fn gen_id="{generate-id(.)}">
3505
+ <xsl:copy-of select="@*"/>
3506
+ <xsl:copy-of select="node()"/>
3507
+ </fn>
3508
+ </xsl:for-each>
3509
+ <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='preface']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='sections']/* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='annex'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*">
3510
+ <xsl:sort select="@displayorder" data-type="number"/>
3511
+ <xsl:for-each select=".//*[local-name() = 'bibitem'][ancestor::*[local-name() = 'references']]/*[local-name() = 'note'] | .//*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure') and not(ancestor::*[local-name() = 'name'])])][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
3512
+ <!-- copy unique fn -->
3513
+ <fn gen_id="{generate-id(.)}">
3514
+ <xsl:copy-of select="@*"/>
3515
+ <xsl:copy-of select="node()"/>
3516
+ </fn>
3517
+ </xsl:for-each>
3518
+ </xsl:for-each>
3519
+ </xsl:otherwise>
3520
+ </xsl:choose>
3425
3521
  </xsl:template><xsl:template name="table_fn_display">
3426
3522
  <xsl:variable name="references">
3427
3523
 
@@ -3593,7 +3689,7 @@
3593
3689
  </fo:inline>
3594
3690
  </xsl:template><xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
3595
3691
  <fo:inline><xsl:value-of select="."/></fo:inline>
3596
- </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
3692
+ </xsl:template><xsl:template match="*[local-name()='fn']//*[local-name()='p']">
3597
3693
  <fo:inline>
3598
3694
  <xsl:apply-templates/>
3599
3695
  </fo:inline>
@@ -5307,13 +5403,14 @@
5307
5403
  <xsl:apply-templates mode="bookmarks"/>
5308
5404
  </xsl:template><xsl:template name="addBookmarks">
5309
5405
  <xsl:param name="contents"/>
5310
- <xsl:if test="xalan:nodeset($contents)//item">
5406
+ <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
5407
+ <xsl:if test="$contents_nodes//item">
5311
5408
  <fo:bookmark-tree>
5312
5409
  <xsl:choose>
5313
- <xsl:when test="xalan:nodeset($contents)/doc">
5410
+ <xsl:when test="$contents_nodes/doc">
5314
5411
  <xsl:choose>
5315
- <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
5316
- <xsl:for-each select="xalan:nodeset($contents)/doc">
5412
+ <xsl:when test="count($contents_nodes/doc) &gt; 1">
5413
+ <xsl:for-each select="$contents_nodes/doc">
5317
5414
  <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
5318
5415
  <xsl:if test="@bundle = 'true'">
5319
5416
  <xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
@@ -5364,7 +5461,7 @@
5364
5461
  </xsl:for-each>
5365
5462
  </xsl:when>
5366
5463
  <xsl:otherwise>
5367
- <xsl:for-each select="xalan:nodeset($contents)/doc">
5464
+ <xsl:for-each select="$contents_nodes/doc">
5368
5465
 
5369
5466
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
5370
5467
 
@@ -5382,25 +5479,36 @@
5382
5479
  </xsl:choose>
5383
5480
  </xsl:when>
5384
5481
  <xsl:otherwise>
5385
- <xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
5482
+ <xsl:apply-templates select="$contents_nodes/contents/item" mode="bookmark"/>
5483
+
5484
+ <xsl:call-template name="insertFigureBookmarks">
5485
+ <xsl:with-param name="contents" select="$contents_nodes/contents"/>
5486
+ </xsl:call-template>
5487
+
5488
+ <xsl:call-template name="insertTableBookmarks">
5489
+ <xsl:with-param name="contents" select="$contents_nodes/contents"/>
5490
+ <xsl:with-param name="lang" select="@lang"/>
5491
+ </xsl:call-template>
5492
+
5386
5493
  </xsl:otherwise>
5387
5494
  </xsl:choose>
5388
5495
 
5496
+
5389
5497
 
5390
5498
 
5391
5499
 
5392
5500
 
5393
-
5394
-
5501
+
5395
5502
 
5396
5503
  </fo:bookmark-tree>
5397
5504
  </xsl:if>
5398
5505
  </xsl:template><xsl:template name="insertFigureBookmarks">
5399
5506
  <xsl:param name="contents"/>
5400
- <xsl:if test="xalan:nodeset($contents)/figure">
5401
- <fo:bookmark internal-destination="{xalan:nodeset($contents)/figure[1]/@id}" starting-state="hide">
5507
+ <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
5508
+ <xsl:if test="$contents_nodes/figure">
5509
+ <fo:bookmark internal-destination="{$contents_nodes/figure[1]/@id}" starting-state="hide">
5402
5510
  <fo:bookmark-title>Figures</fo:bookmark-title>
5403
- <xsl:for-each select="xalan:nodeset($contents)/figure">
5511
+ <xsl:for-each select="$contents_nodes/figure">
5404
5512
  <fo:bookmark internal-destination="{@id}">
5405
5513
  <fo:bookmark-title>
5406
5514
  <xsl:value-of select="normalize-space(title)"/>
@@ -5409,18 +5517,40 @@
5409
5517
  </xsl:for-each>
5410
5518
  </fo:bookmark>
5411
5519
  </xsl:if>
5520
+
5521
+
5522
+ <xsl:if test="$contents_nodes//figures/figure">
5523
+ <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
5524
+
5525
+
5526
+
5527
+ <xsl:variable name="bookmark-title">
5528
+
5529
+ <xsl:value-of select="$title-list-figures"/>
5530
+
5531
+ </xsl:variable>
5532
+ <fo:bookmark-title><xsl:value-of select="normalize-space($bookmark-title)"/></fo:bookmark-title>
5533
+ <xsl:for-each select="$contents_nodes//figures/figure">
5534
+ <fo:bookmark internal-destination="{@id}">
5535
+ <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title>
5536
+ </fo:bookmark>
5537
+ </xsl:for-each>
5538
+ </fo:bookmark>
5539
+ </xsl:if>
5540
+
5412
5541
  </xsl:template><xsl:template name="insertTableBookmarks">
5413
5542
  <xsl:param name="contents"/>
5414
5543
  <xsl:param name="lang"/>
5415
- <xsl:if test="xalan:nodeset($contents)/table">
5416
- <fo:bookmark internal-destination="{xalan:nodeset($contents)/table[1]/@id}" starting-state="hide">
5544
+ <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
5545
+ <xsl:if test="$contents_nodes/table">
5546
+ <fo:bookmark internal-destination="{$contents_nodes/table[1]/@id}" starting-state="hide">
5417
5547
  <fo:bookmark-title>
5418
5548
  <xsl:choose>
5419
5549
  <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
5420
5550
  <xsl:otherwise>Tables</xsl:otherwise>
5421
5551
  </xsl:choose>
5422
5552
  </fo:bookmark-title>
5423
- <xsl:for-each select="xalan:nodeset($contents)/table">
5553
+ <xsl:for-each select="$contents_nodes/table">
5424
5554
  <fo:bookmark internal-destination="{@id}">
5425
5555
  <fo:bookmark-title>
5426
5556
  <xsl:value-of select="normalize-space(title)"/>
@@ -5429,6 +5559,29 @@
5429
5559
  </xsl:for-each>
5430
5560
  </fo:bookmark>
5431
5561
  </xsl:if>
5562
+
5563
+
5564
+ <xsl:if test="$contents_nodes//tables/table">
5565
+ <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
5566
+
5567
+
5568
+
5569
+ <xsl:variable name="bookmark-title">
5570
+
5571
+ <xsl:value-of select="$title-list-tables"/>
5572
+
5573
+ </xsl:variable>
5574
+
5575
+ <fo:bookmark-title><xsl:value-of select="$bookmark-title"/></fo:bookmark-title>
5576
+
5577
+ <xsl:for-each select="$contents_nodes//tables/table">
5578
+ <fo:bookmark internal-destination="{@id}">
5579
+ <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title>
5580
+ </fo:bookmark>
5581
+ </xsl:for-each>
5582
+ </fo:bookmark>
5583
+ </xsl:if>
5584
+
5432
5585
  </xsl:template><xsl:template name="getLangVersion">
5433
5586
  <xsl:param name="lang"/>
5434
5587
  <xsl:param name="doctype" select="''"/>
@@ -6113,6 +6266,8 @@
6113
6266
  </xsl:otherwise>
6114
6267
  </xsl:choose> -->
6115
6268
  </fo:block>
6269
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()[starts-with(., '[SOURCE: Adapted from: ')]" priority="2">
6270
+ <xsl:text>[</xsl:text><xsl:value-of select="substring-after(., '[SOURCE: ')"/>
6116
6271
  </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
6117
6272
  <xsl:if test="normalize-space() != ''">
6118
6273
  <xsl:value-of select="."/>
@@ -6187,26 +6342,11 @@
6187
6342
  </xsl:template><xsl:template match="*[local-name() = 'author']">
6188
6343
  <xsl:text>— </xsl:text>
6189
6344
  <xsl:apply-templates/>
6190
- </xsl:template><xsl:variable name="bibitem_hidden_">
6191
- <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden='true']">
6192
- <xsl:copy-of select="."/>
6193
- </xsl:for-each>
6194
- <xsl:for-each select="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem']">
6195
- <xsl:copy-of select="."/>
6196
- </xsl:for-each>
6197
- </xsl:variable><xsl:variable name="bibitem_hidden" select="xalan:nodeset($bibitem_hidden_)"/><xsl:template match="*[local-name() = 'eref']">
6198
-
6199
- <xsl:variable name="bibitemid">
6200
- <xsl:choose>
6201
- <!-- <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"></xsl:when>
6202
- <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"></xsl:when> -->
6203
- <xsl:when test="$bibitem_hidden/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
6204
- <xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
6205
- </xsl:choose>
6206
- </xsl:variable>
6207
-
6345
+ </xsl:template><xsl:template match="*[local-name() = 'eref']">
6346
+ <xsl:variable name="current_bibitemid" select="@bibitemid"/>
6347
+ <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/>
6208
6348
  <xsl:choose>
6209
- <xsl:when test="normalize-space($bibitemid) != ''"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link -->
6349
+ <xsl:when test="$external-destination != '' or not(key('bibitems_hidden', $current_bibitemid))"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link (internal to the bibitem or external) -->
6210
6350
  <fo:inline xsl:use-attribute-sets="eref-style">
6211
6351
  <xsl:if test="@type = 'footnote'">
6212
6352
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
@@ -6220,8 +6360,8 @@
6220
6360
  <xsl:variable name="text" select="normalize-space()"/>
6221
6361
 
6222
6362
 
6223
-
6224
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
6363
+
6364
+ <fo:basic-link fox:alt-text="{@citeas}">
6225
6365
  <xsl:if test="normalize-space(@citeas) = ''">
6226
6366
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
6227
6367
  </xsl:if>
@@ -6231,14 +6371,21 @@
6231
6371
 
6232
6372
  </xsl:if>
6233
6373
 
6234
-
6374
+ <xsl:choose>
6375
+ <xsl:when test="$external-destination != ''"> <!-- external hyperlink -->
6376
+ <xsl:attribute name="external-destination"><xsl:value-of select="$external-destination"/></xsl:attribute>
6377
+ </xsl:when>
6378
+ <xsl:otherwise>
6379
+ <xsl:attribute name="internal-destination"><xsl:value-of select="@bibitemid"/></xsl:attribute>
6380
+ </xsl:otherwise>
6381
+ </xsl:choose>
6235
6382
 
6236
6383
  <xsl:apply-templates/>
6237
6384
  </fo:basic-link>
6238
-
6385
+
6239
6386
  </fo:inline>
6240
6387
  </xsl:when>
6241
- <xsl:otherwise>
6388
+ <xsl:otherwise> <!-- if there is key('bibitems_hidden', $current_bibitemid) -->
6242
6389
  <fo:inline><xsl:apply-templates/></fo:inline>
6243
6390
  </xsl:otherwise>
6244
6391
  </xsl:choose>
@@ -6980,6 +7127,24 @@
6980
7127
  <xsl:apply-templates/>
6981
7128
  </fo:inline>
6982
7129
  </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" priority="2">
7130
+
7131
+ <!-- list of footnotes to calculate actual footnotes number -->
7132
+ <xsl:variable name="p_fn_">
7133
+ <xsl:call-template name="get_fn_list"/>
7134
+ </xsl:variable>
7135
+ <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
7136
+ <xsl:variable name="gen_id" select="generate-id(.)"/>
7137
+ <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
7138
+ <!-- fn sequence number in document -->
7139
+ <xsl:variable name="current_fn_number">
7140
+ <xsl:choose>
7141
+ <xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
7142
+ <xsl:otherwise>
7143
+ <!-- <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1" /> -->
7144
+ <xsl:value-of select="count($p_fn//fn[@gen_id = $gen_id]/preceding-sibling::fn) + 1"/>
7145
+ </xsl:otherwise>
7146
+ </xsl:choose>
7147
+ </xsl:variable>
6983
7148
  <fo:footnote>
6984
7149
  <xsl:variable name="number">
6985
7150
 
@@ -6988,22 +7153,26 @@
6988
7153
  <xsl:number level="any" count="*[local-name() = 'references'][preceding-sibling::*[local-name() = 'references']]//*[local-name() = 'bibitem']/*[local-name() = 'note']"/>
6989
7154
  </xsl:when>
6990
7155
  <xsl:otherwise>
6991
- <xsl:number level="any" count="*[local-name() = 'bibitem']/*[local-name() = 'note']"/>
7156
+ <xsl:value-of select="$current_fn_number"/>
6992
7157
  </xsl:otherwise>
6993
7158
  </xsl:choose>
6994
7159
 
6995
7160
  </xsl:variable>
7161
+
7162
+ <xsl:variable name="current_fn_number_text">
7163
+ <xsl:value-of select="$number"/>
7164
+
7165
+ </xsl:variable>
7166
+
6996
7167
  <fo:inline xsl:use-attribute-sets="bibitem-note-fn-style">
6997
- <fo:basic-link internal-destination="{generate-id()}" fox:alt-text="footnote {$number}">
6998
- <xsl:value-of select="$number"/>
6999
-
7168
+ <fo:basic-link internal-destination="{$gen_id}" fox:alt-text="footnote {$number}">
7169
+ <xsl:value-of select="$current_fn_number_text"/>
7000
7170
  </fo:basic-link>
7001
7171
  </fo:inline>
7002
7172
  <fo:footnote-body>
7003
7173
  <fo:block xsl:use-attribute-sets="bibitem-note-fn-body-style">
7004
- <fo:inline id="{generate-id()}" xsl:use-attribute-sets="bibitem-note-fn-number-style">
7005
- <xsl:value-of select="$number"/>
7006
-
7174
+ <fo:inline id="{$gen_id}" xsl:use-attribute-sets="bibitem-note-fn-number-style">
7175
+ <xsl:value-of select="$current_fn_number_text"/>
7007
7176
  </fo:inline>
7008
7177
  <xsl:apply-templates/>
7009
7178
  </fo:block>
@@ -7249,6 +7418,78 @@
7249
7418
  <xsl:apply-templates/>
7250
7419
  </fo:block>
7251
7420
 
7421
+ </xsl:template><xsl:template match="@*|node()" mode="update_xml_step1">
7422
+ <xsl:copy>
7423
+ <xsl:apply-templates select="@*|node()" mode="update_xml_step1"/>
7424
+ </xsl:copy>
7425
+ </xsl:template><xsl:template match="*[local-name() = 'preface']" mode="update_xml_step1">
7426
+ <xsl:copy>
7427
+ <xsl:copy-of select="@*"/>
7428
+
7429
+ <xsl:variable name="nodes_preface_">
7430
+ <xsl:for-each select="*">
7431
+ <node id="{@id}"/>
7432
+ </xsl:for-each>
7433
+ </xsl:variable>
7434
+ <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
7435
+
7436
+ <xsl:for-each select="*">
7437
+ <xsl:sort select="@displayorder" data-type="number"/>
7438
+
7439
+ <!-- process Section's title -->
7440
+ <xsl:variable name="preceding-sibling_id" select="$nodes_preface/node[@id = current()/@id]/preceding-sibling::node[1]/@id"/>
7441
+ <xsl:if test="$preceding-sibling_id != ''">
7442
+ <xsl:apply-templates select="parent::*/*[@type = 'section-title' and @id = $preceding-sibling_id and not(@displayorder)]" mode="update_xml_step1"/>
7443
+ </xsl:if>
7444
+
7445
+ <xsl:choose>
7446
+ <xsl:when test="@type = 'section-title' and not(@displayorder)"><!-- skip, don't copy, because copied in above 'apply-templates' --></xsl:when>
7447
+ <xsl:otherwise>
7448
+ <xsl:apply-templates select="." mode="update_xml_step1"/>
7449
+ </xsl:otherwise>
7450
+ </xsl:choose>
7451
+
7452
+ </xsl:for-each>
7453
+ </xsl:copy>
7454
+ </xsl:template><xsl:template match="*[local-name() = 'sections']" mode="update_xml_step1">
7455
+ <xsl:copy>
7456
+ <xsl:copy-of select="@*"/>
7457
+
7458
+ <xsl:variable name="nodes_sections_">
7459
+ <xsl:for-each select="*">
7460
+ <node id="{@id}"/>
7461
+ </xsl:for-each>
7462
+ </xsl:variable>
7463
+ <xsl:variable name="nodes_sections" select="xalan:nodeset($nodes_sections_)"/>
7464
+
7465
+ <!-- move section 'Normative references' inside 'sections' -->
7466
+ <xsl:for-each select="* | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]">
7467
+ <xsl:sort select="@displayorder" data-type="number"/>
7468
+
7469
+ <!-- process Section's title -->
7470
+ <xsl:variable name="preceding-sibling_id" select="$nodes_sections/node[@id = current()/@id]/preceding-sibling::node[1]/@id"/>
7471
+ <xsl:if test="$preceding-sibling_id != ''">
7472
+ <xsl:apply-templates select="parent::*/*[@type = 'section-title' and @id = $preceding-sibling_id and not(@displayorder)]" mode="update_xml_step1"/>
7473
+ </xsl:if>
7474
+
7475
+ <xsl:choose>
7476
+ <xsl:when test="@type = 'section-title' and not(@displayorder)"><!-- skip, don't copy, because copied in above 'apply-templates' --></xsl:when>
7477
+ <xsl:otherwise>
7478
+ <xsl:apply-templates select="." mode="update_xml_step1"/>
7479
+ </xsl:otherwise>
7480
+ </xsl:choose>
7481
+
7482
+ </xsl:for-each>
7483
+ </xsl:copy>
7484
+ </xsl:template><xsl:template match="*[local-name() = 'bibliography']" mode="update_xml_step1">
7485
+ <xsl:copy>
7486
+ <xsl:copy-of select="@*"/>
7487
+ <!-- copy all elements from bibliography except 'Normative references' (moved to 'sections') -->
7488
+ <xsl:for-each select="*[not(@normative='true') and not(*[*[@normative='true']])]">
7489
+ <xsl:sort select="@displayorder" data-type="number"/>
7490
+ <xsl:apply-templates select="." mode="update_xml_step1"/>
7491
+ </xsl:for-each>
7492
+ </xsl:copy>
7252
7493
  </xsl:template><xsl:template name="convertDate">
7253
7494
  <xsl:param name="date"/>
7254
7495
  <xsl:param name="format" select="'short'"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ribose
3
- VERSION = "2.0.4".freeze
3
+ VERSION = "2.0.5".freeze
4
4
  end
5
5
  end
data/metanorma.yml CHANGED
@@ -1,6 +1,6 @@
1
1
  metanorma_name: ribose
2
2
  organization_name_short: Ribose
3
- organization_name_long: Ribose
3
+ organization_name_long: Ribose Asia Limited
4
4
  document_namespace: https://www.metanorma.org/ns/rsd
5
5
  xml_root_tag: 'rsd-standard'
6
6
  logo_path: lib/isodoc/ribose/html/logo.png
@@ -29,13 +29,21 @@ word_normalfontsize: "12.0pt"
29
29
  word_smallerfontsize: "11.0pt"
30
30
  word_monospacefontsize: "10.0pt"
31
31
  word_footnotefontsize: "10.0pt"
32
- docid_template: "{{ docnumeric }}{% if stageabbr %}({{ stageabbr }}){%endif%}"
32
+ docid_template: "{% if doctype_abbr %}{{ doctype_abbr }} {%endif%}{{ docnumeric }}{% if stageabbr %}({{ stageabbr }}){%endif%}"
33
33
  published_stages:
34
34
  - published
35
35
  stage_abbreviations:
36
36
  working-draft: wd
37
37
  committee-draft: cd
38
38
  draft-standard: d
39
+ doctypes:
40
+ standard:
41
+ code: Code
42
+ presentation: Pres
43
+ proposal: Prop
44
+ report: Rept
45
+ specification: Spec
46
+ default_doctype: standard
39
47
  metadata_extensions:
40
48
  - security
41
49
  - recipient
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: metanorma-ribose
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.4
4
+ version: 2.0.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: 2022-02-21 00:00:00.000000000 Z
11
+ date: 2022-03-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic