metanorma-ribose 2.0.4 → 2.0.7

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: 06f3ac2765345f6611750588e9950f4d77f552665142fc737ce5fe8be375001c
4
+ data.tar.gz: bb2b7c923e2945cbf3f0bdbb7a490d6042e753901301eb13559530b179a8287d
5
5
  SHA512:
6
- metadata.gz: 24cc694393250970b0c8db8374d7be4c52b3ca473d42cb5e6d1ff6a223d25aa534d435816e0e354dd5b59fcfddab7e10038c478c884d1aa6ce603cd4e2d58b66
7
- data.tar.gz: 11d88a39e147a99cf54fa845f58b69284681483a45f737c5cc83eccbf7cb624aa1cc3f907f17fd87b6af4c1d264319677294427de903b3cf170c1b365b418045
6
+ metadata.gz: 745b5a44ef93701355dcddd77f59acdc3a256ca17b9d4d4c6b921cb43704ff19a949aa195197762ddb45aaa46361f5c8a8819b450f90910b8c41d616af50459a
7
+ data.tar.gz: 38c1ce002c351d4e6a31f8c88f56a5ebd5910620d6d5e75231c354ba901a9a46a07d2712b791933b7ebad492f805e4939f4ffef098a18066574d9640e26ac8b2
@@ -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/>
@@ -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"/>
@@ -2572,8 +2666,27 @@
2572
2666
  <xsl:sort select="@displayorder" data-type="number"/>
2573
2667
  <xsl:apply-templates select="."/>
2574
2668
  </xsl:for-each>
2575
- </xsl:template><xsl:template match="text()">
2576
- <xsl:value-of select="."/>
2669
+ </xsl:template><xsl:variable name="tag_open">###fo:inline###</xsl:variable><xsl:variable name="tag_close">###/fo:inline###</xsl:variable><xsl:template match="text()" name="text">
2670
+ <xsl:variable name="regex_standard_reference">([A-Z]{2,}(/[A-Z]{2,})* \d+(-\d+)*(:\d{4})?)</xsl:variable>
2671
+ <xsl:variable name="text" select="java:replaceAll(java:java.lang.String.new(.),$regex_standard_reference,concat($tag_open,'$1',$tag_close))"/>
2672
+ <xsl:call-template name="replace_fo_inline">
2673
+ <xsl:with-param name="text" select="$text"/>
2674
+ </xsl:call-template>
2675
+ </xsl:template><xsl:template name="replace_fo_inline">
2676
+ <xsl:param name="text"/>
2677
+ <xsl:choose>
2678
+ <xsl:when test="contains($text, $tag_open)">
2679
+ <xsl:value-of select="substring-before($text, $tag_open)"/>
2680
+ <xsl:text disable-output-escaping="yes">&lt;fo:inline keep-together.within-line="always"&gt;</xsl:text>
2681
+ <xsl:variable name="text_after" select="substring-after($text, $tag_open)"/>
2682
+ <xsl:value-of select="substring-before($text_after, $tag_close)"/>
2683
+ <xsl:text disable-output-escaping="yes">&lt;/fo:inline&gt;</xsl:text>
2684
+ <xsl:call-template name="replace_fo_inline">
2685
+ <xsl:with-param name="text" select="substring-after($text_after, $tag_close)"/>
2686
+ </xsl:call-template>
2687
+ </xsl:when>
2688
+ <xsl:otherwise><xsl:value-of select="$text"/></xsl:otherwise>
2689
+ </xsl:choose>
2577
2690
  </xsl:template><xsl:template match="*[local-name()='br']">
2578
2691
  <xsl:value-of select="$linebreak"/>
2579
2692
  </xsl:template><xsl:template match="*[local-name()='copyright-statement']">
@@ -3331,37 +3444,7 @@
3331
3444
 
3332
3445
  <!-- list of footnotes to calculate actual footnotes number -->
3333
3446
  <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>
3447
+ <xsl:call-template name="get_fn_list"/>
3365
3448
  </xsl:variable>
