metanorma-ribose 2.2.8 → 2.2.9

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,4 +1,4 @@
1
- <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:rsd="https://www.metanorma.org/ns/rsd" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:xalan="http://xml.apache.org/xalan" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xmlns:java="http://xml.apache.org/xalan/java" exclude-result-prefixes="java" version="1.0">
1
+ <?xml version="1.0" encoding="UTF-8"?><xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:fo="http://www.w3.org/1999/XSL/Format" xmlns:ribose="https://www.metanorma.org/ns/ribose" xmlns:mathml="http://www.w3.org/1998/Math/MathML" xmlns:xalan="http://xml.apache.org/xalan" xmlns:fox="http://xmlgraphics.apache.org/fop/extensions" xmlns:java="http://xml.apache.org/xalan/java" exclude-result-prefixes="java" version="1.0">
2
2
 
3
3
  <xsl:output version="1.0" method="xml" encoding="UTF-8" indent="no"/>
4
4
 
@@ -8,24 +8,24 @@
8
8
 
9
9
  <xsl:variable name="color_blue">rgb(22, 97, 173)</xsl:variable>
10
10
 
11
- <xsl:variable name="copyright_year" select="/rsd:rsd-standard/rsd:bibdata/rsd:copyright/rsd:from"/>
11
+ <xsl:variable name="copyright_year" select="/ribose:rsd-standard/ribose:bibdata/ribose:copyright/ribose:from"/>
12
12
 
13
13
  <xsl:variable name="copyright">
14
14
  <xsl:text>© </xsl:text>
15
15
  <xsl:value-of select="$copyright_year"/>
16
16
  <xsl:text> </xsl:text>
17
- <xsl:value-of select="/rsd:rsd-standard/rsd:bibdata/rsd:copyright/rsd:owner/rsd:organization/rsd:name"/>
17
+ <xsl:value-of select="/ribose:rsd-standard/ribose:bibdata/ribose:copyright/ribose:owner/ribose:organization/ribose:name"/>
18
18
  </xsl:variable>
19
19
 
20
20
  <xsl:variable name="contents_">
21
21
  <contents>
22
22
 
23
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:abstract" mode="contents"/>
24
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:foreword" mode="contents"/>
25
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:executivesummary" mode="contents"/>
26
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:introduction" mode="contents"/>
27
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:clause" mode="contents"/>
28
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:acknowledgements" mode="contents"/>
23
+ <xsl:apply-templates select="/ribose:rsd-standard/ribose:preface/ribose:abstract" mode="contents"/>
24
+ <xsl:apply-templates select="/ribose:rsd-standard/ribose:preface/ribose:foreword" mode="contents"/>
25
+ <xsl:apply-templates select="/ribose:rsd-standard/ribose:preface/ribose:executivesummary" mode="contents"/>
26
+ <xsl:apply-templates select="/ribose:rsd-standard/ribose:preface/ribose:introduction" mode="contents"/>
27
+ <xsl:apply-templates select="/ribose:rsd-standard/ribose:preface/ribose:clause" mode="contents"/>
28
+ <xsl:apply-templates select="/ribose:rsd-standard/ribose:preface/ribose:acknowledgements" mode="contents"/>
29
29
 
30
30
  <xsl:call-template name="processMainSectionsDefault_Contents"/>
31
31
 
@@ -35,11 +35,11 @@
35
35
  <xsl:variable name="contents" select="xalan:nodeset($contents_)"/>
36
36
 
37
37
  <xsl:variable name="docnumber_version">
38
- <xsl:value-of select="/rsd:rsd-standard/rsd:bibdata/rsd:docidentifier[@type = 'rsd' or @type = 'Ribose']"/>
38
+ <xsl:value-of select="/ribose:rsd-standard/ribose:bibdata/ribose:docidentifier[@type = 'rsd' or @type = 'Ribose']"/>
39
39
  <xsl:text>:</xsl:text>
40
40
  <xsl:value-of select="$copyright_year"/>
41
41
 
42
- <xsl:variable name="edition" select="normalize-space(/rsd:rsd-standard/rsd:bibdata/rsd:edition[normalize-space(@language) = ''])"/>
42
+ <xsl:variable name="edition" select="normalize-space(/ribose:rsd-standard/ribose:bibdata/ribose:edition[normalize-space(@language) = ''])"/>
43
43
  <xsl:if test="$edition != ''">
44
44
  <xsl:variable name="title-version">
45
45
  <xsl:call-template name="capitalize">
@@ -342,7 +342,7 @@
342
342
  <fo:table-cell display-align="before" border-right="0.5pt solid black" padding-top="1.5mm" padding-right="5mm">
343
343
  <!-- Author's list -->
344
344
  <fo:block>
345
- <xsl:for-each select="/rsd:rsd-standard/rsd:bibdata/rsd:contributor[rsd:role/@type='author']/rsd:person/rsd:name/rsd:completename">
345
+ <xsl:for-each select="/ribose:rsd-standard/ribose:bibdata/ribose:contributor[ribose:role/@type='author']/ribose:person/ribose:name/ribose:completename">
346
346
  <fo:block>
347
347
  <xsl:apply-templates/>
348
348
  </fo:block>
@@ -351,20 +351,20 @@
351
351
  </fo:table-cell>
352
352
  <fo:table-cell display-align="before" padding-top="1.5mm" padding-left="8mm">
353
353
  <fo:block>
354
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:bibdata/rsd:ext/rsd:security"/>
354
+ <xsl:apply-templates select="/ribose:rsd-standard/ribose:bibdata/ribose:ext/ribose:security"/>
355
355
  <fo:block>
356
356
  <xsl:call-template name="convertDate">
357
- <xsl:with-param name="date" select="/rsd:rsd-standard/rsd:bibdata/rsd:date[@type = 'published']/rsd:on"/>
357
+ <xsl:with-param name="date" select="/ribose:rsd-standard/ribose:bibdata/ribose:date[@type = 'published']/ribose:on"/>
358
358
  <xsl:with-param name="format" select="'Month DD, YYYY'"/>
359
359
  </xsl:call-template>
360
360
  </fo:block>
361
361
  <fo:block><xsl:value-of select="$docnumber_version"/></fo:block>
362
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:bibdata/rsd:ext/rsd:editorialgroup/rsd:committee"/>
362
+ <xsl:apply-templates select="/ribose:rsd-standard/ribose:bibdata/ribose:ext/ribose:editorialgroup/ribose:committee"/>
363
363
  <fo:block>
364
364
  <xsl:text>© </xsl:text>
365
365
  <xsl:value-of select="$copyright_year"/>
366
366
  <xsl:text> </xsl:text>
367
- <xsl:variable name="publisher" select="/rsd:rsd-standard/rsd:bibdata/rsd:contributor[rsd:role/@type='publisher']/rsd:organization/rsd:name"/>
367
+ <xsl:variable name="publisher" select="/ribose:rsd-standard/ribose:bibdata/ribose:contributor[ribose:role/@type='publisher']/ribose:organization/ribose:name"/>
368
368
  <xsl:value-of select="$publisher"/>
369
369
  <xsl:if test="substring($publisher, string-length($publisher)) != '.'"><xsl:text>.</xsl:text></xsl:if>
370
370
  <xsl:text> </xsl:text>
@@ -388,12 +388,12 @@
388
388
 
389
389
  <!-- title and version -->
390
390
  <fo:block-container margin-top="{$pageHeight - 279.4}mm" height="60mm" display-align="center">
391
- <xsl:variable name="title" select="/rsd:rsd-standard/rsd:bibdata/rsd:title[@language = $lang]"/>
391
+ <xsl:variable name="title" select="/ribose:rsd-standard/ribose:bibdata/ribose:title[@language = $lang]"/>
392
392
  <xsl:if test="string-length($title) &gt; 80">
393
393
  <xsl:attribute name="margin-right">-30mm</xsl:attribute>
394
394
  </xsl:if>
395
395
  <fo:block font-size="27pt" font-weight="bold" role="H1">
396
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:bibdata/rsd:title[@language = $lang]" mode="cover_page"/>
396
+ <xsl:apply-templates select="/ribose:rsd-standard/ribose:bibdata/ribose:title[@language = $lang]" mode="cover_page"/>
397
397
  </fo:block>
398
398
  <fo:block space-before="9pt" font-size="16.8pt" font-weight="600">
399
399
  <xsl:value-of select="$docnumber_version"/>
@@ -409,79 +409,12 @@
409
409
  <xsl:with-param name="section">toc</xsl:with-param>
410
410
  </xsl:call-template>
411
411
  <fo:flow flow-name="xsl-region-body">
412
- <xsl:if test="$contents//item[@display = 'true']">
413
- <fo:block role="TOC">
414
- <!-- <fo:block-container absolute-position="fixed" left="13mm" top="15mm"> -->
415
- <fo:block font-size="27pt" font-weight="bold" color="black" margin-left="-15mm" margin-bottom="13mm" role="H1">
416
- <xsl:call-template name="getLocalizedString">
417
- <xsl:with-param name="key">table_of_contents</xsl:with-param>
418
- </xsl:call-template>
419
- </fo:block>
420
- <!-- </fo:block-container> -->
421
412
 
422
- <fo:block-container margin-left="32mm" margin-right="-17mm">
423
- <fo:block-container margin-left="0mm" margin-right="0mm">
424
- <xsl:for-each select="$contents//item[@display = 'true']">
425
- <fo:block font-size="13pt" role="TOCI">
426
- <xsl:if test="@level = 1">
427
- <xsl:if test="preceding-sibling::item[@display = 'true' and @level = 1]">
428
- <xsl:attribute name="space-before">16pt</xsl:attribute>
429
- </xsl:if>
430
- <xsl:attribute name="space-after">4pt</xsl:attribute>
431
- <xsl:attribute name="font-weight">bold</xsl:attribute>
432
- <xsl:attribute name="keep-with-next">always</xsl:attribute>
433
- <xsl:attribute name="color">black</xsl:attribute>
434
- </xsl:if>
435
- <xsl:if test="@level &gt;= 2">
436
- <xsl:attribute name="margin-left"><xsl:value-of select="(@level - 1) * 16.5"/>mm</xsl:attribute>
437
- <xsl:attribute name="space-before">4pt</xsl:attribute>
438
- <xsl:attribute name="space-after">5pt</xsl:attribute>
439
- </xsl:if>
440
- <fo:block text-align-last="justify">
441
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
442
- <xsl:value-of select="@section"/>
443
- <xsl:text> </xsl:text>
444
- <xsl:apply-templates select="title"/>
445
- <xsl:text>  </xsl:text>
446
- <fo:inline>
447
- <fo:leader leader-pattern="rule" rule-thickness="0.2mm"/>
448
- <fo:inline padding-left="2mm"><fo:page-number-citation ref-id="{@id}"/></fo:inline>
449
- </fo:inline>
450
- </fo:basic-link>
451
- </fo:block>
452
- </fo:block>
453
- </xsl:for-each>
454
-
455
- <!-- List of Tables -->
456
- <xsl:if test="$contents//tables/table">
457
- <xsl:call-template name="insertListOf_Title">
458
- <xsl:with-param name="title" select="$title-list-tables"/>
459
- </xsl:call-template>
460
- <xsl:for-each select="$contents//tables/table">
461
- <xsl:call-template name="insertListOf_Item"/>
462
- </xsl:for-each>
463
- </xsl:if>
464
-
465
- <!-- List of Figures -->
466
- <xsl:if test="$contents//figures/figure">
467
- <xsl:call-template name="insertListOf_Title">
468
- <xsl:with-param name="title" select="$title-list-figures"/>
469
- </xsl:call-template>
470
- <xsl:for-each select="$contents//figures/figure">
471
- <xsl:call-template name="insertListOf_Item"/>
472
- </xsl:for-each>
473
- </xsl:if>
474
-
475
- </fo:block-container>
476
- </fo:block-container>
477
- </fo:block>
478
- <fo:block break-after="page"/>
479
- </xsl:if>
480
- <fo:block margin-bottom="12pt"> </fo:block>
413
+ <xsl:apply-templates select="/ribose:rsd-standard/ribose:preface/ribose:clause[@type = 'toc']"/>
481
414
 