3366
3449
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
3367
3450
 
@@ -3422,6 +3505,38 @@
3422
3505
  <xsl:copy-of select="$footnote_inline"/>
3423
3506
  </xsl:otherwise>
3424
3507
  </xsl:choose>
3508
+ </xsl:template><xsl:template name="get_fn_list">
3509
+ <xsl:choose>
3510
+ <xsl:when test="@current_fn_number"> <!-- for BSI, footnote reference number calculated already -->
3511
+ <fn gen_id="{generate-id(.)}">
3512
+ <xsl:copy-of select="@*"/>
3513
+ <xsl:copy-of select="node()"/>
3514
+ </fn>
3515
+ </xsl:when>
3516
+ <xsl:otherwise>
3517
+ <!-- itetation for:
3518
+ footnotes in bibdata/title
3519
+ footnotes in bibliography
3520
+ footnotes in document's body (except table's head/body/foot and figure text)
3521
+ -->
3522
+ <xsl:for-each select="ancestor::*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'note'][@type='title-footnote']">
3523
+ <fn gen_id="{generate-id(.)}">
3524
+ <xsl:copy-of select="@*"/>
3525
+ <xsl:copy-of select="node()"/>
3526
+ </fn>
3527
+ </xsl:for-each>
3528
+ <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']/*">
3529
+ <xsl:sort select="@displayorder" data-type="number"/>
3530
+ <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])]">
3531
+ <!-- copy unique fn -->
3532
+ <fn gen_id="{generate-id(.)}">
3533
+ <xsl:copy-of select="@*"/>
3534
+ <xsl:copy-of select="node()"/>
3535
+ </fn>
3536
+ </xsl:for-each>
3537
+ </xsl:for-each>
3538
+ </xsl:otherwise>
3539
+ </xsl:choose>
3425
3540
  </xsl:template><xsl:template name="table_fn_display">
3426
3541
  <xsl:variable name="references">
3427
3542
 
@@ -3593,7 +3708,7 @@
3593
3708
  </fo:inline>
3594
3709
  </xsl:template><xsl:template match="*[local-name()='fn']/text()[normalize-space() != '']">
3595
3710
  <fo:inline><xsl:value-of select="."/></fo:inline>
3596
- </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
3711
+ </xsl:template><xsl:template match="*[local-name()='fn']//*[local-name()='p']">
3597
3712
  <fo:inline>
3598
3713
  <xsl:apply-templates/>
3599
3714
  </fo:inline>
@@ -5307,13 +5422,14 @@
5307
5422
  <xsl:apply-templates mode="bookmarks"/>
5308
5423
  </xsl:template><xsl:template name="addBookmarks">
5309
5424
  <xsl:param name="contents"/>
5310
- <xsl:if test="xalan:nodeset($contents)//item">
5425
+ <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
5426
+ <xsl:if test="$contents_nodes//item">
5311
5427
  <fo:bookmark-tree>
5312
5428
  <xsl:choose>
5313
- <xsl:when test="xalan:nodeset($contents)/doc">
5429
+ <xsl:when test="$contents_nodes/doc">
5314
5430
  <xsl:choose>
5315
- <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
5316
- <xsl:for-each select="xalan:nodeset($contents)/doc">
5431
+ <xsl:when test="count($contents_nodes/doc) &gt; 1">
5432
+ <xsl:for-each select="$contents_nodes/doc">
5317
5433
  <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
5318
5434
  <xsl:if test="@bundle = 'true'">
5319
5435
  <xsl:attribute name="internal-destination"><xsl:value-of select="@firstpage_id"/></xsl:attribute>
@@ -5364,7 +5480,7 @@
5364
5480
  </xsl:for-each>
5365
5481
  </xsl:when>
5366
5482
  <xsl:otherwise>
5367
- <xsl:for-each select="xalan:nodeset($contents)/doc">
5483
+ <xsl:for-each select="$contents_nodes/doc">
5368
5484
 
5369
5485
  <xsl:apply-templates select="contents/item" mode="bookmark"/>
5370
5486
 
@@ -5382,25 +5498,36 @@
5382
5498
  </xsl:choose>
5383
5499
  </xsl:when>
5384
5500
  <xsl:otherwise>
5385
- <xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
5501
+ <xsl:apply-templates select="$contents_nodes/contents/item" mode="bookmark"/>
5502
+
5503
+ <xsl:call-template name="insertFigureBookmarks">
5504
+ <xsl:with-param name="contents" select="$contents_nodes/contents"/>
5505
+ </xsl:call-template>
5506
+
5507
+ <xsl:call-template name="insertTableBookmarks">
5508
+ <xsl:with-param name="contents" select="$contents_nodes/contents"/>
5509
+ <xsl:with-param name="lang" select="@lang"/>
5510
+ </xsl:call-template>
5511
+
5386
5512
  </xsl:otherwise>
5387
5513
  </xsl:choose>
5388
5514
 
5515
+
5389
5516
 
5390
5517
 
5391
5518
 
5392
5519
 
5393
-
5394
-
5520
+
5395
5521
 
5396
5522
  </fo:bookmark-tree>
5397
5523
  </xsl:if>
5398
5524
  </xsl:template><xsl:template name="insertFigureBookmarks">
5399
5525
  <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">
5526
+ <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
5527
+ <xsl:if test="$contents_nodes/figure">
5528
+ <fo:bookmark internal-destination="{$contents_nodes/figure[1]/@id}" starting-state="hide">
5402
5529
  <fo:bookmark-title>Figures</fo:bookmark-title>
5403
- <xsl:for-each select="xalan:nodeset($contents)/figure">
5530
+ <xsl:for-each select="$contents_nodes/figure">
5404
5531
  <fo:bookmark internal-destination="{@id}">
5405
5532
  <fo:bookmark-title>
5406
5533
  <xsl:value-of select="normalize-space(title)"/>
@@ -5409,18 +5536,40 @@
5409
5536
  </xsl:for-each>
5410
5537
  </fo:bookmark>
5411
5538
  </xsl:if>
5539
+
5540
+
5541
+ <xsl:if test="$contents_nodes//figures/figure">
5542
+ <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
5543
+
5544
+
5545
+
5546
+ <xsl:variable name="bookmark-title">
5547
+
5548
+ <xsl:value-of select="$title-list-figures"/>
5549
+
5550
+ </xsl:variable>
5551
+ <fo:bookmark-title><xsl:value-of select="normalize-space($bookmark-title)"/></fo:bookmark-title>
5552
+ <xsl:for-each select="$contents_nodes//figures/figure">
5553
+ <fo:bookmark internal-destination="{@id}">
5554
+ <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title>
5555
+ </fo:bookmark>
5556
+ </xsl:for-each>
5557
+ </fo:bookmark>
5558
+ </xsl:if>
5559
+
5412
5560
  </xsl:template><xsl:template name="insertTableBookmarks">
5413
5561
  <xsl:param name="contents"/>
5414
5562
  <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">
5563
+ <xsl:variable name="contents_nodes" select="xalan:nodeset($contents)"/>
5564
+ <xsl:if test="$contents_nodes/table">
5565
+ <fo:bookmark internal-destination="{$contents_nodes/table[1]/@id}" starting-state="hide">
5417
5566
  <fo:bookmark-title>
5418
5567
  <xsl:choose>
5419
5568
  <xsl:when test="$lang = 'fr'">Tableaux</xsl:when>
5420
5569
  <xsl:otherwise>Tables</xsl:otherwise>
5421
5570
  </xsl:choose>
5422
5571
  </fo:bookmark-title>
5423
- <xsl:for-each select="xalan:nodeset($contents)/table">
5572
+ <xsl:for-each select="$contents_nodes/table">
5424
5573
  <fo:bookmark internal-destination="{@id}">
5425
5574
  <fo:bookmark-title>