482
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:boilerplate/rsd:legal-statement"/>
415
+ <xsl:apply-templates select="/ribose:rsd-standard/ribose:boilerplate/ribose:legal-statement"/>
483
416
 
484
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:boilerplate/rsd:feedback-statement"/>
417
+ <xsl:apply-templates select="/ribose:rsd-standard/ribose:boilerplate/ribose:feedback-statement"/>
485
418
 
486
419
  </fo:flow>
487
420
  </fo:page-sequence>
@@ -502,12 +435,12 @@
502
435
 
503
436
  <fo:block line-height="130%">
504
437
 
505
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:abstract"/>
506
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:foreword"/>
507
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:executivesummary"/>
508
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:introduction"/>
509
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:clause"/>
510
- <xsl:apply-templates select="/rsd:rsd-standard/rsd:preface/rsd:acknowledgements"/>
438
+ <xsl:apply-templates select="/ribose:rsd-standard/ribose:preface/ribose:abstract"/>
439
+ <xsl:apply-templates select="/ribose:rsd-standard/ribose:preface/ribose:foreword"/>
440
+ <xsl:apply-templates select="/ribose:rsd-standard/ribose:preface/ribose:executivesummary"/>
441
+ <xsl:apply-templates select="/ribose:rsd-standard/ribose:preface/ribose:introduction"/>
442
+ <xsl:apply-templates select="/ribose:rsd-standard/ribose:preface/ribose:clause[not(@type = 'toc')]"/>
443
+ <xsl:apply-templates select="/ribose:rsd-standard/ribose:preface/ribose:acknowledgements"/>
511
444
 
512
445
  <xsl:call-template name="processMainSectionsDefault"/>
513
446
 
@@ -543,11 +476,91 @@
543
476
  </fo:block>
544
477
  </xsl:template>
545
478
 
546
- <xsl:template match="rsd:title" mode="cover_page">
479
+ <xsl:template match="ribose:title" mode="cover_page">
547
480
  <xsl:apply-templates/>
548
481
  </xsl:template>
549
482
 
550
- <xsl:template match="rsd:bibdata/rsd:ext/rsd:security">
483
+ <xsl:template match="ribose:preface/ribose:clause[@type = 'toc']" priority="3">
484
+ <fo:block role="TOC">
485
+ <xsl:apply-templates/>
486
+
487
+ <xsl:if test="count(*) = 1 and *[local-name() = 'title']"> <!-- if there isn't user ToC -->
488
+
489
+ <xsl:if test="$contents//item[@display = 'true']">
490
+
491
+ <fo:block-container margin-left="32mm" margin-right="-17mm">
492
+ <fo:block-container margin-left="0mm" margin-right="0mm">
493
+ <xsl:for-each select="$contents//item[@display = 'true']">
494
+ <fo:block font-size="13pt" role="TOCI">
495
+ <xsl:if test="@level = 1">
496
+ <xsl:if test="preceding-sibling::item[@display = 'true' and @level = 1]">
497
+ <xsl:attribute name="space-before">16pt</xsl:attribute>
498
+ </xsl:if>
499
+ <xsl:attribute name="space-after">4pt</xsl:attribute>
500
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
501
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
502
+ <xsl:attribute name="color">black</xsl:attribute>
503
+ </xsl:if>
504
+ <xsl:if test="@level &gt;= 2">
505
+ <xsl:attribute name="margin-left"><xsl:value-of select="(@level - 1) * 16.5"/>mm</xsl:attribute>
506
+ <xsl:attribute name="space-before">4pt</xsl:attribute>
507
+ <xsl:attribute name="space-after">5pt</xsl:attribute>
508
+ </xsl:if>
509
+ <fo:block text-align-last="justify">
510
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
511
+ <xsl:value-of select="@section"/>
512
+ <xsl:text> </xsl:text>
513
+ <xsl:apply-templates select="title"/>
514
+ <xsl:text>  </xsl:text>
515
+ <fo:inline>
516
+ <fo:leader leader-pattern="rule" rule-thickness="0.2mm"/>
517
+ <fo:inline padding-left="2mm"><fo:page-number-citation ref-id="{@id}"/></fo:inline>
518
+ </fo:inline>
519
+ </fo:basic-link>
520
+ </fo:block>
521
+ </fo:block>
522
+ </xsl:for-each>
523
+
524
+ <!-- List of Tables -->
525
+ <xsl:if test="$contents//tables/table">
526
+ <xsl:call-template name="insertListOf_Title">
527
+ <xsl:with-param name="title" select="$title-list-tables"/>
528
+ </xsl:call-template>
529
+ <xsl:for-each select="$contents//tables/table">
530
+ <xsl:call-template name="insertListOf_Item"/>
531
+ </xsl:for-each>
532
+ </xsl:if>
533
+
534
+ <!-- List of Figures -->
535
+ <xsl:if test="$contents//figures/figure">
536
+ <xsl:call-template name="insertListOf_Title">
537
+ <xsl:with-param name="title" select="$title-list-figures"/>
538
+ </xsl:call-template>
539
+ <xsl:for-each select="$contents//figures/figure">
540
+ <xsl:call-template name="insertListOf_Item"/>
541
+ </xsl:for-each>
542
+ </xsl:if>
543
+
544
+ </fo:block-container>
545
+ </fo:block-container>
546
+
547
+ <fo:block break-after="page"/>
548
+ </xsl:if>
549
+ </xsl:if>
550
+ <fo:block margin-bottom="12pt"> </fo:block>
551
+ </fo:block>
552
+ </xsl:template>
553
+
554
+ <xsl:template match="ribose:preface/ribose:clause[@type = 'toc']/ribose:title" priority="3">
555
+ <fo:block font-size="27pt" font-weight="bold" color="black" margin-left="-15mm" margin-bottom="13mm" role="H1">
556
+ <!-- <xsl:call-template name="getLocalizedString">
557
+ <xsl:with-param name="key">table_of_contents</xsl:with-param>
558
+ </xsl:call-template> -->
559
+ <xsl:apply-templates/>
560
+ </fo:block>
561
+ </xsl:template>
562
+
563
+ <xsl:template match="ribose:bibdata/ribose:ext/ribose:security">
551
564
  <fo:block>
552
565
  <xsl:call-template name="capitalize">
553
566
  <xsl:with-param name="str" select="."/>
@@ -555,7 +568,7 @@
555
568
  </fo:block>
556
569
  </xsl:template>
557
570
 
558
- <xsl:template match="rsd:bibdata/rsd:ext/rsd:editorialgroup/rsd:committee">
571
+ <xsl:template match="ribose:bibdata/ribose:ext/ribose:editorialgroup/ribose:committee">
559
572
  <fo:block><xsl:apply-templates/></fo:block>
560
573
  </xsl:template>
561
574
 
@@ -568,10 +581,10 @@
568
581
  <!-- ============================= -->
569
582
 
570
583
  <!-- element with title -->
571
- <xsl:template match="*[rsd:title]" mode="contents">
584
+ <xsl:template match="*[ribose:title]" mode="contents">
572
585
  <xsl:variable name="level">
573
586
  <xsl:call-template name="getLevel">
574
- <xsl:with-param name="depth" select="rsd:title/@depth"/>
587
+ <xsl:with-param name="depth" select="ribose:title/@depth"/>
575
588
  </xsl:call-template>
576
589
  </xsl:variable>
577
590
 
@@ -584,8 +597,9 @@
584
597
 
585
598
  <xsl:variable name="skip">
586
599
  <xsl:choose>
587
- <xsl:when test="ancestor-or-self::rsd:bibitem">true</xsl:when>
588
- <xsl:when test="ancestor-or-self::rsd:term">true</xsl:when>
600
+ <xsl:when test="@type = 'toc'">true</xsl:when>
601
+ <xsl:when test="ancestor-or-self::ribose:bibitem">true</xsl:when>
602
+ <xsl:when test="ancestor-or-self::ribose:term">true</xsl:when>
589
603
  <xsl:otherwise>false</xsl:otherwise>
590
604
  </xsl:choose>
591
605
  </xsl:variable>
@@ -618,7 +632,7 @@
618
632
  <!-- ============================= -->
619
633
  <!-- ============================= -->
620
634
 
621
- <xsl:template match="rsd:feedback-statement" priority="2">
635
+ <xsl:template match="ribose:feedback-statement" priority="2">
622
636
  <fo:block-container border="1pt solid black" padding="1mm" padding-left="2mm">
623
637
  <fo:block>
624
638
  <xsl:apply-templates/>
@@ -626,7 +640,7 @@
626
640
  </fo:block-container>
627
641
  </xsl:template>
628
642
 
629
- <xsl:template match="rsd:legal-statement" priority="2">
643
+ <xsl:template match="ribose:legal-statement" priority="2">
630
644
  <xsl:apply-templates/>
631
645
  </xsl:template>
632
646
 
@@ -634,7 +648,7 @@
634
648
  <!-- title -->
635
649
  <!-- ====== -->
636
650
 
637
- <!-- <xsl:template match="rsd:annex/rsd:title">
651
+ <!-- <xsl:template match="ribose:annex/ribose:title">
638
652
  <xsl:variable name="level">
639
653
  <xsl:call-template name="getLevel"/>
640
654
  </xsl:variable>
@@ -649,7 +663,7 @@
649
663
  </fo:block>
650
664
  </xsl:template> -->
651
665
 
652
- <xsl:template match="rsd:title" name="title">
666
+ <xsl:template match="ribose:title" name="title">
653
667
 
654
668
  <xsl:variable name="level">
655
669
  <xsl:call-template name="getLevel"/>
@@ -657,8 +671,8 @@
657
671
 
658
672
  <xsl:variable name="font-size">
659
673
  <xsl:choose>
660
- <!-- <xsl:when test="ancestor::rsd:preface and $level &gt;= 2">12pt</xsl:when>
661
- <xsl:when test="ancestor::rsd:preface">13pt</xsl:when> -->
674
+ <!-- <xsl:when test="ancestor::ribose:preface and $level &gt;= 2">12pt</xsl:when>
675
+ <xsl:when test="ancestor::ribose:preface">13pt</xsl:when> -->
662
676
  <xsl:when test="$level = 1">22pt</xsl:when>
663
677
  <xsl:when test="$level = 2">13pt</xsl:when>
664
678
  <xsl:when test="$level &gt;= 3">11pt</xsl:when>
@@ -769,7 +783,7 @@
769
783
  </fo:block>
770
784
  </xsl:template>
771
785
 
772
- <xsl:template match="rsd:p" name="paragraph">
786
+ <xsl:template match="ribose:p" name="paragraph">
773
787
  <xsl:param name="inline" select="'false'"/>