5426
5575
  <xsl:value-of select="normalize-space(title)"/>
@@ -5429,6 +5578,29 @@
5429
5578
  </xsl:for-each>
5430
5579
  </fo:bookmark>
5431
5580
  </xsl:if>
5581
+
5582
+
5583
+ <xsl:if test="$contents_nodes//tables/table">
5584
+ <fo:bookmark internal-destination="empty_bookmark" starting-state="hide">
5585
+
5586
+
5587
+
5588
+ <xsl:variable name="bookmark-title">
5589
+
5590
+ <xsl:value-of select="$title-list-tables"/>
5591
+
5592
+ </xsl:variable>
5593
+
5594
+ <fo:bookmark-title><xsl:value-of select="$bookmark-title"/></fo:bookmark-title>
5595
+
5596
+ <xsl:for-each select="$contents_nodes//tables/table">
5597
+ <fo:bookmark internal-destination="{@id}">
5598
+ <fo:bookmark-title><xsl:value-of select="normalize-space(.)"/></fo:bookmark-title>
5599
+ </fo:bookmark>
5600
+ </xsl:for-each>
5601
+ </fo:bookmark>
5602
+ </xsl:if>
5603
+
5432
5604
  </xsl:template><xsl:template name="getLangVersion">
5433
5605
  <xsl:param name="lang"/>
5434
5606
  <xsl:param name="doctype" select="''"/>
@@ -5671,7 +5843,51 @@
5671
5843
  <xsl:with-param name="text" select="$text_step1"/>
5672
5844
  </xsl:call-template>
5673
5845
  </xsl:variable>
5674
- <xsl:value-of select="$text_step2"/>
5846
+
5847
+ <!-- <xsl:value-of select="$text_step2"/> -->
5848
+
5849
+ <!-- add zero-width space after space -->
5850
+ <xsl:variable name="text_step3" select="java:replaceAll(java:java.lang.String.new($text_step2),' ',' ​')"/>
5851
+
5852
+ <!-- split text by zero-width space -->
5853
+ <xsl:variable name="text_step4">
5854
+ <xsl:call-template name="split">
5855
+ <xsl:with-param name="pText" select="$text_step3"/>
5856
+ <xsl:with-param name="sep" select="$zero_width_space"/>
5857
+ <xsl:with-param name="normalize-space">false</xsl:with-param>
5858
+ <xsl:with-param name="keep_sep">true</xsl:with-param>
5859
+ </xsl:call-template>
5860
+ </xsl:variable>
5861
+
5862
+ <xsl:for-each select="xalan:nodeset($text_step4)/item">
5863
+ <xsl:choose>
5864
+ <xsl:when test="string-length() &gt; 30"> <!-- word with length more than 30 will be interspersed with zero-width space -->
5865
+ <xsl:call-template name="interspers">
5866
+ <xsl:with-param name="str" select="."/>
5867
+ </xsl:call-template>
5868
+ </xsl:when>
5869
+ <xsl:otherwise>
5870
+ <xsl:value-of select="."/>
5871
+ </xsl:otherwise>
5872
+ </xsl:choose>
5873
+ </xsl:for-each>
5874
+
5875
+ </xsl:template><xsl:template name="interspers">
5876
+ <xsl:param name="str"/>
5877
+ <xsl:param name="char" select="$zero_width_space"/>
5878
+ <xsl:if test="$str != ''">
5879
+ <xsl:value-of select="substring($str, 1, 1)"/>
5880
+
5881
+ <xsl:variable name="next_char" select="substring($str, 2, 1)"/>
5882
+ <xsl:if test="not(contains(concat(' -.:=_— ', $char), $next_char))">
5883
+ <xsl:value-of select="$char"/>
5884
+ </xsl:if>
5885
+
5886
+ <xsl:call-template name="interspers">
5887
+ <xsl:with-param name="str" select="substring($str, 2)"/>
5888
+ <xsl:with-param name="char" select="$char"/>
5889
+ </xsl:call-template>
5890
+ </xsl:if>
5675
5891
  </xsl:template><xsl:template match="*" mode="syntax_highlight">