774
788
  <xsl:param name="split_keep-within-line"/>
775
789
  <xsl:variable name="previous-element" select="local-name(preceding-sibling::*[1])"/>
@@ -787,19 +801,19 @@
787
801
  </xsl:attribute>
788
802
  <xsl:attribute name="text-align">
789
803
  <xsl:choose>
790
- <!-- <xsl:when test="ancestor::rsd:preface">justify</xsl:when> -->
804
+ <!-- <xsl:when test="ancestor::ribose:preface">justify</xsl:when> -->
791
805
  <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
792
806
  <xsl:otherwise>left</xsl:otherwise><!-- justify -->
793
807
  </xsl:choose>
794
808
  </xsl:attribute>
795
809
  <xsl:attribute name="space-after">
796
810
  <xsl:choose>
797
- <xsl:when test="ancestor::rsd:li">6pt</xsl:when>
798
- <xsl:when test="ancestor::rsd:feedback-statement and not(following-sibling::rsd:p)">0pt</xsl:when>
811
+ <xsl:when test="ancestor::ribose:li">6pt</xsl:when>
812
+ <xsl:when test="ancestor::ribose:feedback-statement and not(following-sibling::ribose:p)">0pt</xsl:when>
799
813
  <xsl:otherwise>6pt</xsl:otherwise> <!-- 12pt-->
800
814
  </xsl:choose>
801
815
  </xsl:attribute>
802
- <xsl:if test="ancestor::rsd:dl"> <!-- ancestor::rsd:li or -->
816
+ <xsl:if test="ancestor::ribose:dl"> <!-- ancestor::ribose:li or -->
803
817
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
804
818
  </xsl:if>
805
819
 
@@ -810,7 +824,7 @@
810
824
  </xsl:element>
811
825
  <xsl:if test="$element-name = 'fo:inline' and not($inline = 'true') and not(local-name(..) = 'admonition')">
812
826
  <fo:block margin-bottom="12pt">
813
- <xsl:if test="ancestor::rsd:annex">
827
+ <xsl:if test="ancestor::ribose:annex">
814
828
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
815
829
  </xsl:if>
816
830
  <xsl:value-of select="$linebreak"/>
@@ -821,17 +835,17 @@
821
835
  </xsl:if>
822
836
  </xsl:template>
823
837
 
824
- <xsl:template match="rsd:fn/rsd:p">
838
+ <xsl:template match="ribose:fn/ribose:p">
825
839
  <fo:block>
826
840
  <xsl:apply-templates/>
827
841
  </fo:block>
828
842
  </xsl:template>
829
843
 
830
- <xsl:template match="rsd:ul | rsd:ol" mode="list" priority="2">
844
+ <xsl:template match="ribose:ul | ribose:ol" mode="list" priority="2">
831
845
  <fo:block-container>
832
846
  <fo:block-container margin-left="0mm">
833
847
  <xsl:choose>
834
- <xsl:when test="not(ancestor::rsd:ul) and not(ancestor::rsd:ol)">
848
+ <xsl:when test="not(ancestor::ribose:ul) and not(ancestor::ribose:ol)">
835
849
  <fo:block padding-bottom="12pt" padding-top="4pt">
836
850
  <xsl:call-template name="listProcessing"/>
837
851
  </fo:block>
@@ -850,22 +864,22 @@
850
864
  </fo:list-block>
851
865
  </xsl:template>
852
866
 
853
- <xsl:template match="rsd:ul/rsd:note | rsd:ol/rsd:note" priority="2">
867
+ <xsl:template match="ribose:ul/ribose:note | ribose:ol/ribose:note" priority="2">
854
868
  <fo:list-item font-size="10pt">
855
- <xsl:if test="ancestor::rsd:table">
869
+ <xsl:if test="ancestor::ribose:table">
856
870
  <xsl:attribute name="font-size">8pt</xsl:attribute>
857
871
  </xsl:if>
858
872
  <fo:list-item-label><fo:block/></fo:list-item-label>
859
873
  <fo:list-item-body>
860
874
  <fo:block>
861
- <xsl:apply-templates select="rsd:name"/>
875
+ <xsl:apply-templates select="ribose:name"/>
862
876
  <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
863
877
  </fo:block>
864
878
  </fo:list-item-body>
865
879
  </fo:list-item>
866
880
  </xsl:template>
867
881
 
868
- <xsl:template match="rsd:preferred | rsd:deprecates | rsd:admitted" priority="2">
882
+ <xsl:template match="ribose:preferred | ribose:deprecates | ribose:admitted" priority="2">
869
883
  <xsl:variable name="level">
870
884
  <xsl:call-template name="getLevel"/>
871
885
  </xsl:variable>
@@ -879,10 +893,10 @@
879
893
  <xsl:call-template name="getLevelTermName"/>
880
894
  </xsl:variable>
881
895
  <fo:block font-weight="bold" color="black" font-size="{$font-size}" keep-with-next="always" role="H{$levelTerm}"> <!-- 600 - semibold -->
882
- <xsl:if test="preceding-sibling::*[1][self::rsd:name]">
896
+ <xsl:if test="preceding-sibling::*[1][self::ribose:name]">
883
897
  <xsl:attribute name="space-before">11mm</xsl:attribute>
884
898
  <fo:inline padding-right="1mm">
885
- <xsl:apply-templates select="ancestor::rsd:term[1]/rsd:name"/>
899
+ <xsl:apply-templates select="ancestor::ribose:term[1]/ribose:name"/>
886
900
  </fo:inline>
887
901
  </xsl:if>
888
902
 
@@ -918,7 +932,7 @@
918
932
  </fo:block>
919
933
  </xsl:template>
920
934
 
921
- <xsl:template match="rsd:references[not(@normative='true')]" priority="3">
935
+ <xsl:template match="ribose:references[not(@normative='true')]" priority="3">
922
936
  <fo:block break-after="page"/>
923
937
  <fo:block id="{@id}">
924
938
  <fo:table width="100%" table-layout="fixed">
@@ -932,7 +946,7 @@
932
946
  <xsl:attribute name="margin-bottom">16pt</xsl:attribute>
933
947
  <xsl:attribute name="color">black</xsl:attribute>
934
948
  <xsl:attribute name="line-height">125%</xsl:attribute>
935
- <xsl:apply-templates select="rsd:title/node()"/>
949
+ <xsl:apply-templates select="ribose:title/node()"/>
936
950
  </fo:block>
937
951
  </fo:table-cell>
938
952
  </fo:table-row>
@@ -970,7 +984,7 @@
970
984
  <xsl:template match="*[local-name() = 'clause']" priority="2">
971
985
  <xsl:variable name="level">
972
986
  <xsl:call-template name="getLevel">
973
- <xsl:with-param name="depth" select="rsd:title/@depth"/>
987
+ <xsl:with-param name="depth" select="ribose:title/@depth"/>
974
988
  </xsl:call-template>
975
989
  </xsl:variable>
976
990
  <fo:block-container>
@@ -1094,7 +1108,7 @@
1094
1108
  <xsl:text>Ribose</xsl:text>
1095
1109
  <xsl:text> </xsl:text>
1096
1110
  <xsl:call-template name="capitalize">
1097
- <xsl:with-param name="str" select="/rsd:rsd-standard/rsd:bibdata/rsd:ext/rsd:doctype"/>
1111
+ <xsl:with-param name="str" select="/ribose:rsd-standard/ribose:bibdata/ribose:ext/ribose:doctype"/>
1098
1112
  </xsl:call-template>
1099
1113
  </xsl:variable>
1100
1114
  <fo:static-content flow-name="footer-odd" role="artifact">
@@ -1195,7 +1209,7 @@
1195
1209
  </xsl:if>
1196
1210
  </xsl:template>
1197
1211
 
1198
- <xsl:strip-space elements="rsd:xref"/>
1212
+ <xsl:strip-space elements="ribose:xref"/>
1199
1213
 
1200
1214
  <!-- external parameters -->
1201
1215
 
@@ -1604,6 +1618,16 @@
1604
1618
 
1605
1619
  </xsl:attribute-set>
1606
1620
 
1621
+ <xsl:template name="refine_link-style">
1622
+
1623
+ <xsl:if test="ancestor::*[local-name() = 'bibitem']">
1624
+ <xsl:attribute name="color">black</xsl:attribute>
1625
+ <xsl:attribute name="text-decoration">none</xsl:attribute>
1626
+ <xsl:attribute name="font-weight">300</xsl:attribute>
1627
+ </xsl:if>
1628
+
1629
+ </xsl:template> <!-- refine_link-style -->
1630
+
1607
1631
  <xsl:attribute-set name="sourcecode-container-style">
1608
1632
 
1609
1633
  <xsl:attribute name="space-after">12pt</xsl:attribute>
@@ -1622,6 +1646,23 @@
1622
1646
 
1623
1647
  </xsl:attribute-set>
1624
1648
 
1649
+ <xsl:template name="refine_sourcecode-style">
1650
+ <!-- background for image -->
1651
+ <xsl:if test="starts-with(*[local-name() = 'name']/text()[1], 'Figure ')">
1652
+ <xsl:attribute name="background-color">rgb(236,242,246)</xsl:attribute>
1653
+ <xsl:attribute name="padding-left">11mm</xsl:attribute>
1654
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
1655
+ <xsl:attribute name="padding-right">11mm</xsl:attribute>
1656
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
1657
+ <xsl:attribute name="padding-top">7.5mm</xsl:attribute>
1658
+ <xsl:attribute name="padding-bottom">7.5mm</xsl:attribute>
1659
+ <xsl:if test="following-sibling::*[1][local-name() = 'sourcecode'] and starts-with(*[local-name() = 'name']/text()[1], 'Figure ')">
1660
+ <xsl:attribute name="margin-bottom">16pt</xsl:attribute>
1661
+ </xsl:if>
1662
+ </xsl:if>
1663
+
1664
+ </xsl:template> <!-- refine_sourcecode-style -->
1665
+
1625
1666
  <xsl:attribute-set name="pre-style">
1626
1667
  <xsl:attribute name="font-family">Courier New, <xsl:value-of select="$font_noto_sans_mono"/></xsl:attribute>
1627
1668
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -1705,6 +1746,15 @@
1705
1746
 
1706
1747
  </xsl:attribute-set> <!-- example-style -->
1707
1748
 
1749
+ <xsl:template name="refine_example-style">
1750
+
1751
+ <xsl:if test="ancestor::ribose:ul or ancestor::ribose:ol">
1752
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
1753
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1754
+ </xsl:if>
1755
+
1756
+ </xsl:template> <!-- refine_example-style -->
1757
+
1708
1758
  <xsl:attribute-set name="example-body-style">
1709
1759
 
1710
1760
  </xsl:attribute-set> <!-- example-body-style -->
@@ -1723,6 +1773,10 @@
1723
1773
 
1724
1774
  </xsl:attribute-set> <!-- example-p-style -->
1725
1775
 
1776
+ <xsl:template name="refine_example-p-style">
1777
+
1778
+ </xsl:template> <!-- refine_example-p-style -->
1779
+
1726
1780
  <xsl:attribute-set name="termexample-name-style">
1727
1781
 
1728
1782
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -1752,6 +1806,12 @@
1752
1806
 
1753
1807
  </xsl:attribute-set> <!-- table-container-style -->
1754
1808
 