5676
5892
  <xsl:apply-templates mode="syntax_highlight"/>
5677
5893
  </xsl:template><xsl:variable name="syntax_highlight_styles_">
@@ -6057,7 +6273,7 @@
6057
6273
  <xsl:variable name="element">
6058
6274
 
6059
6275
  <xsl:choose>
6060
- <xsl:when test="$num = 1">inline</xsl:when>
6276
+ <xsl:when test="$num = 1 and not(contains($fo_element, 'block'))">inline</xsl:when>
6061
6277
  <xsl:otherwise>block</xsl:otherwise>
6062
6278
  </xsl:choose>
6063
6279
 
@@ -6113,6 +6329,8 @@
6113
6329
  </xsl:otherwise>
6114
6330
  </xsl:choose> -->
6115
6331
  </fo:block>
6332
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()[starts-with(., '[SOURCE: Adapted from: ')]" priority="2">
6333
+ <xsl:text>[</xsl:text><xsl:value-of select="substring-after(., '[SOURCE: ')"/>
6116
6334
  </xsl:template><xsl:template match="*[local-name() = 'termsource']/text()">
6117
6335
  <xsl:if test="normalize-space() != ''">
6118
6336
  <xsl:value-of select="."/>
@@ -6147,7 +6365,8 @@
6147
6365
  <fo:inline><xsl:apply-templates/></fo:inline>
6148
6366
  </xsl:template><xsl:template match="*[local-name() = 'modification']/text()">
6149
6367
  <xsl:if test="normalize-space() != ''">
6150
- <xsl:value-of select="."/>
6368
+ <!-- <xsl:value-of select="."/> -->
6369
+ <xsl:call-template name="text"/>
6151
6370
  </xsl:if>
6152
6371
  </xsl:template><xsl:template match="*[local-name() = 'quote']">
6153
6372
  <fo:block-container margin-left="0mm">
@@ -6187,26 +6406,24 @@
6187
6406
  </xsl:template><xsl:template match="*[local-name() = 'author']">
6188
6407
  <xsl:text>— </xsl:text>
6189
6408
  <xsl:apply-templates/>
6190
- </xsl:template><xsl:variable name="bibitem_hidden_">
6409
+ </xsl:template><xsl:variable name="bibitems_">
6410
+ <xsl:for-each select="//*[local-name() = 'bibitem']">
6411
+ <xsl:copy-of select="."/>
6412
+ </xsl:for-each>
6413
+ </xsl:variable><xsl:variable name="bibitems" select="xalan:nodeset($bibitems_)"/><xsl:variable name="bibitems_hidden_">
6191
6414
  <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden='true']">
6192
6415
  <xsl:copy-of select="."/>
6193
6416
  </xsl:for-each>
6194
- <xsl:for-each select="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem']">
6417
+ <xsl:for-each select="//*[local-name() = 'references'][@hidden='true']//*[local-name() = 'bibitem']">
6195
6418
  <xsl:copy-of select="."/>
6196
6419
  </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
-
6420
+ </xsl:variable><xsl:variable name="bibitems_hidden" select="xalan:nodeset($bibitems_hidden_)"/><xsl:template match="*[local-name() = 'eref']">
6421
+ <xsl:variable name="current_bibitemid" select="@bibitemid"/>
6422
+ <!-- <xsl:variable name="external-destination" select="normalize-space(key('bibitems', $current_bibitemid)/*[local-name() = 'uri'][@type = 'citation'])"/> -->
6423
+ <xsl:variable name="external-destination" select="normalize-space($bibitems/*[local-name() ='bibitem'][@id = $current_bibitemid]/*[local-name() = 'uri'][@type = 'citation'])"/>
6208
6424
  <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 -->
6425
+ <!-- <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) -->
6426
+ <xsl:when test="$external-destination != '' or not($bibitems_hidden/*[local-name() ='bibitem'][@id = $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
6427
  <fo:inline xsl:use-attribute-sets="eref-style">