1809
+ <xsl:template name="refine_table-container-style">
1810
+ <xsl:param name="margin-side"/>
1811
+
1812
+ <!-- end table block-container attributes -->
1813
+ </xsl:template> <!-- refine_table-container-style -->
1814
+
1755
1815
  <xsl:attribute-set name="table-style">
1756
1816
  <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
1757
1817
  <xsl:attribute name="table-layout">fixed</xsl:attribute>
@@ -1761,6 +1821,13 @@
1761
1821
 
1762
1822
  </xsl:attribute-set><!-- table-style -->
1763
1823
 
1824
+ <xsl:template name="refine_table-style">
1825
+ <xsl:param name="margin-side"/>
1826
+
1827
+ <xsl:call-template name="setBordersTableArray"/>
1828
+
1829
+ </xsl:template> <!-- refine_table-style -->
1830
+
1764
1831
  <xsl:attribute-set name="table-name-style">
1765
1832
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1766
1833
 
@@ -1773,6 +1840,11 @@
1773
1840
 
1774
1841
  </xsl:attribute-set> <!-- table-name-style -->
1775
1842
 
1843
+ <xsl:template name="refine_table-name-style">
1844
+ <xsl:param name="continued"/>
1845
+
1846
+ </xsl:template> <!-- refine_table-name-style -->
1847
+
1776
1848
  <xsl:attribute-set name="table-row-style">
1777
1849
  <xsl:attribute name="min-height">4mm</xsl:attribute>
1778
1850
 
@@ -1789,14 +1861,35 @@
1789
1861
 
1790
1862
  </xsl:attribute-set>
1791
1863
 
1864
+ <xsl:template name="refine_table-header-row-style">
1865
+
1866
+ <xsl:call-template name="setBordersTableArray"/>
1867
+
1868
+ </xsl:template> <!-- refine_table-header-row-style -->
1869
+
1792
1870
  <xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style">
1793
1871
 
1794
1872
  </xsl:attribute-set>
1795
1873
 
1874
+ <xsl:template name="refine_table-footer-row-style">
1875
+
1876
+ </xsl:template> <!-- refine_table-footer-row-style -->
1877
+
1796
1878
  <xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style">
1797
1879
 
1798
1880
  </xsl:attribute-set>
1799
1881
 
1882
+ <xsl:template name="refine_table-body-row-style">
1883
+
1884
+ <xsl:call-template name="setBordersTableArray"/>
1885
+
1886
+ <xsl:variable name="number"><xsl:number/></xsl:variable>
1887
+ <xsl:if test="$number mod 2 = 0">
1888
+ <xsl:attribute name="background-color">rgb(254, 247, 228)</xsl:attribute>
1889
+ </xsl:if>
1890
+
1891
+ </xsl:template> <!-- refine_table-body-row-style -->
1892
+
1800
1893
  <xsl:attribute-set name="table-header-cell-style">
1801
1894
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1802
1895
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -1808,6 +1901,18 @@
1808
1901
 
1809
1902
  </xsl:attribute-set> <!-- table-header-cell-style -->
1810
1903
 
1904
+ <xsl:template name="refine_table-header-cell-style">
1905
+
1906
+ <xsl:call-template name="setBordersTableArray"/>
1907
+
1908
+ <xsl:if test="$lang = 'ar'">
1909
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
1910
+ </xsl:if>
1911
+
1912
+ <xsl:call-template name="setTableCellAttributes"/>
1913
+
1914
+ </xsl:template> <!-- refine_table-header-cell-style -->
1915
+
1811
1916
  <xsl:attribute-set name="table-cell-style">
1812
1917
  <xsl:attribute name="display-align">center</xsl:attribute>
1813
1918
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -1818,6 +1923,18 @@
1818
1923
 
1819
1924
  </xsl:attribute-set> <!-- table-cell-style -->
1820
1925
 
1926
+ <xsl:template name="refine_table-cell-style">
1927
+
1928
+ <xsl:if test="$lang = 'ar'">
1929
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
1930
+ </xsl:if>
1931
+
1932
+ <!-- bsi -->
1933
+
1934
+ <xsl:call-template name="setBordersTableArray"/>
1935
+
1936
+ </xsl:template> <!-- refine_table-cell-style -->
1937
+
1821
1938
  <xsl:attribute-set name="table-footer-cell-style">
1822
1939
  <xsl:attribute name="border">solid black 1pt</xsl:attribute>
1823
1940
  <xsl:attribute name="padding-left">1mm</xsl:attribute>
@@ -1828,6 +1945,10 @@
1828
1945
 
1829
1946
  </xsl:attribute-set> <!-- table-footer-cell-style -->
1830
1947
 
1948
+ <xsl:template name="refine_table-footer-cell-style">
1949
+
1950
+ </xsl:template> <!-- refine_table-footer-cell-style -->
1951
+
1831
1952
  <xsl:attribute-set name="table-note-style">
1832
1953
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1833
1954
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -1836,6 +1957,10 @@
1836
1957
 
1837
1958
  </xsl:attribute-set><!-- table-note-style -->
1838
1959
 
1960
+ <xsl:template name="refine_table-note-style">
1961
+
1962
+ </xsl:template> <!-- refine_table-note-style -->
1963
+
1839
1964
  <xsl:attribute-set name="table-fn-style">
1840
1965
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1841
1966
 
@@ -1891,6 +2016,10 @@
1891
2016
 
1892
2017
  </xsl:attribute-set>
1893
2018
 
2019
+ <xsl:template name="refine_dt-cell-style">
2020
+
2021
+ </xsl:template> <!-- refine_dt-cell-style -->
2022
+
1894
2023
  <xsl:attribute-set name="dt-block-style">
1895
2024
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
1896
2025
 
@@ -1899,6 +2028,10 @@
1899
2028
 
1900
2029
  </xsl:attribute-set>
1901
2030
 
2031
+ <xsl:template name="refine_dt-block-style">
2032
+
2033
+ </xsl:template> <!-- refine_dt-block-style -->
2034
+
1902
2035
  <xsl:attribute-set name="dl-name-style">
1903
2036
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1904
2037
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
@@ -1913,6 +2046,10 @@
1913
2046
 
1914
2047
  </xsl:attribute-set>
1915
2048
 
2049
+ <xsl:template name="refine_dd-cell-style">
2050
+
2051
+ </xsl:template> <!-- refine_dd-cell-style -->
2052
+
1916
2053
  <!-- ========================== -->
1917
2054
  <!-- END Definition's list styles -->
1918
2055
  <!-- ========================== -->
@@ -1936,7 +2073,6 @@
1936
2073
  </xsl:attribute-set>
1937
2074
 
1938
2075
  <xsl:attribute-set name="xref-style">
1939
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
1940
2076
 
1941
2077
  </xsl:attribute-set>
1942
2078
 
@@ -1944,6 +2080,12 @@
1944
2080
 
1945
2081
  </xsl:attribute-set>
1946
2082
 
2083
+ <xsl:template name="refine_eref-style">
2084
+ <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
2085
+ <xsl:variable name="text" select="normalize-space()"/>
2086
+
2087
+ </xsl:template> <!-- refine_eref-style -->
2088
+
1947
2089
  <xsl:attribute-set name="note-style">
1948
2090
 
1949
2091
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -1951,6 +2093,15 @@
1951
2093
 
1952
2094
  </xsl:attribute-set>
1953
2095
 
2096
+ <xsl:template name="refine_note-style">
2097
+
2098
+ <xsl:if test="ancestor::ribose:ul or ancestor::ribose:ol and not(ancestor::ribose:note[1]/following-sibling::*)">
2099
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
2100
+ <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2101
+ </xsl:if>
2102
+
2103
+ </xsl:template>
2104
+
1954
2105
  <xsl:variable name="note-body-indent">10mm</xsl:variable>
1955
2106
  <xsl:variable name="note-body-indent-table">5mm</xsl:variable>
1956
2107
 
@@ -1962,6 +2113,10 @@
1962
2113
 
1963
2114
  </xsl:attribute-set>
1964
2115
 
2116
+ <xsl:template name="refine_note-name-style">
2117
+
2118
+ </xsl:template> <!-- refine_note-name-style -->
2119
+
1965
2120
  <xsl:attribute-set name="table-note-name-style">
1966
2121
  <xsl:attribute name="padding-right">2mm</xsl:attribute>
1967
2122
 
@@ -1970,6 +2125,10 @@
1970
2125
 
1971
2126
  </xsl:attribute-set>
1972
2127
 
2128
+ <xsl:template name="refine_table-note-name-style">
2129
+
2130
+ </xsl:template> <!-- refine_table-note-name-style -->
2131
+
1973
2132
  <xsl:attribute-set name="note-p-style">
1974
2133
 
1975
2134
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -1983,6 +2142,10 @@
1983
2142
 
1984
2143
  </xsl:attribute-set>
1985
2144
 
2145
+ <xsl:template name="refine_termnote-style">
2146
+
2147
+ </xsl:template> <!-- refine_termnote-style -->
2148
+
1986
2149
  <xsl:attribute-set name="termnote-name-style">
1987
2150
 
1988
2151
  <xsl:attribute name="font-weight">bold</xsl:attribute>
@@ -1991,6 +2154,10 @@
1991
2154
 
1992
2155
  </xsl:attribute-set>
1993
2156
 
2157
+ <xsl:template name="refine_termnote-name-style">
2158
+
2159
+ </xsl:template>
2160
+
1994
2161
  <xsl:attribute-set name="termnote-p-style">
1995
2162
 
1996
2163
  </xsl:attribute-set>
@@ -2004,6 +2171,10 @@
2004
2171
 
2005
2172
  </xsl:attribute-set>
2006
2173
 
2174
+ <xsl:template name="refine_quote-style">
2175
+
2176
+ </xsl:template>
2177
+
2007
2178
  <xsl:attribute-set name="quote-source-style">
2008
2179
  <xsl:attribute name="text-align">right</xsl:attribute>
2009
2180
 
@@ -2017,6 +2188,10 @@
2017
2188
 
2018
2189
  </xsl:attribute-set>
2019
2190
 
2191
+ <xsl:template name="refine_termsource-style">
2192
+
2193
+ </xsl:template> <!-- refine_termsource-style -->
2194
+
2020
2195
  <xsl:attribute-set name="termsource-text-style">
2021
2196
 
2022
2197
  <xsl:attribute name="color"><xsl:value-of select="$color_blue"/></xsl:attribute>
@@ -2066,6 +2241,10 @@
2066
2241
 
2067
2242
  </xsl:attribute-set>
2068
2243
 
2244
+ <xsl:template name="refine_figure-name-style">
2245
+
2246
+ </xsl:template> <!-- refine_figure-name-style -->
2247
+
2069
2248
  <xsl:attribute-set name="figure-source-style">
2070
2249
 
2071
2250
  </xsl:attribute-set>
@@ -2085,6 +2264,10 @@
2085
2264
 
2086
2265
  </xsl:attribute-set> <!-- formula-stem-block-style -->
2087
2266
 
2267
+ <xsl:template name="refine_formula-stem-block-style">
2268
+
2269
+ </xsl:template> <!-- refine_formula-stem-block-style -->
2270
+
2088
2271
  <xsl:attribute-set name="formula-stem-number-style">
2089
2272
  <xsl:attribute name="text-align">right</xsl:attribute>
2090
2273
 
@@ -2096,6 +2279,10 @@
2096
2279
 