6211
6428
  <xsl:if test="@type = 'footnote'">
6212
6429
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
@@ -6220,8 +6437,8 @@
6220
6437
  <xsl:variable name="text" select="normalize-space()"/>
6221
6438
 
6222
6439
 
6223
-
6224
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
6440
+
6441
+ <fo:basic-link fox:alt-text="{@citeas}">
6225
6442
  <xsl:if test="normalize-space(@citeas) = ''">
6226
6443
  <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
6227
6444
  </xsl:if>
@@ -6231,14 +6448,21 @@
6231
6448
 
6232
6449
  </xsl:if>
6233
6450
 
6234
-
6451
+ <xsl:choose>
6452
+ <xsl:when test="$external-destination != ''"> <!-- external hyperlink -->
6453
+ <xsl:attribute name="external-destination"><xsl:value-of select="$external-destination"/></xsl:attribute>
6454
+ </xsl:when>
6455
+ <xsl:otherwise>
6456
+ <xsl:attribute name="internal-destination"><xsl:value-of select="@bibitemid"/></xsl:attribute>
6457
+ </xsl:otherwise>
6458
+ </xsl:choose>
6235
6459
 
6236
6460
  <xsl:apply-templates/>
6237
6461
  </fo:basic-link>
6238
-
6462
+
6239
6463
  </fo:inline>
6240
6464
  </xsl:when>
6241
- <xsl:otherwise>
6465
+ <xsl:otherwise> <!-- if there is key('bibitems_hidden', $current_bibitemid) -->
6242
6466
  <fo:inline><xsl:apply-templates/></fo:inline>
6243
6467
  </xsl:otherwise>
6244
6468
  </xsl:choose>
@@ -6980,6 +7204,24 @@
6980
7204
  <xsl:apply-templates/>
6981
7205
  </fo:inline>
6982
7206
  </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" priority="2">
7207
+
7208
+ <!-- list of footnotes to calculate actual footnotes number -->
7209
+ <xsl:variable name="p_fn_">
7210
+ <xsl:call-template name="get_fn_list"/>
7211
+ </xsl:variable>
7212
+ <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
7213
+ <xsl:variable name="gen_id" select="generate-id(.)"/>
7214
+ <xsl:variable name="lang" select="ancestor::*[contains(local-name(), '-standard')]/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
7215
+ <!-- fn sequence number in document -->
7216
+ <xsl:variable name="current_fn_number">
7217
+ <xsl:choose>
7218
+ <xsl:when test="@current_fn_number"><xsl:value-of select="@current_fn_number"/></xsl:when> <!-- for BSI -->
7219
+ <xsl:otherwise>
7220
+ <!-- <xsl:value-of select="count($p_fn//fn[@reference = $reference]/preceding-sibling::fn) + 1" /> -->
7221
+ <xsl:value-of select="count($p_fn//fn[@gen_id = $gen_id]/preceding-sibling::fn) + 1"/>
7222
+ </xsl:otherwise>
7223
+ </xsl:choose>
7224
+ </xsl:variable>
6983
7225
  <fo:footnote>
6984
7226
  <xsl:variable name="number">
6985
7227
 
@@ -6988,22 +7230,26 @@
6988
7230
  <xsl:number level="any" count="*[local-name() = 'references'][preceding-sibling::*[local-name() = 'references']]//*[local-name() = 'bibitem']/*[local-name() = 'note']"/>
6989
7231
  </xsl:when>
6990
7232
  <xsl:otherwise>
6991
- <xsl:number level="any" count="*[local-name() = 'bibitem']/*[local-name() = 'note']"/>
7233
+ <xsl:value-of select="$current_fn_number"/>
6992
7234
  </xsl:otherwise>
6993
7235
  </xsl:choose>
6994
7236
 
6995
7237
  </xsl:variable>