2097
2280
  </xsl:attribute-set>
2098
2281
 
2282
+ <xsl:template name="refine_image-style">
2283
+
2284
+ </xsl:template>
2285
+
2099
2286
  <xsl:attribute-set name="figure-pseudocode-p-style">
2100
2287
 
2101
2288
  </xsl:attribute-set>
@@ -2202,12 +2389,20 @@
2202
2389
 
2203
2390
  </xsl:attribute-set>
2204
2391
 
2392
+ <xsl:template name="refine_mathml-style">
2393
+
2394
+ </xsl:template>
2395
+
2205
2396
  <xsl:attribute-set name="list-style">
2206
2397
 
2207
2398
  <xsl:attribute name="provisional-distance-between-starts">6mm</xsl:attribute>
2208
2399
 
2209
2400
  </xsl:attribute-set> <!-- list-style -->
2210
2401
 
2402
+ <xsl:template name="refine_list-style">
2403
+
2404
+ </xsl:template> <!-- refine_list-style -->
2405
+
2211
2406
  <xsl:attribute-set name="list-name-style">
2212
2407
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2213
2408
 
@@ -2222,6 +2417,10 @@
2222
2417
 
2223
2418
  </xsl:attribute-set>
2224
2419
 
2420
+ <xsl:template name="refine_list-item-style">
2421
+
2422
+ </xsl:template> <!-- refine_list-item-style -->
2423
+
2225
2424
  <xsl:attribute-set name="list-item-label-style">
2226
2425
 
2227
2426
  <xsl:attribute name="color"><xsl:value-of select="$color_blue"/></xsl:attribute>
@@ -2229,12 +2428,20 @@
2229
2428
 
2230
2429
  </xsl:attribute-set>
2231
2430
 
2431
+ <xsl:template name="refine_list-item-label-style">
2432
+
2433
+ </xsl:template> <!-- refine_list-item-label-style -->
2434
+
2232
2435
  <xsl:attribute-set name="list-item-body-style">
2233
2436
 
2234
2437
  <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
2235
2438
 
2236
2439
  </xsl:attribute-set>
2237
2440
 
2441
+ <xsl:template name="refine_list-item-body-style">
2442
+
2443
+ </xsl:template> <!-- refine_list-item-body-style -->
2444
+
2238
2445
  <xsl:attribute-set name="toc-style">
2239
2446
  <xsl:attribute name="line-height">135%</xsl:attribute>
2240
2447
  </xsl:attribute-set>
@@ -2249,6 +2456,10 @@
2249
2456
 
2250
2457
  </xsl:attribute-set>
2251
2458
 
2459
+ <xsl:template name="refine_fn-reference-style">
2460
+
2461
+ </xsl:template> <!-- refine_fn-reference-style -->
2462
+
2252
2463
  <xsl:attribute-set name="fn-style">
2253
2464
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
2254
2465
  </xsl:attribute-set>
@@ -2274,6 +2485,10 @@
2274
2485
 
2275
2486
  </xsl:attribute-set>
2276
2487
 
2488
+ <xsl:template name="refine_fn-body-style">
2489
+
2490
+ </xsl:template> <!-- refine_fn-body-style -->
2491
+
2277
2492
  <xsl:attribute-set name="fn-body-num-style">
2278
2493
  <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
2279
2494
 
@@ -2282,6 +2497,10 @@
2282
2497
 
2283
2498
  </xsl:attribute-set> <!-- fn-body-num-style -->
2284
2499
 
2500
+ <xsl:template name="refine_fn-body-num-style">
2501
+
2502
+ </xsl:template> <!-- refine_fn-body-num-style -->
2503
+
2285
2504
  <!-- admonition -->
2286
2505
  <xsl:attribute-set name="admonition-style">
2287
2506
 
@@ -2942,7 +3161,9 @@
2942
3161
 
2943
3162
  <fo:block-container xsl:use-attribute-sets="table-container-style">
2944
3163
 
2945
- <!-- end table block-container attributes -->
3164
+ <xsl:call-template name="refine_table-container-style">
3165
+ <xsl:with-param name="margin-side" select="$margin-side"/>
3166
+ </xsl:call-template>
2946
3167
 
2947
3168
  <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
2948
3169
 
@@ -2963,7 +3184,9 @@
2963
3184
 
2964
3185
  <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
2965
3186
 
2966
- <xsl:call-template name="setBordersTableArray"/>
3187
+ <xsl:call-template name="refine_table-style">
3188
+ <xsl:with-param name="margin-side" select="$margin-side"/>
3189
+ </xsl:call-template>
2967
3190
 
2968
3191
  </xsl:element>
2969
3192
  </xsl:variable>
@@ -3029,7 +3252,7 @@
3029
3252
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
3030
3253
  </xsl:when>
3031
3254
  <xsl:otherwise>
3032
- <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'dl') and not(local-name() = 'source') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely -->
3255
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'note') and not(local-name() = 'dl') and not(local-name() = 'source') and not(local-name() = 'p') and not(local-name() = 'thead') and not(local-name() = 'tfoot')]"/> <!-- process all table' elements, except name, header, footer, note, source and dl which render separaterely -->
3033
3256
  </xsl:otherwise>
3034
3257
  </xsl:choose>
3035
3258
 
@@ -3119,6 +3342,10 @@
3119
3342
 
3120
3343
  <fo:block xsl:use-attribute-sets="table-name-style">
3121
3344
 
3345
+ <xsl:call-template name="refine_table-name-style">
3346
+ <xsl:with-param name="continued" select="$continued"/>
3347
+ </xsl:call-template>
3348
+
3122
3349
  <xsl:choose>
3123
3350
  <xsl:when test="$continued = 'true'">
3124
3351
 
@@ -3501,6 +3728,8 @@
3501
3728
  <fo:table-row>
3502
3729
  <fo:table-cell number-columns-spanned="{$cols-count}" border-left="1.5pt solid white" border-right="1.5pt solid white" border-top="1.5pt solid white" border-bottom="1.5pt solid black">
3503
3730
 
3731
+ <xsl:call-template name="refine_table-header-title-style"/>
3732
+
3504
3733
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
3505
3734
  <xsl:with-param name="continued">true</xsl:with-param>
3506
3735
  </xsl:apply-templates>
@@ -3513,6 +3742,10 @@
3513
3742
  </fo:table-row>
3514
3743
  </xsl:template> <!-- table-header-title -->
3515
3744
 
3745
+ <xsl:template name="refine_table-header-title-style">
3746
+
3747
+ </xsl:template> <!-- refine_table-header-title-style -->
3748
+
3516
3749
  <xsl:template match="*[local-name()='thead']" mode="process_tbody">
3517
3750
  <fo:table-body>
3518
3751
  <xsl:apply-templates/>
@@ -3537,7 +3770,7 @@
3537
3770
  <xsl:param name="colwidths"/>
3538
3771
  <xsl:param name="colgroup"/>
3539
3772
 