7238
+
7239
+ <xsl:variable name="current_fn_number_text">
7240
+ <xsl:value-of select="$number"/>
7241
+
7242
+ </xsl:variable>
7243
+
6996
7244
  <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
-
7245
+ <fo:basic-link internal-destination="{$gen_id}" fox:alt-text="footnote {$number}">
7246
+ <xsl:value-of select="$current_fn_number_text"/>
7000
7247
  </fo:basic-link>
7001
7248
  </fo:inline>
7002
7249
  <fo:footnote-body>
7003
7250
  <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
-
7251
+ <fo:inline id="{$gen_id}" xsl:use-attribute-sets="bibitem-note-fn-number-style">
7252
+ <xsl:value-of select="$current_fn_number_text"/>
7007
7253
  </fo:inline>
7008
7254
  <xsl:apply-templates/>
7009
7255
  </fo:block>
@@ -7249,6 +7495,78 @@
7249
7495
  <xsl:apply-templates/>
7250
7496
  </fo:block>
7251
7497
 
7498
+ </xsl:template><xsl:template match="@*|node()" mode="update_xml_step1">
7499
+ <xsl:copy>
7500
+ <xsl:apply-templates select="@*|node()" mode="update_xml_step1"/>
7501
+ </xsl:copy>
7502
+ </xsl:template><xsl:template match="*[local-name() = 'preface']" mode="update_xml_step1">
7503
+ <xsl:copy>
7504
+ <xsl:copy-of select="@*"/>
7505
+
7506
+ <xsl:variable name="nodes_preface_">
7507
+ <xsl:for-each select="*">
7508
+ <node id="{@id}"/>
7509
+ </xsl:for-each>
7510
+ </xsl:variable>
7511
+ <xsl:variable name="nodes_preface" select="xalan:nodeset($nodes_preface_)"/>
7512
+
7513
+ <xsl:for-each select="*">
7514
+ <xsl:sort select="@displayorder" data-type="number"/>
7515
+
7516
+ <!-- process Section's title -->
7517
+ <xsl:variable name="preceding-sibling_id" select="$nodes_preface/node[@id = current()/@id]/preceding-sibling::node[1]/@id"/>
7518
+ <xsl:if test="$preceding-sibling_id != ''">
7519
+ <xsl:apply-templates select="parent::*/*[@type = 'section-title' and @id = $preceding-sibling_id and not(@displayorder)]" mode="update_xml_step1"/>
7520
+ </xsl:if>
7521
+
7522
+ <xsl:choose>
7523
+ <xsl:when test="@type = 'section-title' and not(@displayorder)"><!-- skip, don't copy, because copied in above 'apply-templates' --></xsl:when>
7524
+ <xsl:otherwise>
7525
+ <xsl:apply-templates select="." mode="update_xml_step1"/>
7526
+ </xsl:otherwise>
7527
+ </xsl:choose>
7528
+
7529
+ </xsl:for-each>
7530
+ </xsl:copy>
7531
+ </xsl:template><xsl:template match="*[local-name() = 'sections']" mode="update_xml_step1">
7532
+ <xsl:copy>
7533
+ <xsl:copy-of select="@*"/>
7534
+
7535
+ <xsl:variable name="nodes_sections_">
7536
+ <xsl:for-each select="*">
7537
+ <node id="{@id}"/>
7538
+ </xsl:for-each>
7539
+ </xsl:variable>
7540
+ <xsl:variable name="nodes_sections" select="xalan:nodeset($nodes_sections_)"/>
7541
+
7542
+ <!-- move section 'Normative references' inside 'sections' -->
7543
+ <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']]">
7544
+ <xsl:sort select="@displayorder" data-type="number"/>
7545
+
7546
+ <!-- process Section's title -->
7547
+ <xsl:variable name="preceding-sibling_id" select="$nodes_sections/node[@id = current()/@id]/preceding-sibling::node[1]/@id"/>
7548
+ <xsl:if test="$preceding-sibling_id != ''">
7549
+ <xsl:apply-templates select="parent::*/*[@type = 'section-title' and @id = $preceding-sibling_id and not(@displayorder)]" mode="update_xml_step1"/>
7550
+ </xsl:if>
7551
+
7552
+ <xsl:choose>
7553
+ <xsl:when test="@type = 'section-title' and not(@displayorder)"><!-- skip, don't copy, because copied in above 'apply-templates' --></xsl:when>
7554
+ <xsl:otherwise>
7555
+ <xsl:apply-templates select="." mode="update_xml_step1"/>
7556
+ </xsl:otherwise>
7557
+ </xsl:choose>
7558
+
7559
+ </xsl:for-each>
7560
+ </xsl:copy>
7561
+ </xsl:template><xsl:template match="*[local-name() = 'bibliography']" mode="update_xml_step1">
7562
+ <xsl:copy>
7563
+ <xsl:copy-of select="@*"/>
7564
+ <!-- copy all elements from bibliography except 'Normative references' (moved to 'sections') -->
7565
+ <xsl:for-each select="*[not(@normative='true') and not(*[@normative='true'])]">
7566
+ <xsl:sort select="@displayorder" data-type="number"/>
7567
+ <xsl:apply-templates select="." mode="update_xml_step1"/>
7568
+ </xsl:for-each>
7569
+ </xsl:copy>
7252
7570
  </xsl:template><xsl:template name="convertDate">
7253
7571
  <xsl:param name="date"/>
7254
7572
  <xsl:param name="format" select="'short'"/>
@@ -7493,22 +7811,25 @@
7493
7811
  <xsl:param name="pText" select="."/>
7494
7812
  <xsl:param name="sep" select="','"/>
7495
7813
  <xsl:param name="normalize-space" select="'true'"/>
7814
+ <xsl:param name="keep_sep" select="'false'"/>
7496
7815
  <xsl:if test="string-length($pText) &gt;0">
7497
- <item>
7498
- <xsl:choose>
7499
- <xsl:when test="$normalize-space = 'true'">
7500
- <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
7501
- </xsl:when>
7502
- <xsl:otherwise>
7503
- <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
7504
- </xsl:otherwise>
7505
- </xsl:choose>
7506
- </item>
7507
- <xsl:call-template name="split">
7508
- <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
7509
- <xsl:with-param name="sep" select="$sep"/>
7510
- <xsl:with-param name="normalize-space" select="$normalize-space"/>
7511
- </xsl:call-template>
7816
+ <item>
7817
+ <xsl:choose>
7818
+ <xsl:when test="$normalize-space = 'true'">
7819
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
7820
+ </xsl:when>
7821
+ <xsl:otherwise>
7822
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
7823
+ </xsl:otherwise>
7824
+ </xsl:choose>
7825
+ </item>
7826
+ <xsl:if test="$keep_sep = 'true' and contains($pText, $sep)"><item><xsl:value-of select="$sep"/></item></xsl:if>
7827
+ <xsl:call-template name="split">
7828
+ <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
7829
+ <xsl:with-param name="sep" select="$sep"/>
7830
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
7831
+ <xsl:with-param name="keep_sep" select="$keep_sep"/>
7832
+ </xsl:call-template>
7512
7833
  </xsl:if>
7513
7834
  </xsl:template><xsl:template name="getDocumentId">
7514
7835
  <xsl:call-template name="getLang"/><xsl:value-of select="//*[local-name() = 'p'][1]/@id"/>
@@ -1,5 +1,5 @@
1
1
  module Metanorma
2
2
  module Ribose
3
- VERSION = "2.0.4".freeze
3
+ VERSION = "2.0.7".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.7
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-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: metanorma-generic
@@ -244,7 +244,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
244
244
  - !ruby/object:Gem::Version
245
245
  version: '0'
246
246
  requirements: []
247
- rubygems_version: 3.2.32
247
+ rubygems_version: 3.3.9
248
248
  signing_key:
249
249
  specification_version: 4
250
250
  summary: metanorma-ribose lets you write Ribose standards in AsciiDoc.