3540
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source']"/>
3773
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ../*[local-name()='dl'] or ..//*[local-name()='fn'][local-name(..) != 'name'] or ../*[local-name()='source'] or ../*[local-name()='p']"/>
3541
3774
 
3542
3775
  <xsl:variable name="isNoteOrFnExistShowAfterTable">
3543
3776
 
@@ -3597,6 +3830,8 @@
3597
3830
  <fo:table-row>
3598
3831
  <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
3599
3832
 
3833
+ <xsl:call-template name="refine_table-footer-cell-style"/>
3834
+
3600
3835
  <xsl:call-template name="setBordersTableArray"/>
3601
3836
 
3602
3837
  <!-- fn will be processed inside 'note' processing -->
@@ -3605,6 +3840,7 @@
3605
3840
 
3606
3841
  <!-- except gb and bsi -->
3607
3842
 
3843
+ <xsl:apply-templates select="../*[local-name()='p']"/>
3608
3844
  <xsl:apply-templates select="../*[local-name()='dl']"/>
3609
3845
  <xsl:apply-templates select="../*[local-name()='note']"/>
3610
3846
  <xsl:apply-templates select="../*[local-name()='source']"/>
@@ -3736,7 +3972,7 @@
3736
3972
  <xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
3737
3973
  <fo:table-row xsl:use-attribute-sets="table-header-row-style">
3738
3974
 
3739
- <xsl:call-template name="setBordersTableArray"/>
3975
+ <xsl:call-template name="refine_table-header-row-style"/>
3740
3976
 
3741
3977
  <xsl:call-template name="setTableRowAttributes"/>
3742
3978
 
@@ -3770,6 +4006,8 @@
3770
4006
  <xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
3771
4007
  <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
3772
4008
 
4009
+ <xsl:call-template name="refine_table-footer-row-style"/>
4010
+
3773
4011
  <xsl:call-template name="setTableRowAttributes"/>
3774
4012
  <xsl:apply-templates/>
3775
4013
  </fo:table-row>
@@ -3783,14 +4021,10 @@
3783
4021
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
3784
4022
  </xsl:if>
3785
4023
 
3786
- <xsl:call-template name="setBordersTableArray"/>
3787
-
3788
- <xsl:variable name="number"><xsl:number/></xsl:variable>
3789
- <xsl:if test="$number mod 2 = 0">
3790
- <xsl:attribute name="background-color">rgb(254, 247, 228)</xsl:attribute>
3791
- </xsl:if>
4024
+ <xsl:call-template name="refine_table-body-row-style"/>
3792
4025
 
3793
4026
  <xsl:call-template name="setTableRowAttributes"/>
4027
+
3794
4028
  <xsl:apply-templates/>
3795
4029
  </fo:table-row>
3796
4030
  </xsl:template>
@@ -3809,13 +4043,7 @@
3809
4043
  <xsl:with-param name="default">center</xsl:with-param>
3810
4044
  </xsl:call-template>
3811
4045
 
3812
- <xsl:call-template name="setBordersTableArray"/>
3813
-
3814
- <xsl:if test="$lang = 'ar'">
3815
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
3816
- </xsl:if>
3817
-
3818
- <xsl:call-template name="setTableCellAttributes"/>
4046
+ <xsl:call-template name="refine_table-header-cell-style"/>
3819
4047
 
3820
4048
  <fo:block>
3821
4049
  <xsl:apply-templates/>
@@ -3857,13 +4085,7 @@
3857
4085
  <xsl:with-param name="default">left</xsl:with-param>
3858
4086
  </xsl:call-template>
3859
4087
 
3860
- <xsl:if test="$lang = 'ar'">
3861
- <xsl:attribute name="padding-right">1mm</xsl:attribute>
3862
- </xsl:if>
3863
-
3864
- <!-- bsi -->
3865
-
3866
- <xsl:call-template name="setBordersTableArray"/>
4088
+ <xsl:call-template name="refine_table-cell-style"/>
3867
4089
 
3868
4090
  <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
3869
4091
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
@@ -3894,9 +4116,13 @@
3894
4116
 
3895
4117
  <fo:block xsl:use-attribute-sets="table-note-style">
3896
4118
 
4119
+ <xsl:call-template name="refine_table-note-style"/>
4120
+
3897
4121
  <!-- Table's note name (NOTE, for example) -->
3898
4122
  <fo:inline xsl:use-attribute-sets="table-note-name-style">
3899
4123
 
4124
+ <xsl:call-template name="refine_table-note-name-style"/>
4125
+
3900
4126
  <xsl:apply-templates select="*[local-name() = 'name']"/>
3901
4127
 
3902
4128
  </fo:inline>
@@ -3924,6 +4150,14 @@
3924
4150
  <!-- list of footnotes to calculate actual footnotes number -->
3925
4151
  <xsl:variable name="p_fn_">
3926
4152
  <xsl:call-template name="get_fn_list"/>
4153
+ <!-- <xsl:choose>
4154
+ <xsl:when test="$namespace = 'jis'">
4155
+ <xsl:call-template name="get_fn_list_for_element"/>
4156
+ </xsl:when>
4157
+ <xsl:otherwise>
4158
+ <xsl:call-template name="get_fn_list"/>
4159
+ </xsl:otherwise>
4160
+ </xsl:choose> -->
3927
4161
  </xsl:variable>
3928
4162
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
3929
4163
 
@@ -3948,7 +4182,14 @@
3948
4182
 
3949
4183
  </xsl:variable>
3950
4184
 
3951
- <xsl:variable name="ref_id" select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
4185
+ <xsl:variable name="ref_id">
4186
+ <xsl:choose>
4187
+ <xsl:when test="normalize-space(@ref_id) != ''"><xsl:value-of select="@ref_id"/></xsl:when>
4188
+ <xsl:otherwise>
4189
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
4190
+ </xsl:otherwise>
4191
+ </xsl:choose>
4192
+ </xsl:variable>
3952
4193
  <xsl:variable name="footnote_inline">
3953
4194
  <fo:inline>
3954
4195
 
@@ -3974,7 +4215,7 @@
3974
4215
  <xsl:call-template name="insert_basic_link">
3975
4216
  <xsl:with-param name="element">
3976
4217
  <fo:basic-link internal-destination="{$ref_id}" fox:alt-text="footnote {$current_fn_number}">
3977
- <xsl:value-of select="$current_fn_number_text"/>
4218
+ <xsl:copy-of select="$current_fn_number_text"/>
3978
4219
  </fo:basic-link>
3979
4220
  </xsl:with-param>
3980
4221
  </xsl:call-template>
@@ -3994,8 +4235,12 @@
3994
4235
 
3995
4236
  <fo:block xsl:use-attribute-sets="fn-body-style">
3996
4237
 
4238
+ <xsl:call-template name="refine_fn-body-style"/>
4239
+
3997
4240
  <fo:inline id="{$ref_id}" xsl:use-attribute-sets="fn-body-num-style">
3998
4241
 
4242
+ <xsl:call-template name="refine_fn-body-num-style"/>
4243
+
3999
4244
  <xsl:value-of select="$current_fn_number_text"/>
4000
4245
  </fo:inline>
4001
4246
  <xsl:apply-templates/>
@@ -4047,6 +4292,28 @@
4047
4292
  </xsl:choose>
4048
4293
  </xsl:template>
4049
4294
 
4295
+ <xsl:template name="get_fn_list_for_element">
4296
+ <xsl:choose>
4297
+ <xsl:when test="@current_fn_number"> <!-- footnote reference number calculated already -->
4298
+ <fn gen_id="{generate-id(.)}">
4299
+ <xsl:copy-of select="@*"/>
4300
+ <xsl:copy-of select="node()"/>
4301
+ </fn>
4302
+ </xsl:when>
4303
+ <xsl:otherwise>
4304
+ <xsl:for-each select="ancestor::*[local-name() = 'ul' or local-name() = 'ol'][1]">
4305
+ <xsl:variable name="element_id" select="@id"/>
4306
+ <xsl:for-each select=".//*[local-name() = 'fn'][generate-id(.)=generate-id(key('kfn',@reference)[1])]">
4307
+ <!-- copy unique fn -->
4308
+ <fn gen_id="{generate-id(.)}">
4309
+ <xsl:copy-of select="@*"/>
4310
+ <xsl:copy-of select="node()"/>
4311
+ </fn>
4312
+ </xsl:for-each>
4313
+ </xsl:for-each>
4314
+ </xsl:otherwise>
4315
+ </xsl:choose>
4316
+ </xsl:template>
4050
4317
  <!-- ============================ -->
4051
4318
  <!-- table's footnotes rendering -->
4052
4319
  <!-- ============================ -->
@@ -4221,6 +4488,8 @@
4221
4488
  <xsl:template match="*[local-name()='fn']">
4222
4489
  <fo:inline xsl:use-attribute-sets="fn-reference-style">
4223
4490
 
4491
+ <xsl:call-template name="refine_fn-reference-style"/>
4492
+
4224
4493
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
4225
4494
 
4226
4495
  <xsl:value-of select="@reference"/>
@@ -4320,6 +4589,8 @@
4320
4589
  <xsl:when test="$parent = 'formula'"> <!-- a few components -->
4321
4590
  <fo:block margin-bottom="12pt" text-align="left">
4322
4591
 
4592
+ <xsl:call-template name="refine_dl_formula_where_style"/>
4593
+
4323
4594
  <!-- <xsl:variable name="title-where">
4324
4595
  <xsl:call-template name="getLocalizedString">
4325
4596
  <xsl:with-param name="key">where</xsl:with-param>
@@ -4333,8 +4604,7 @@
4333
4604
  <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')"> <!-- definition list in a figure -->
4334
4605
  <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
4335
4606
 
4336
- <xsl:attribute name="font-weight">normal</xsl:attribute>
4337
- <xsl:attribute name="color">black</xsl:attribute>
4607
+ <xsl:call-template name="refine_figure_key_style"/>
4338
4608
 
4339
4609
  <xsl:variable name="title-key">
4340
4610
  <xsl:call-template name="getLocalizedString">
@@ -4350,12 +4620,16 @@
4350
4620
  <xsl:if test="$onlyOneComponent = 'false'">
4351
4621
  <fo:block>
4352
4622
 
4623
+ <xsl:call-template name="refine_multicomponent_style"/>
4624
+
4353
4625
  <xsl:if test="ancestor::*[local-name() = 'dd' or local-name() = 'td']">
4354
4626
  <xsl:attribute name="margin-top">0</xsl:attribute>
4355
4627
  </xsl:if>
4356
4628
 
4357
4629
  <fo:block>
4358
4630
 
4631
+ <xsl:call-template name="refine_multicomponent_block_style"/>
4632
+
4359
4633
  <xsl:apply-templates select="*[local-name() = 'name']">
4360
4634
  <xsl:with-param name="process">true</xsl:with-param>
4361
4635
  </xsl:apply-templates>
@@ -4513,6 +4787,27 @@
4513
4787
 
4514
4788
  </xsl:template> <!-- END: dl -->
4515
4789
 
4790
+ <xsl:template name="refine_dl_formula_where_style">
4791
+
4792
+ </xsl:template> <!-- refine_dl_formula_where_style -->
4793
+
4794
+ <xsl:template name="refine_figure_key_style">
4795
+
4796
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
4797
+ <xsl:attribute name="color">black</xsl:attribute>
4798
+
4799
+ </xsl:template> <!-- refine_figure_key_style -->
4800
+
4801
+ <xsl:template name="refine_multicomponent_style">
4802
+ <xsl:variable name="parent" select="local-name(..)"/>
4803
+
4804
+ </xsl:template> <!-- refine_multicomponent_style -->
4805
+
4806
+ <xsl:template name="refine_multicomponent_block_style">
4807
+ <xsl:variable name="parent" select="local-name(..)"/>
4808
+
4809
+ </xsl:template> <!-- refine_multicomponent_block_style -->
4810
+
4516
4811
  <!-- ignore 'p' with 'where' in formula, before 'dl' -->
4517
4812
  <xsl:template match="*[local-name() = 'formula']/*[local-name() = 'p' and @keep-with-next = 'true' and following-sibling::*[1][local-name() = 'dl']]"/>
4518
4813
 
@@ -4732,6 +5027,8 @@
4732
5027
 
4733
5028
  </xsl:if>
4734
5029
 
5030
+ <xsl:call-template name="refine_dt-cell-style"/>
5031
+
4735
5032
  <fo:block xsl:use-attribute-sets="dt-block-style">
4736
5033
  <xsl:copy-of select="@id"/>
4737
5034
 
@@ -4739,6 +5036,8 @@
4739
5036
  <xsl:attribute name="margin-top">0</xsl:attribute>
4740
5037
  </xsl:if>
4741
5038
 
5039
+ <xsl:call-template name="refine_dt-block-style"/>
5040
+
4742
5041
  <xsl:apply-templates>
4743
5042
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
4744
5043
  </xsl:apply-templates>
@@ -4758,6 +5057,8 @@
4758
5057
  <xsl:attribute name="border">0.1pt solid black</xsl:attribute>
4759
5058
  </xsl:if>
4760
5059
 
5060
+ <xsl:call-template name="refine_dd-cell-style"/>
5061
+
4761
5062
  <fo:block>
4762
5063
 
4763
5064
  <xsl:if test="$isGenerateTableIF = 'true'">
@@ -4908,10 +5209,7 @@
4908
5209
  <xsl:param name="split_keep-within-line"/>
4909
5210
  <fo:inline font-weight="bold">
4910
5211
 
4911
- <xsl:if test="not(parent::*[local-name() = 'termsource'])">
4912
- <xsl:attribute name="font-weight">normal</xsl:attribute>
4913
- <xsl:attribute name="color">black</xsl:attribute>
4914
- </xsl:if>
5212
+ <xsl:call-template name="refine_strong_style"/>
4915
5213
 
4916
5214
  <xsl:apply-templates>
4917
5215
  <xsl:with-param name="split_keep-within-line" select="$split_keep-within-line"/>
@@ -4919,6 +5217,15 @@
4919
5217
  </fo:inline>
4920
5218
  </xsl:template>
4921
5219
 
5220
+ <xsl:template name="refine_strong_style">
5221
+
5222
+ <xsl:if test="not(parent::*[local-name() = 'termsource'])">
5223
+ <xsl:attribute name="font-weight">normal</xsl:attribute>
5224
+ <xsl:attribute name="color">black</xsl:attribute>
5225
+ </xsl:if>
5226
+
5227
+ </xsl:template>
5228
+
4922
5229
  <xsl:template match="*[local-name()='padding']">
4923
5230
  <fo:inline padding-right="{@value}"> </fo:inline>
4924
5231
  </xsl:template>
@@ -5390,7 +5697,10 @@
5390
5697
  </xsl:choose>
5391
5698
  </xsl:variable>
5392
5699
 
5393
- <xsl:value-of select="$text9"/>
5700
+ <!-- replace sequence #x200B and space TO space -->
5701
+ <xsl:variable name="text10" select="java:replaceAll(java:java.lang.String.new($text9), '\u200b ', ' ')"/>
5702
+
5703
+ <xsl:value-of select="$text10"/>
5394
5704
  </xsl:template>
5395
5705
 
5396
5706
  <xsl:template name="add-zero-spaces-link-java">
@@ -6065,6 +6375,11 @@
6065
6375
 
6066
6376
  <fo:inline xsl:use-attribute-sets="mathml-style">
6067
6377
 
6378
+ <!-- DEBUG -->
6379
+ <!-- <xsl:copy-of select="ancestor::*[local-name() = 'stem']/@font-family"/> -->
6380
+
6381
+ <xsl:call-template name="refine_mathml-style"/>
6382
+
6068
6383
  <xsl:if test="$isGenerateTableIF = 'true' and ancestor::*[local-name() = 'td' or local-name() = 'th' or local-name() = 'dl'] and not(following-sibling::node()[not(self::comment())][normalize-space() != ''])"> <!-- math in table cell, and math is last element -->
6069
6384
  <!-- <xsl:attribute name="padding-right">1mm</xsl:attribute> -->
6070
6385
  </xsl:if>
@@ -6169,6 +6484,8 @@
6169
6484
 
6170
6485
  <fo:instream-foreign-object fox:alt-text="Math">
6171
6486
 
6487
+ <xsl:call-template name="refine_mathml_insteam_object_style"/>
6488
+
6172
6489
  <!-- put MathML in Actual Text -->
6173
6490
  <!-- DEBUG: mathml_content=<xsl:value-of select="$mathml_content"/> -->
6174
6491
  <xsl:attribute name="fox:actual-text">
@@ -6189,6 +6506,10 @@
6189
6506
  </fo:instream-foreign-object>
6190
6507
  </xsl:template>
6191
6508
 
6509
+ <xsl:template name="refine_mathml_insteam_object_style">
6510
+
6511
+ </xsl:template> <!-- refine_mathml_insteam_object_style -->
6512
+
6192
6513
  <xsl:template match="mathml:*" mode="mathml_actual_text">
6193
6514
  <!-- <xsl:text>a+b</xsl:text> -->
6194
6515
  <xsl:text>&lt;</xsl:text>
@@ -6333,6 +6654,8 @@
6333
6654
  <xsl:template match="*[local-name() = 'stem'][@type = 'AsciiMath'][count(*) = 0]/text() | *[local-name() = 'stem'][@type = 'AsciiMath'][*[local-name() = 'asciimath']]" priority="3">
6334
6655
  <fo:inline xsl:use-attribute-sets="mathml-style">
6335
6656
 
6657
+ <xsl:call-template name="refine_mathml-style"/>
6658
+
6336
6659
  <xsl:choose>
6337
6660
  <xsl:when test="self::text()"><xsl:value-of select="."/></xsl:when>
6338
6661
  <xsl:otherwise>
@@ -6377,11 +6700,7 @@
6377
6700
  <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
6378
6701
  </xsl:if>
6379
6702
 
6380
- <xsl:if test="ancestor::*[local-name() = 'bibitem']">
6381
- <xsl:attribute name="color">black</xsl:attribute>
6382
- <xsl:attribute name="text-decoration">none</xsl:attribute>
6383
- <xsl:attribute name="font-weight">300</xsl:attribute>
6384
- </xsl:if>
6703
+ <xsl:call-template name="refine_link-style"/>
6385
6704
 
6386
6705
  <xsl:choose>
6387
6706
  <xsl:when test="$target_text = ''">
@@ -6470,6 +6789,9 @@
6470
6789
  <xsl:call-template name="insert_basic_link">
6471
6790
  <xsl:with-param name="element">
6472
6791
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
6792
+ <xsl:if test="string-length(normalize-space()) &lt; 30 and not(contains(normalize-space(), 'http://')) and not(contains(normalize-space(), 'https://')) and not(ancestor::*[local-name() = 'table' or local-name() = 'dl'])">
6793
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
6794
+ </xsl:if>
6473
6795
  <xsl:if test="parent::*[local-name() = 'add']">
6474
6796
  <xsl:call-template name="append_add-style"/>
6475
6797
  </xsl:if>
@@ -6531,6 +6853,8 @@
6531
6853
  <fo:table-cell display-align="center">
6532
6854
  <fo:block xsl:use-attribute-sets="formula-stem-block-style">
6533
6855
 
6856
+ <xsl:call-template name="refine_formula-stem-block-style"/>
6857
+
6534
6858
  <xsl:apply-templates/>
6535
6859
  </fo:block>
6536
6860
  </fo:table-cell>
@@ -6572,17 +6896,18 @@
6572
6896
 
6573
6897
  <xsl:call-template name="setBlockSpanAll"/>
6574
6898
 
6575
- <xsl:if test="ancestor::rsd:ul or ancestor::rsd:ol and not(ancestor::rsd:note[1]/following-sibling::*)">
6576
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
6577
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
6578
- </xsl:if>
6899
+ <xsl:call-template name="refine_note-style"/>
6579
6900
 
6580
6901
  <fo:block-container margin-left="0mm" margin-right="0mm">
6581
6902
 
6582
6903
  <fo:block>
6583
6904
 
6905
+ <xsl:call-template name="refine_note_block_style"/>
6906
+
6584
6907
  <fo:inline xsl:use-attribute-sets="note-name-style">
6585
6908
 
6909
+ <xsl:call-template name="refine_note-name-style"/>
6910
+
6586
6911
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
6587
6912
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
6588
6913
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -6608,6 +6933,10 @@
6608
6933
 
6609
6934
  </xsl:template>
6610
6935
 
6936
+ <xsl:template name="refine_note_block_style">
6937
+
6938
+ </xsl:template>
6939
+
6611
6940
  <xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
6612
6941
  <xsl:variable name="num"><xsl:number/></xsl:variable>
6613
6942
  <xsl:choose>
@@ -6629,12 +6958,16 @@
6629
6958
 
6630
6959
  <xsl:call-template name="setBlockSpanAll"/>
6631
6960
 
6961
+ <xsl:call-template name="refine_termnote-style"/>
6962
+
6632
6963
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
6633
6964
 
6634
6965
  <xsl:if test="not(*[local-name() = 'name']/following-sibling::node()[1][self::text()][normalize-space()=''])">
6635
6966
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
6636
6967
  </xsl:if>
6637
6968
 
6969
+ <xsl:call-template name="refine_termnote-name-style"/>
6970
+
6638
6971
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
6639
6972
  <!-- <xsl:if test="*[not(local-name()='name')][1][node()[normalize-space() != ''][1][local-name() = 'add'] and node()[normalize-space() != ''][last()][local-name() = 'add']]"> -->
6640
6973
  <xsl:if test="*[not(local-name()='name')][1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
@@ -6809,6 +7142,8 @@
6809
7142
  <xsl:otherwise>
6810
7143
  <fo:block xsl:use-attribute-sets="image-style">
6811
7144
 
7145
+ <xsl:call-template name="refine_image-style"/>
7146
+
6812
7147
  <xsl:variable name="src">
6813
7148
  <xsl:call-template name="image_src"/>
6814
7149
  </xsl:variable>
@@ -7658,6 +7993,8 @@
7658
7993
  <xsl:if test="normalize-space() != ''">
7659
7994
  <fo:block xsl:use-attribute-sets="figure-name-style">
7660
7995
 
7996
+ <xsl:call-template name="refine_figure-name-style"/>
7997
+
7661
7998
  <xsl:apply-templates/>
7662
7999
  </fo:block>
7663
8000
  </xsl:if>
@@ -7928,19 +8265,7 @@
7928
8265
  </xsl:attribute>
7929
8266
  </xsl:for-each>
7930
8267
 
7931
- <!-- background for image -->
7932
- <xsl:if test="starts-with(*[local-name() = 'name']/text()[1], 'Figure ')">
7933
- <xsl:attribute name="background-color">rgb(236,242,246)</xsl:attribute>
7934
- <xsl:attribute name="padding-left">11mm</xsl:attribute>
7935
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
7936
- <xsl:attribute name="padding-right">11mm</xsl:attribute>
7937
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
7938
- <xsl:attribute name="padding-top">7.5mm</xsl:attribute>
7939
- <xsl:attribute name="padding-bottom">7.5mm</xsl:attribute>
7940
- <xsl:if test="following-sibling::*[1][local-name() = 'sourcecode'] and starts-with(*[local-name() = 'name']/text()[1], 'Figure ')">
7941
- <xsl:attribute name="margin-bottom">16pt</xsl:attribute>
7942
- </xsl:if>
7943
- </xsl:if>
8268
+ <xsl:call-template name="refine_sourcecode-style"/>
7944
8269
 
7945
8270
  <!-- remove margin between rows in the table with sourcecode line numbers -->
7946
8271
  <xsl:if test="ancestor::*[local-name() = 'sourcecode'][@linenums = 'true'] and ancestor::*[local-name() = 'tr'][1]/following-sibling::*[local-name() = 'tr']">
@@ -8644,10 +8969,7 @@
8644
8969
 
8645
8970
  <xsl:call-template name="setBlockSpanAll"/>
8646
8971
 
8647
- <xsl:if test="ancestor::rsd:ul or ancestor::rsd:ol">
8648
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
8649
- <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
8650
- </xsl:if>
8972
+ <xsl:call-template name="refine_example-style"/>
8651
8973
 
8652
8974
  <xsl:variable name="fo_element">
8653
8975
  <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl'] or *[not(local-name() = 'name')][1][local-name() = 'sourcecode']">block</xsl:if>
@@ -8781,6 +9103,8 @@
8781
9103
  </xsl:if>
8782
9104
  <fo:block xsl:use-attribute-sets="example-p-style">
8783
9105
 
9106
+ <xsl:call-template name="refine_example-p-style"/>
9107
+
8784
9108
  <xsl:apply-templates/>
8785
9109
  </fo:block>
8786
9110
  </fo:block-container>
@@ -8797,6 +9121,7 @@
8797
9121
  </xsl:otherwise>
8798
9122
  </xsl:choose>
8799
9123
  </xsl:template> <!-- example/p -->
9124
+
8800
9125
  <!-- ====== -->
8801
9126
  <!-- ====== -->
8802
9127
 
@@ -8808,6 +9133,8 @@
8808
9133
  <xsl:template match="*[local-name() = 'termsource']" name="termsource">
8809
9134
  <fo:block xsl:use-attribute-sets="termsource-style">
8810
9135
 
9136
+ <xsl:call-template name="refine_termsource-style"/>
9137
+
8811
9138
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
8812
9139
  <xsl:variable name="termsource_text">
8813
9140
  <xsl:apply-templates/>
@@ -8923,6 +9250,8 @@
8923
9250
  <fo:block-container margin-left="0mm">
8924
9251
  <fo:block-container xsl:use-attribute-sets="quote-style">
8925
9252
 
9253
+ <xsl:call-template name="refine_quote-style"/>
9254
+
8926
9255
  <fo:block-container margin-left="0mm" margin-right="0mm">
8927
9256
  <fo:block role="BlockQuote">
8928
9257
  <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
@@ -8997,8 +9326,7 @@
8997
9326
 
8998
9327
  </xsl:if>
8999
9328
 
9000
- <xsl:variable name="citeas" select="java:replaceAll(java:java.lang.String.new(@citeas),'^\[?(.+?)\]?$','$1')"/> <!-- remove leading and trailing brackets -->
9001
- <xsl:variable name="text" select="normalize-space()"/>
9329
+ <xsl:call-template name="refine_eref-style"/>
9002
9330
 
9003
9331
  <xsl:call-template name="insert_basic_link">
9004
9332
  <xsl:with-param name="element">
@@ -9008,6 +9336,8 @@
9008
9336
  </xsl:if>
9009
9337
  <xsl:if test="@type = 'inline'">
9010
9338
 
9339
+ <xsl:call-template name="refine_basic_link_style"/>
9340
+
9011
9341
  </xsl:if>
9012
9342
 
9013
9343
  <xsl:choose>
@@ -9040,6 +9370,11 @@
9040
9370
  </xsl:otherwise>
9041
9371
  </xsl:choose>
9042
9372
  </xsl:template>
9373
+
9374
+ <xsl:template name="refine_basic_link_style">
9375
+
9376
+ </xsl:template> <!-- refine_basic_link_style -->
9377
+
9043
9378
  <!-- ====== -->
9044
9379
  <!-- END eref -->
9045
9380
  <!-- ====== -->
@@ -9180,16 +9515,22 @@
9180
9515
  <fo:block>
9181
9516
  <xsl:call-template name="setId"/>
9182
9517
 
9183
- <xsl:variable name="pos"><xsl:number count="rsd:sections/rsd:clause[not(@type='scope') and not(@type='conformance')]"/></xsl:variable> <!-- | rsd:sections/rsd:terms -->
9184
- <xsl:if test="$pos &gt;= 2">
9185
- <xsl:attribute name="space-before">18pt</xsl:attribute>
9186
- </xsl:if>
9518
+ <xsl:call-template name="sections_element_style"/>
9187
9519
 
9188
9520
  <xsl:apply-templates/>
9189
9521
  </fo:block>
9190
9522
 
9191
9523
  </xsl:template>
9192
9524
 
9525
+ <xsl:template name="sections_element_style">
9526
+
9527
+ <xsl:variable name="pos"><xsl:number count="ribose:sections/ribose:clause[not(@type='scope') and not(@type='conformance')]"/></xsl:variable> <!-- | ribose:sections/ribose:terms -->
9528
+ <xsl:if test="$pos &gt;= 2">
9529
+ <xsl:attribute name="space-before">18pt</xsl:attribute>
9530
+ </xsl:if>
9531
+
9532
+ </xsl:template> <!-- sections_element_style -->
9533
+
9193
9534
  <xsl:template match="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*" priority="2"> <!-- /*/*[local-name() = 'preface']/* -->
9194
9535
  <fo:block break-after="page"/>
9195
9536
  <fo:block>
@@ -9204,10 +9545,16 @@
9204
9545
 
9205
9546
  <xsl:call-template name="setBlockSpanAll"/>
9206
9547
 
9548
+ <xsl:call-template name="refine_clause_style"/>
9549
+
9207
9550
  <xsl:apply-templates/>
9208
9551
  </fo:block>
9209
9552
  </xsl:template>
9210
9553
 
9554
+ <xsl:template name="refine_clause_style">
9555
+
9556
+ </xsl:template> <!-- refine_clause_style -->
9557
+
9211
9558
  <xsl:template match="*[local-name() = 'definitions']">
9212
9559
  <fo:block id="{@id}">
9213
9560
  <xsl:apply-templates/>
@@ -9220,10 +9567,16 @@
9220
9567
 
9221
9568
  <xsl:call-template name="setBlockSpanAll"/>
9222
9569
 
9570
+ <xsl:call-template name="refine_annex_style"/>
9571
+
9223
9572
  </fo:block>
9224
9573
  <xsl:apply-templates/>
9225
9574
  </xsl:template>
9226
9575
 
9576
+ <xsl:template name="refine_annex_style">
9577
+
9578
+ </xsl:template>
9579
+
9227
9580
  <xsl:template match="*[local-name() = 'review']"> <!-- 'review' will be processed in mn2pdf/review.xsl -->
9228
9581
  <!-- comment 2019-11-29 -->
9229
9582
  <!-- <fo:block font-weight="bold">Review:</fo:block>
@@ -9390,6 +9743,8 @@
9390
9743
  </xsl:choose>
9391
9744
  </xsl:attribute>
9392
9745
 
9746
+ <xsl:call-template name="refine_list_container_style"/>
9747
+
9393
9748
  <fo:block-container margin-left="0mm">
9394
9749
  <fo:block>
9395
9750
  <xsl:apply-templates select="." mode="list"/>
@@ -9407,6 +9762,10 @@
9407
9762
  </xsl:choose>
9408
9763
  </xsl:template>
9409
9764
 
9765
+ <xsl:template name="refine_list_container_style">
9766
+
9767
+ </xsl:template> <!-- refine_list_container_style -->
9768
+
9410
9769
  <xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="list" name="list">
9411
9770
 
9412
9771
  <xsl:apply-templates select="*[local-name() = 'name']">
@@ -9417,7 +9776,7 @@
9417
9776
 
9418
9777
  <xsl:variable name="provisional_distance_between_starts_">
9419
9778
  <attributes xsl:use-attribute-sets="list-style">
9420
-
9779
+ <xsl:call-template name="refine_list-style_provisional-distance-between-starts"/>
9421
9780
  </attributes>
9422
9781
  </xsl:variable>
9423
9782
  <xsl:variable name="provisional_distance_between_starts" select="normalize-space(xalan:nodeset($provisional_distance_between_starts_)/attributes/@provisional-distance-between-starts)"/>
@@ -9453,6 +9812,8 @@
9453
9812
  <addon><xsl:value-of select="$addon"/></addon> -->
9454
9813
  </xsl:if>
9455
9814
 
9815
+ <xsl:call-template name="refine_list-style"/>
9816
+
9456
9817
  <xsl:if test="*[local-name() = 'name']">
9457
9818
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
9458
9819
  </xsl:if>
@@ -9465,6 +9826,10 @@
9465
9826
  <xsl:apply-templates select="./*[local-name() = 'note']"/>
9466
9827
  </xsl:template>
9467
9828
 
9829
+ <xsl:template name="refine_list-style_provisional-distance-between-starts">
9830
+
9831
+ </xsl:template> <!-- refine_list-style_provisional-distance-between-starts -->
9832
+
9468
9833
  <xsl:template match="*[local-name() = 'ol' or local-name() = 'ul']/*[local-name() = 'name']">
9469
9834
  <xsl:param name="process">false</xsl:param>
9470
9835
  <xsl:if test="$process = 'true'">
@@ -9478,20 +9843,27 @@
9478
9843
  <fo:list-item xsl:use-attribute-sets="list-item-style">
9479
9844
  <xsl:copy-of select="@id"/>
9480
9845
 
9846
+ <xsl:call-template name="refine_list-item-style"/>
9847
+
9481
9848
  <fo:list-item-label end-indent="label-end()">
9482
9849
  <fo:block xsl:use-attribute-sets="list-item-label-style">
9483
9850
 
9851
+ <xsl:call-template name="refine_list-item-label-style"/>
9852
+
9484
9853
  <!-- if 'p' contains all text in 'add' first and last elements in first p are 'add' -->
9485
9854
  <xsl:if test="*[1][count(node()[normalize-space() != '']) = 1 and *[local-name() = 'add']]">
9486
9855
  <xsl:call-template name="append_add-style"/>
9487
9856
  </xsl:if>
9488
9857
 
9489
9858
  <xsl:call-template name="getListItemFormat"/>
9859
+
9490
9860
  </fo:block>
9491
9861
  </fo:list-item-label>
9492
9862
  <fo:list-item-body start-indent="body-start()" xsl:use-attribute-sets="list-item-body-style">
9493
9863
  <fo:block>
9494
9864
 
9865
+ <xsl:call-template name="refine_list-item-body-style"/>
9866
+
9495
9867
  <xsl:apply-templates/>
9496
9868
 
9497
9869
  <!-- <xsl:apply-templates select="node()[not(local-name() = 'note')]" />
@@ -9809,6 +10181,7 @@
9809
10181
 
9810
10182
  <fo:block id="{@id}">
9811
10183
  <xsl:apply-templates/>
10184
+
9812
10185
  </fo:block>
9813
10186
  </xsl:template>
9814
10187
 
@@ -9828,6 +10201,7 @@
9828
10201
 
9829
10202
  <fo:block id="{@id}" xsl:use-attribute-sets="references-non-normative-style">
9830
10203
  <xsl:apply-templates/>
10204
+
9831
10205
  </fo:block>
9832
10206
 
9833
10207
  </xsl:template> <!-- references -->
@@ -9862,7 +10236,7 @@
9862
10236
  <xsl:apply-templates select="*[local-name() = 'biblio-tag']">
9863
10237
  <xsl:with-param name="biblio_tag_part">last</xsl:with-param>
9864
10238
  </xsl:apply-templates>
9865
- <xsl:apply-templates select="rsd:formattedref"/>
10239
+ <xsl:apply-templates select="ribose:formattedref"/>
9866
10240
  </fo:block>
9867
10241
  </fo:list-item-body>
9868
10242
  </fo:list-item>
@@ -10402,6 +10776,9 @@
10402
10776
  </xsl:copy>
10403
10777
  </xsl:template>
10404
10778
 
10779
+ <!-- prevent empty thead processing in XSL-FO, remove it -->
10780
+ <xsl:template match="*[local-name() = 'table']/*[local-name() = 'thead'][count(*) = 0]" mode="update_xml_step1"/>
10781
+
10405
10782
  <xsl:template name="add_id">
10406
10783
  <xsl:if test="not(@id)">
10407
10784
  <!-- add @id - first element with @id plus '_element_name' -->
@@ -10686,6 +11063,14 @@
10686
11063
  <xsl:template match="*[local-name() = 'fn'][not(ancestor::*[(local-name() = 'table' or local-name() = 'figure')] and not(ancestor::*[local-name() = 'name']))]" mode="linear_xml" name="linear_xml_fn">
10687
11064
  <xsl:variable name="p_fn_">
10688
11065
  <xsl:call-template name="get_fn_list"/>
11066
+ <!-- <xsl:choose>
11067
+ <xsl:when test="$namespace = 'jis'">
11068
+ <xsl:call-template name="get_fn_list_for_element"/>
11069
+ </xsl:when>
11070
+ <xsl:otherwise>
11071
+ <xsl:call-template name="get_fn_list"/>
11072
+ </xsl:otherwise>
11073
+ </xsl:choose> -->
10689
11074
  </xsl:variable>
10690
11075
  <xsl:variable name="p_fn" select="xalan:nodeset($p_fn_)"/>
10691
11076
  <xsl:variable name="gen_id" select="generate-id(.)"/>
@@ -10700,8 +11085,14 @@
10700
11085
  <xsl:attribute name="current_fn_number">
10701
11086
  <xsl:value-of select="$current_fn_number"/>
10702
11087
  </xsl:attribute>
11088
+ <xsl:variable name="skip_footnote_body_" select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
10703
11089
  <xsl:attribute name="skip_footnote_body"> <!-- false for repeatable footnote -->
10704
- <xsl:value-of select="not($p_fn//fn[@gen_id = $gen_id] and (1 = 1))"/>
11090
+
11091
+ <xsl:value-of select="$skip_footnote_body_"/>
11092
+
11093
+ </xsl:attribute>
11094
+ <xsl:attribute name="ref_id">
11095
+ <xsl:value-of select="concat('footnote_', $lang, '_', $reference, '_', $current_fn_number)"/>
10705
11096
  </xsl:attribute>
10706
11097
  <xsl:apply-templates select="node()" mode="linear_xml"/>
10707
11098
  </xsl:copy>
@@ -11090,7 +11481,7 @@
11090
11481
  <xsl:variable name="documentNS" select="namespace-uri(/*)"/>
11091
11482
  <xsl:variable name="XSLNS">
11092
11483
 
11093
- <xsl:value-of select="document('')//*/namespace::rsd"/>
11484
+ <xsl:value-of select="document('')//*/namespace::ribose"/>
11094
11485
 
11095
11486
  </xsl:variable>
11096
11487
  <xsl:if test="$documentNS != $XSLNS">