metanorma-mpfa 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -63,7 +63,7 @@
63
63
 
64
64
  <xsl:template match="/">
65
65
  <xsl:call-template name="namespaceCheck"/>
66
- <fo:root font-family="Arial" font-size="10.5pt" xml:lang="{$lang}">
66
+ <fo:root xsl:use-attribute-sets="root-style" xml:lang="{$lang}">
67
67
  <fo:layout-master-set>
68
68
 
69
69
  <!-- cover page -->
@@ -265,9 +265,6 @@
265
265
  <!-- ============================= -->
266
266
  <!-- CONTENTS -->
267
267
  <!-- ============================= -->
268
- <xsl:template match="node()" mode="contents">
269
- <xsl:apply-templates mode="contents"/>
270
- </xsl:template>
271
268
 
272
269
  <!-- element with title -->
273
270
  <xsl:template match="*[mpfd:title]" mode="contents">
@@ -401,7 +398,7 @@
401
398
  </xsl:template>
402
399
 
403
400
 
404
- <xsl:template match="mpfd:p">
401
+ <xsl:template match="mpfd:p" name="paragraph">
405
402
  <xsl:param name="inline" select="'false'"/>
406
403
  <xsl:variable name="previous-element" select="local-name(preceding-sibling::*[1])"/>
407
404
  <xsl:variable name="element-name">
@@ -459,37 +456,6 @@
459
456
  </xsl:template>
460
457
 
461
458
 
462
-
463
- <xsl:template match="mpfd:bibitem">
464
- <fo:block id="{@id}" margin-bottom="12pt" text-indent="-11.7mm" margin-left="11.7mm">
465
- <xsl:call-template name="processBibitem"/>
466
- </fo:block>
467
- </xsl:template>
468
-
469
-
470
- <xsl:template match="mpfd:bibitem/mpfd:note">
471
- <fo:footnote>
472
- <xsl:variable name="number">
473
- <xsl:number level="any" count="mpfd:bibitem/mpfd:note"/>
474
- </xsl:variable>
475
- <fo:inline font-size="7pt" keep-with-previous.within-line="always" baseline-shift="30%">
476
- <fo:basic-link internal-destination="{generate-id()}" fox:alt-text="footnote {$number}">
477
- <xsl:value-of select="$number"/>
478
- </fo:basic-link>
479
- </fo:inline>
480
- <fo:footnote-body>
481
- <fo:block font-size="9pt" margin-bottom="4pt" start-indent="0pt">
482
- <fo:inline font-size="6pt" id="{generate-id()}" keep-with-next.within-line="always" baseline-shift="30%" padding-right="1mm"><!-- alignment-baseline="hanging" font-size="60%" -->
483
- <xsl:value-of select="$number"/>
484
- </fo:inline>
485
- <xsl:apply-templates/>
486
- </fo:block>
487
- </fo:footnote-body>
488
- </fo:footnote>
489
- </xsl:template>
490
-
491
-
492
-
493
459
  <xsl:template match="mpfd:ul | mpfd:ol" mode="ul_ol">
494
460
  <fo:block-container margin-left="0mm">
495
461
  <xsl:variable name="margin-left">
@@ -554,60 +520,12 @@
554
520
  </xsl:template>
555
521
 
556
522
 
557
- <xsl:template match="mpfd:references">
558
- <fo:block break-after="page"/>
559
- <xsl:apply-templates/>
560
- <fo:block id="{@id}">
561
- <xsl:apply-templates/>
562
- </fo:block>
563
- </xsl:template>
564
-
565
- <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
566
- <xsl:template match="mpfd:references/mpfd:bibitem">
567
- <fo:list-block id="{@id}" margin-bottom="12pt" provisional-distance-between-starts="12mm">
568
- <fo:list-item>
569
- <fo:list-item-label end-indent="label-end()">
570
- <fo:block>
571
- <fo:inline>
572
- <xsl:value-of select="mpfd:docidentifier[@type = 'metanorma-ordinal']"/>
573
- <xsl:if test="not(mpfd:docidentifier[@type = 'metanorma-ordinal'])">
574
- <xsl:number format="[1]"/>
575
- </xsl:if>
576
- </fo:inline>
577
- </fo:block>
578
- </fo:list-item-label>
579
- <fo:list-item-body start-indent="body-start()">
580
- <fo:block text-align="justify">
581
- <xsl:call-template name="processBibitem"/>
582
- </fo:block>
583
- </fo:list-item-body>
584
- </fo:list-item>
585
- </fo:list-block>
586
- </xsl:template>
587
-
588
- <xsl:template match="mpfd:references/mpfd:bibitem/mpfd:title">
589
- <fo:inline font-style="italic">
590
- <xsl:apply-templates/>
591
- </fo:inline>
592
- </xsl:template>
593
-
594
-
595
- <xsl:template match="mpfd:admonition">
596
- <fo:block text-align="center" margin-bottom="12pt" font-weight="bold">
597
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@type))"/>
598
- </fo:block>
599
- <fo:block font-weight="bold">
600
- <xsl:apply-templates/>
601
- </fo:block>
602
- </xsl:template>
603
-
604
-
605
523
  <xsl:template match="mpfd:formula/mpfd:stem">
606
524
  <fo:block margin-top="14pt" margin-bottom="14pt" text-align-last="justify">
607
525
  <fo:inline padding-left="5mm"><xsl:apply-templates/></fo:inline>
608
526
  <fo:inline keep-together.within-line="always">
609
527
  <fo:leader leader-pattern="space"/>
610
- <xsl:apply-templates select="../mpfd:name" mode="presentation"/>
528
+ <xsl:apply-templates select="../mpfd:name" mode="formula_number"/>
611
529
  </fo:inline>
612
530
  </fo:block>
613
531
  </xsl:template>
@@ -696,22 +614,18 @@
696
614
  </xsl:template>
697
615
 
698
616
 
699
- <xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="titles_">
617
+ <xsl:variable name="titles_">
700
618
 
701
619
  <title-edition lang="en">
702
620
 
703
- <xsl:text>Edition </xsl:text>
704
-
705
-
621
+ <xsl:text>Edition </xsl:text>
622
+
706
623
  </title-edition>
707
624
 
708
625
  <title-edition lang="fr">
709
-
710
- <xsl:text>Édition </xsl:text>
711
-
626
+ <xsl:text>Édition </xsl:text>
712
627
  </title-edition>
713
628
 
714
-
715
629
  <!-- These titles of Table of contents renders different than determined in localized-strings -->
716
630
  <title-toc lang="en">
717
631
 
@@ -721,14 +635,13 @@
721
635
 
722
636
  </title-toc>
723
637
  <title-toc lang="fr">
638
+ <xsl:text>Sommaire</xsl:text>
639
+ </title-toc>
640
+ <title-toc lang="zh">
724
641
 
725
- <xsl:text>Sommaire</xsl:text>
726
-
642
+ <xsl:text>Contents</xsl:text>
643
+
727
644
  </title-toc>
728
-
729
- <title-toc lang="zh">Contents</title-toc>
730
-
731
-
732
645
 
733
646
  <title-descriptors lang="en">Descriptors</title-descriptors>
734
647
 
@@ -744,12 +657,8 @@
744
657
  </title-part>
745
658
  <title-part lang="zh">第 # 部分:</title-part>
746
659
 
747
- <title-subpart lang="en">
748
-
749
- </title-subpart>
750
- <title-subpart lang="fr">
751
-
752
- </title-subpart>
660
+ <title-subpart lang="en">Sub-part #</title-subpart>
661
+ <title-subpart lang="fr">Partie de sub #</title-subpart>
753
662
 
754
663
  <title-list-tables lang="en">List of Tables</title-list-tables>
755
664
 
@@ -764,7 +673,7 @@
764
673
  <title-continued lang="en">(continued)</title-continued>
765
674
  <title-continued lang="fr">(continué)</title-continued>
766
675
 
767
- </xsl:variable><xsl:variable name="bibdata">
676
+ </xsl:variable><xsl:variable name="titles" select="xalan:nodeset($titles_)"/><xsl:variable name="bibdata">
768
677
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
769
678
  <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
770
679
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
@@ -793,6 +702,23 @@
793
702
  </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="root-style">
794
703
 
795
704
 
705
+
706
+
707
+
708
+
709
+
710
+
711
+
712
+
713
+
714
+ <xsl:attribute name="font-family">Arial</xsl:attribute>
715
+ <xsl:attribute name="font-size">10.5pt</xsl:attribute>
716
+
717
+
718
+
719
+
720
+
721
+
796
722
  </xsl:attribute-set><xsl:attribute-set name="link-style">
797
723
 
798
724
 
@@ -802,6 +728,9 @@
802
728
 
803
729
 
804
730
 
731
+ </xsl:attribute-set><xsl:attribute-set name="sourcecode-container-style">
732
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
733
+
805
734
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
806
735
  <xsl:attribute name="white-space">pre</xsl:attribute>
807
736
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -811,10 +740,17 @@
811
740
 
812
741
 
813
742
 
743
+
744
+
745
+
746
+
747
+
814
748
 
815
749
 
816
750
 
817
751
 
752
+
753
+
818
754
  </xsl:attribute-set><xsl:attribute-set name="permission-style">
819
755
 
820
756
  </xsl:attribute-set><xsl:attribute-set name="permission-name-style">
@@ -922,7 +858,61 @@
922
858
 
923
859
  </xsl:attribute-set><xsl:variable name="table-border_">
924
860
 
925
- </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-name-style">
861
+ </xsl:variable><xsl:variable name="table-border" select="normalize-space($table-border_)"/><xsl:attribute-set name="table-container-style">
862
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
863
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
864
+
865
+
866
+
867
+
868
+
869
+
870
+
871
+
872
+
873
+
874
+
875
+
876
+
877
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
878
+
879
+
880
+
881
+
882
+
883
+
884
+
885
+
886
+
887
+ </xsl:attribute-set><xsl:attribute-set name="table-style">
888
+ <xsl:attribute name="table-omit-footer-at-break">true</xsl:attribute>
889
+ <xsl:attribute name="table-layout">fixed</xsl:attribute>
890
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
891
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
892
+
893
+
894
+
895
+
896
+
897
+
898
+
899
+
900
+
901
+
902
+
903
+
904
+
905
+ <xsl:attribute name="border-top">2pt solid black</xsl:attribute>
906
+ <xsl:attribute name="border-bottom">2pt solid black</xsl:attribute>
907
+
908
+
909
+
910
+
911
+
912
+
913
+
914
+
915
+ </xsl:attribute-set><xsl:attribute-set name="table-name-style">
926
916
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
927
917
 
928
918
 
@@ -942,7 +932,147 @@
942
932
 
943
933
 
944
934
 
935
+ </xsl:attribute-set><xsl:attribute-set name="table-row-style">
936
+ <xsl:attribute name="min-height">4mm</xsl:attribute>
937
+
938
+
939
+
940
+
941
+ </xsl:attribute-set><xsl:attribute-set name="table-header-row-style" use-attribute-sets="table-row-style">
942
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
943
+
944
+
945
+
946
+
947
+
948
+
949
+
950
+
951
+
952
+ </xsl:attribute-set><xsl:attribute-set name="table-footer-row-style" use-attribute-sets="table-row-style">
953
+
954
+
955
+
956
+ </xsl:attribute-set><xsl:attribute-set name="table-body-row-style" use-attribute-sets="table-row-style">
957
+
958
+ </xsl:attribute-set><xsl:attribute-set name="table-header-cell-style">
959
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
960
+ <xsl:attribute name="border">solid black 1pt</xsl:attribute>
961
+ <xsl:attribute name="padding-left">1mm</xsl:attribute>
962
+ <xsl:attribute name="display-align">center</xsl:attribute>
963
+
964
+
965
+
966
+
967
+
968
+
969
+
970
+ <xsl:attribute name="border-top">solid black 2pt</xsl:attribute>
971
+ <xsl:attribute name="border-bottom">solid black 2pt</xsl:attribute>
972
+
973
+
974
+
975
+
976
+
977
+
978
+
979
+ </xsl:attribute-set><xsl:attribute-set name="table-cell-style">
980
+ <xsl:attribute name="display-align">center</xsl:attribute>
981
+ <xsl:attribute name="border">solid black 1pt</xsl:attribute>
982
+ <xsl:attribute name="padding-left">1mm</xsl:attribute>
983
+
984
+
985
+
986
+
987
+
988
+
989
+
990
+
991
+
992
+
993
+
994
+
995
+
945
996
  </xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style">
997
+ <xsl:attribute name="border">solid black 1pt</xsl:attribute>
998
+ <xsl:attribute name="padding-left">1mm</xsl:attribute>
999
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
1000
+ <xsl:attribute name="padding-top">1mm</xsl:attribute>
1001
+
1002
+
1003
+
1004
+
1005
+
1006
+
1007
+
1008
+
1009
+
1010
+
1011
+
1012
+ </xsl:attribute-set><xsl:attribute-set name="table-note-style">
1013
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1014
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1015
+
1016
+
1017
+
1018
+
1019
+
1020
+
1021
+
1022
+
1023
+ </xsl:attribute-set><xsl:attribute-set name="table-fn-style">
1024
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1025
+
1026
+
1027
+
1028
+
1029
+
1030
+
1031
+ </xsl:attribute-set><xsl:attribute-set name="table-fn-number-style">
1032
+ <xsl:attribute name="font-size">80%</xsl:attribute>
1033
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
1034
+
1035
+
1036
+
1037
+
1038
+
1039
+
1040
+
1041
+
1042
+
1043
+
1044
+
1045
+
1046
+ </xsl:attribute-set><xsl:attribute-set name="fn-container-body-style">
1047
+ <xsl:attribute name="text-indent">0</xsl:attribute>
1048
+ <xsl:attribute name="start-indent">0</xsl:attribute>
1049
+
1050
+
1051
+ </xsl:attribute-set><xsl:attribute-set name="table-fn-body-style">
1052
+
1053
+ </xsl:attribute-set><xsl:attribute-set name="figure-fn-number-style">
1054
+ <xsl:attribute name="font-size">80%</xsl:attribute>
1055
+ <xsl:attribute name="padding-right">5mm</xsl:attribute>
1056
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
1057
+
1058
+ </xsl:attribute-set><xsl:attribute-set name="figure-fn-body-style">
1059
+ <xsl:attribute name="text-align">justify</xsl:attribute>
1060
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1061
+
1062
+ </xsl:attribute-set><xsl:attribute-set name="dt-row-style">
1063
+
1064
+
1065
+ </xsl:attribute-set><xsl:attribute-set name="dt-style">
1066
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
1067
+
1068
+
1069
+
1070
+
1071
+
1072
+
1073
+
1074
+
1075
+
946
1076
 
947
1077
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
948
1078
 
@@ -1003,6 +1133,7 @@
1003
1133
 
1004
1134
 
1005
1135
  </xsl:attribute-set><xsl:attribute-set name="table-note-name-style">
1136
+ <xsl:attribute name="padding-right">2mm</xsl:attribute>
1006
1137
 
1007
1138
 
1008
1139
 
@@ -1060,6 +1191,9 @@
1060
1191
 
1061
1192
 
1062
1193
 
1194
+ </xsl:attribute-set><xsl:attribute-set name="termsource-text-style">
1195
+
1196
+
1063
1197
  </xsl:attribute-set><xsl:attribute-set name="origin-style">
1064
1198
 
1065
1199
 
@@ -1067,6 +1201,8 @@
1067
1201
 
1068
1202
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1069
1203
 
1204
+ </xsl:attribute-set><xsl:attribute-set name="figure-style">
1205
+
1070
1206
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
1071
1207
 
1072
1208
 
@@ -1164,6 +1300,17 @@
1164
1300
 
1165
1301
  </xsl:attribute-set><xsl:attribute-set name="toc-style">
1166
1302
  <xsl:attribute name="line-height">135%</xsl:attribute>
1303
+ </xsl:attribute-set><xsl:attribute-set name="fn-reference-style">
1304
+ <xsl:attribute name="font-size">80%</xsl:attribute>
1305
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1306
+
1307
+
1308
+
1309
+
1310
+
1311
+
1312
+
1313
+
1167
1314
  </xsl:attribute-set><xsl:attribute-set name="fn-style">
1168
1315
  <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1169
1316
  </xsl:attribute-set><xsl:attribute-set name="fn-num-style">
@@ -1236,30 +1383,198 @@
1236
1383
 
1237
1384
 
1238
1385
 
1239
- </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:variable name="ace_tag">ace-tag_</xsl:variable><xsl:template name="OLD_processPrefaceSectionsDefault_Contents">
1240
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
1241
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
1242
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
1243
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
1244
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
1245
- </xsl:template><xsl:template name="processPrefaceSectionsDefault_Contents">
1386
+ </xsl:attribute-set><xsl:attribute-set name="admonition-style">
1387
+
1388
+
1389
+
1390
+
1391
+
1392
+
1393
+
1394
+
1395
+
1396
+
1397
+
1398
+
1399
+
1400
+
1401
+ </xsl:attribute-set><xsl:attribute-set name="admonition-container-style">
1402
+
1403
+
1404
+
1405
+
1406
+
1407
+
1408
+
1409
+
1410
+
1411
+
1412
+ </xsl:attribute-set><xsl:attribute-set name="admonition-name-style">
1413
+ <xsl:attribute name="keep-with-next">always</xsl:attribute>
1414
+
1415
+
1416
+
1417
+
1418
+
1419
+
1420
+
1421
+ <xsl:attribute name="text-align">center</xsl:attribute>
1422
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1423
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1424
+
1425
+
1426
+
1427
+
1428
+
1429
+
1430
+
1431
+ </xsl:attribute-set><xsl:attribute-set name="admonition-p-style">
1432
+
1433
+
1434
+
1435
+
1436
+
1437
+
1438
+
1439
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
1440
+
1441
+
1442
+
1443
+
1444
+
1445
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-normative-style">
1446
+
1447
+
1448
+
1449
+
1450
+
1451
+
1452
+
1453
+
1454
+
1455
+
1456
+
1457
+
1458
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1459
+ <xsl:attribute name="text-indent">-11.7mm</xsl:attribute>
1460
+ <xsl:attribute name="margin-left">11.7mm</xsl:attribute>
1461
+
1462
+
1463
+
1464
+
1465
+
1466
+
1467
+
1468
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-normative-list-style">
1469
+ <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
1470
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1471
+
1472
+
1473
+
1474
+
1475
+
1476
+
1477
+
1478
+
1479
+
1480
+
1481
+
1482
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-non-normative-style">
1483
+
1484
+
1485
+
1486
+
1487
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-non-normative-list-style">
1488
+ <xsl:attribute name="provisional-distance-between-starts">12mm</xsl:attribute>
1489
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1490
+
1491
+
1492
+
1493
+
1494
+
1495
+
1496
+
1497
+
1498
+
1499
+
1500
+
1501
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-normative-list-body-style">
1502
+
1503
+
1504
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-non-normative-list-body-style">
1505
+
1506
+
1507
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-style">
1508
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
1509
+ <xsl:attribute name="font-size">65%</xsl:attribute>
1510
+
1511
+
1512
+
1513
+
1514
+
1515
+
1516
+
1517
+
1518
+
1519
+
1520
+
1521
+
1522
+ <xsl:attribute name="font-size">7pt</xsl:attribute>
1523
+ <xsl:attribute name="baseline-shift">30%</xsl:attribute>
1524
+
1525
+
1526
+
1527
+
1528
+
1529
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-number-style">
1530
+ <xsl:attribute name="keep-with-next.within-line">always</xsl:attribute>
1531
+
1532
+
1533
+
1534
+
1535
+
1536
+
1537
+
1538
+
1539
+
1540
+
1541
+
1542
+
1543
+ <xsl:attribute name="font-size">6pt</xsl:attribute>
1544
+ <xsl:attribute name="baseline-shift">30%</xsl:attribute>
1545
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
1546
+
1547
+
1548
+
1549
+
1550
+
1551
+ </xsl:attribute-set><xsl:attribute-set name="bibitem-note-fn-body-style">
1552
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
1553
+ <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1554
+ <xsl:attribute name="start-indent">0pt</xsl:attribute>
1555
+
1556
+
1557
+
1558
+
1559
+
1560
+
1561
+
1562
+
1563
+
1564
+
1565
+ <xsl:attribute name="font-size">9pt</xsl:attribute>
1566
+ <xsl:attribute name="margin-bottom">4pt</xsl:attribute>
1567
+
1568
+
1569
+ </xsl:attribute-set><xsl:attribute-set name="references-non-normative-style">
1570
+
1571
+
1572
+
1573
+ </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:variable name="ace_tag">ace-tag_</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
1246
1574
  <xsl:for-each select="/*/*[local-name()='preface']/*">
1247
1575
  <xsl:sort select="@displayorder" data-type="number"/>
1248
1576
  <xsl:apply-templates select="." mode="contents"/>
1249
1577
  </xsl:for-each>
1250
- </xsl:template><xsl:template name="OLD_processMainSectionsDefault_Contents">
1251
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="contents"/>
1252
-
1253
- <!-- Normative references -->
1254
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]" mode="contents"/>
1255
- <!-- Terms and definitions -->
1256
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]" mode="contents"/>
1257
- <!-- Another main sections -->
1258
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]" mode="contents"/>
1259
- <xsl:apply-templates select="/*/*[local-name()='annex']" mode="contents"/>
1260
- <!-- Bibliography -->
1261
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][not(@normative='true')]]" mode="contents"/>
1262
-
1263
1578
  </xsl:template><xsl:template name="processMainSectionsDefault_Contents">
1264
1579
 
1265
1580
  <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true'] | /*/*[local-name()='bibliography']/*[local-name()='clause'][*[local-name()='references'][@normative='true']]">
@@ -1276,29 +1591,11 @@
1276
1591
  <xsl:sort select="@displayorder" data-type="number"/>
1277
1592
  <xsl:apply-templates select="." mode="contents"/>
1278
1593
  </xsl:for-each>
1279
- </xsl:template><xsl:template name="OLD_processPrefaceSectionsDefault">
1280
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']"/>
1281
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']"/>
1282
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']"/>
1283
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']"/>
1284
- <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']"/>
1285
1594
  </xsl:template><xsl:template name="processPrefaceSectionsDefault">
1286
1595
  <xsl:for-each select="/*/*[local-name()='preface']/*">
1287
1596
  <xsl:sort select="@displayorder" data-type="number"/>
1288
1597
  <xsl:apply-templates select="."/>
1289
1598
  </xsl:for-each>
1290
- </xsl:template><xsl:template name="OLD_processMainSectionsDefault">
1291
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']"/>
1292
-
1293
- <!-- Normative references -->
1294
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']"/>
1295
- <!-- Terms and definitions -->
1296
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name()='terms'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] | /*/*[local-name()='sections']/*[local-name()='definitions'] | /*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]"/>
1297
- <!-- Another main sections -->
1298
- <xsl:apply-templates select="/*/*[local-name()='sections']/*[local-name() != 'terms' and local-name() != 'definitions' and not(@type='scope') and not(local-name() = 'clause' and .//*[local-name()='terms']) and not(local-name() = 'clause' and .//*[local-name()='definitions'])]"/>
1299
- <xsl:apply-templates select="/*/*[local-name()='annex']"/>
1300
- <!-- Bibliography -->
1301
- <xsl:apply-templates select="/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]"/>
1302
1599
  </xsl:template><xsl:template name="processMainSectionsDefault">
1303
1600
  <xsl:for-each select="/*/*[local-name()='sections']/* | /*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']">
1304
1601
  <xsl:sort select="@displayorder" data-type="number"/>
@@ -1335,43 +1632,19 @@
1335
1632
  <xsl:call-template name="getSimpleTable"/>
1336
1633
  </xsl:variable>
1337
1634
 
1338
- <!-- <xsl:if test="$namespace = 'bipm'">
1339
- <fo:block>&#xA0;</fo:block>
1340
- </xsl:if> -->
1341
-
1342
1635
 
1343
1636
  <!-- Display table's name before table as standalone block -->
1344
1637
  <!-- $namespace = 'iso' or -->
1345
1638
 
1346
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1347
-
1348
-
1349
-
1350
-
1639
+ <xsl:apply-templates select="*[local-name()='name']"/> <!-- table's title rendered before table -->
1640
+
1351
1641
 
1352
- <xsl:call-template name="fn_name_display"/>
1353
1642
 
1643
+ <xsl:call-template name="table_name_fn_display"/>
1354
1644
 
1355
1645
 
1356
1646
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
1357
1647
 
1358
- <!-- <xsl:variable name="cols-count">
1359
- <xsl:choose>
1360
- <xsl:when test="*[local-name()='thead']">
1361
- <xsl:call-template name="calculate-columns-numbers">
1362
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
1363
- </xsl:call-template>
1364
- </xsl:when>
1365
- <xsl:otherwise>
1366
- <xsl:call-template name="calculate-columns-numbers">
1367
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
1368
- </xsl:call-template>
1369
- </xsl:otherwise>
1370
- </xsl:choose>
1371
- </xsl:variable> -->
1372
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
1373
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
1374
-
1375
1648
  <xsl:variable name="colwidths">
1376
1649
  <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
1377
1650
  <xsl:call-template name="calculate-column-widths">
@@ -1382,17 +1655,8 @@
1382
1655
  </xsl:variable>
1383
1656
  <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1384
1657
 
1385
- <!-- <xsl:variable name="colwidths2">
1386
- <xsl:call-template name="calculate-column-widths">
1387
- <xsl:with-param name="cols-count" select="$cols-count"/>
1388
- </xsl:call-template>
1389
- </xsl:variable> -->
1390
-
1391
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
1392
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
1393
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
1394
1658
 
1395
- <xsl:variable name="margin-left">
1659
+ <xsl:variable name="margin-side">
1396
1660
  <xsl:choose>
1397
1661
  <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
1398
1662
  <xsl:otherwise>0</xsl:otherwise>
@@ -1400,70 +1664,61 @@
1400
1664
  </xsl:variable>
1401
1665
 
1402
1666
 
1403
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1404
-
1405
-
1406
-
1407
-
1408
-
1409
-
1410
-
1411
-
1412
-
1667
+ <fo:block-container xsl:use-attribute-sets="table-container-style">
1668
+
1413
1669
 
1670
+
1414
1671
 
1672
+
1415
1673
 
1674
+
1416
1675
 
1417
1676
 
1418
1677
 
1419
- <xsl:attribute name="space-after">12pt</xsl:attribute>
1420
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
1421
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
1678
+
1422
1679
 
1423
1680
 
1424
1681
 
1425
1682
 
1426
1683
 
1684
+ <!-- end table block-container attributes -->
1427
1685
 
1428
1686
  <!-- display table's name before table for PAS inside block-container (2-columnn layout) -->
1429
1687
 
1430
1688
 
1689
+ <xsl:variable name="table_width_default">100%</xsl:variable>
1431
1690
  <xsl:variable name="table_width">
1432
1691
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
1433
- 100%
1434
-
1435
-
1692
+ <xsl:value-of select="$table_width_default"/>
1436
1693
  </xsl:variable>
1437
1694
 
1695
+
1438
1696
  <xsl:variable name="table_attributes">
1439
- <attribute name="table-layout">fixed</attribute>
1440
- <attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
1441
- <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1442
- <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1443
-
1444
-
1445
-
1446
-
1447
-
1448
-
1449
-
1450
-
1451
-
1452
-
1453
-
1454
-
1455
- <attribute name="border-top">2pt solid black</attribute>
1456
- <attribute name="border-bottom">2pt solid black</attribute>
1457
-
1458
-
1459
-
1697
+
1698
+ <xsl:element name="table_attributes" use-attribute-sets="table-style">
1699
+ <xsl:attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></xsl:attribute>
1700
+
1701
+
1702
+
1703
+
1704
+
1705
+
1706
+
1707
+
1708
+
1709
+
1710
+
1711
+
1712
+
1713
+
1714
+ </xsl:element>
1460
1715
  </xsl:variable>
1461
1716
 
1462
1717
 
1463
- <fo:table id="{@id}" table-omit-footer-at-break="true">
1718
+ <fo:table id="{@id}">
1464
1719
 
1465
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1466
- <xsl:attribute name="{@name}">
1720
+ <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
1721
+ <xsl:attribute name="{local-name()}">
1467
1722
  <xsl:value-of select="."/>
1468
1723
  </xsl:attribute>
1469
1724
  </xsl:for-each>
@@ -1474,7 +1729,6 @@
1474
1729
  </xsl:if>
1475
1730
 
1476
1731
 
1477
-
1478
1732
  <xsl:choose>
1479
1733
  <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
1480
1734
  <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
@@ -1500,7 +1754,7 @@
1500
1754
  <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
1501
1755
  </xsl:when>
1502
1756
  <xsl:otherwise>
1503
- <xsl:apply-templates/>
1757
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
1504
1758
  </xsl:otherwise>
1505
1759
  </xsl:choose>
1506
1760
 
@@ -1515,25 +1769,6 @@
1515
1769
  </xsl:call-template>
1516
1770
  </xsl:for-each>
1517
1771
 
1518
- <!-- insert footer as table -->
1519
- <!-- <fo:table>
1520
- <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1521
- <xsl:attribute name="{@name}">
1522
- <xsl:value-of select="."/>
1523
- </xsl:attribute>
1524
- </xsl:for-each>
1525
-
1526
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
1527
- <xsl:choose>
1528
- <xsl:when test=". = 1 or . = 0">
1529
- <fo:table-column column-width="proportional-column-width(2)"/>
1530
- </xsl:when>
1531
- <xsl:otherwise>
1532
- <fo:table-column column-width="proportional-column-width({.})"/>
1533
- </xsl:otherwise>
1534
- </xsl:choose>
1535
- </xsl:for-each>
1536
- </fo:table>-->
1537
1772
 
1538
1773
 
1539
1774
 
@@ -1594,18 +1829,17 @@
1594
1829
  </xsl:otherwise>
1595
1830
  </xsl:choose>
1596
1831
 
1597
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1832
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']">
1598
1833
  <xsl:param name="continued"/>
1599
1834
  <xsl:if test="normalize-space() != ''">
1600
1835
  <fo:block xsl:use-attribute-sets="table-name-style">
1601
-
1836
+
1602
1837
 
1603
1838
 
1604
1839
 
1605
1840
 
1606
1841
  <xsl:choose>
1607
1842
  <xsl:when test="$continued = 'true'">
1608
- <!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
1609
1843
 
1610
1844
  </xsl:when>
1611
1845
  <xsl:otherwise>
@@ -1668,13 +1902,6 @@
1668
1902
  <xsl:for-each select="xalan:nodeset($table)/*/tr">
1669
1903
  <xsl:variable name="td_text">
1670
1904
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
1671
-
1672
- <!-- <xsl:if test="$namespace = 'bipm'">
1673
- <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
1674
- <word><xsl:value-of select="normalize-space(.)"/></word>
1675
- </xsl:for-each>
1676
- </xsl:if> -->
1677
-
1678
1905
  </xsl:variable>
1679
1906
  <xsl:variable name="words">
1680
1907
  <xsl:variable name="string_with_added_zerospaces">
@@ -1711,7 +1938,6 @@
1711
1938
  </xsl:otherwise>
1712
1939
  </xsl:choose>
1713
1940
  </xsl:variable>
1714
-
1715
1941
 
1716
1942
  <column>
1717
1943
  <xsl:for-each select="xalan:nodeset($widths)//width">
@@ -1747,7 +1973,6 @@
1747
1973
  <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
1748
1974
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1749
1975
  <xsl:param name="cols-count"/>
1750
- <!-- font-weight="bold" -->
1751
1976
  <fo:table-header>
1752
1977
 
1753
1978
 
@@ -1759,13 +1984,12 @@
1759
1984
  <fo:table-row>
1760
1985
  <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">
1761
1986
 
1762
- <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
1987
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']">
1763
1988
  <xsl:with-param name="continued">true</xsl:with-param>
1764
1989
  </xsl:apply-templates>
1765
1990
 
1766
1991
 
1767
1992
 
1768
-
1769
1993
  </fo:table-cell>
1770
1994
  </fo:table-row>
1771
1995
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
@@ -1781,64 +2005,6 @@
1781
2005
  <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
1782
2006
  </fo:table-footer>
1783
2007
  </xsl:if>
1784
- </xsl:template><xsl:template name="insertTableFooter2">
1785
- <xsl:param name="cols-count"/>
1786
- <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1787
- <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
1788
-
1789
- <fo:table-footer>
1790
-
1791
- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
1792
-
1793
- <!-- if there are note(s) or fn(s) then create footer row -->
1794
- <xsl:if test="$isNoteOrFnExist = 'true'">
1795
-
1796
-
1797
-
1798
- <fo:table-row>
1799
- <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
1800
-
1801
-
1802
-
1803
- <!-- fn will be processed inside 'note' processing -->
1804
-
1805
-
1806
-
1807
-
1808
-
1809
-
1810
- <!-- except gb -->
1811
-
1812
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1813
-
1814
-
1815
- <!-- show Note under table in preface (ex. abstract) sections -->
1816
- <!-- empty, because notes show at page side in main sections -->
1817
- <!-- <xsl:if test="$namespace = 'bipm'">
1818
- <xsl:choose>
1819
- <xsl:when test="ancestor::*[local-name()='preface']">
1820
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1821
- </xsl:when>
1822
- <xsl:otherwise>
1823
- <fo:block/>
1824
- </xsl:otherwise>
1825
- </xsl:choose>
1826
- </xsl:if> -->
1827
-
1828
-
1829
- <!-- horizontal row separator -->
1830
-
1831
-
1832
- <!-- fn processing -->
1833
- <xsl:call-template name="fn_display"/>
1834
-
1835
- </fo:table-cell>
1836
- </fo:table-row>
1837
-
1838
- </xsl:if>
1839
- </fo:table-footer>
1840
-
1841
- </xsl:if>
1842
2008
  </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
1843
2009
  <xsl:param name="table_attributes"/>
1844
2010
  <xsl:param name="colwidths"/>
@@ -1864,17 +2030,18 @@
1864
2030
  </xsl:variable>
1865
2031
 
1866
2032
  <fo:table keep-with-previous="always">
1867
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
2033
+ <xsl:for-each select="xalan:nodeset($table_attributes)/table_attributes/@*">
2034
+ <xsl:variable name="name" select="local-name()"/>
1868
2035
  <xsl:choose>
1869
- <xsl:when test="@name = 'border-top'">
1870
- <xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
2036
+ <xsl:when test="$name = 'border-top'">
2037
+ <xsl:attribute name="{$name}">0pt solid black</xsl:attribute>
1871
2038
  </xsl:when>
1872
- <xsl:when test="@name = 'border'">
1873
- <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
2039
+ <xsl:when test="$name = 'border'">
2040
+ <xsl:attribute name="{$name}"><xsl:value-of select="."/></xsl:attribute>
1874
2041
  <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
1875
2042
  </xsl:when>
1876
2043
  <xsl:otherwise>
1877
- <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
2044
+ <xsl:attribute name="{$name}"><xsl:value-of select="."/></xsl:attribute>
1878
2045
  </xsl:otherwise>
1879
2046
  </xsl:choose>
1880
2047
  </xsl:for-each>
@@ -1903,9 +2070,10 @@
1903
2070
 
1904
2071
  <fo:table-body>
1905
2072
  <fo:table-row>
1906
- <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
2073
+ <fo:table-cell xsl:use-attribute-sets="table-footer-cell-style" number-columns-spanned="{$cols-count}">
1907
2074
 
1908
2075
 
2076
+
1909
2077
 
1910
2078
 
1911
2079
  <!-- fn will be processed inside 'note' processing -->
@@ -1915,37 +2083,20 @@
1915
2083
 
1916
2084
 
1917
2085
 
1918
-
1919
-
1920
-
1921
2086
  <!-- for BSI (not PAS) display Notes before footnotes -->
1922
2087
 
1923
2088
 
1924
- <!-- except gb -->
1925
-
1926
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2089
+ <!-- except gb and bsi -->
1927
2090
 
1928
-
1929
- <!-- <xsl:if test="$namespace = 'bipm'">
1930
- <xsl:choose>
1931
- <xsl:when test="ancestor::*[local-name()='preface']">
1932
- show Note under table in preface (ex. abstract) sections
1933
- <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1934
- </xsl:when>
1935
- <xsl:otherwise>
1936
- empty, because notes show at page side in main sections
1937
- <fo:block/>
1938
- </xsl:otherwise>
1939
- </xsl:choose>
1940
- </xsl:if> -->
2091
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2092
+
1941
2093
 
1942
2094
 
1943
2095
  <!-- horizontal row separator -->
1944
2096
 
1945
2097
 
1946
2098
  <!-- fn processing -->
1947
- <xsl:call-template name="fn_display"/>
1948
-
2099
+ <xsl:call-template name="table_fn_display"/>
1949
2100
 
1950
2101
  <!-- for PAS display Notes after footnotes -->
1951
2102
 
@@ -1987,104 +2138,84 @@
1987
2138
 
1988
2139
 
1989
2140
  <xsl:apply-templates/>
1990
- <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> -->
1991
-
2141
+
1992
2142
  </fo:table-body>
1993
2143
 
1994
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
1995
- <xsl:choose>
1996
- <xsl:when test="substring-after(., '—') != ''">
1997
- <xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
1998
- </xsl:when>
1999
- <xsl:otherwise>
2000
- <xsl:value-of select="."/>
2001
- </xsl:otherwise>
2002
- </xsl:choose>
2003
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
2004
- <xsl:apply-templates mode="presentation_name"/>
2005
- </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
2006
- <xsl:apply-templates select="."/>
2007
- </xsl:template><xsl:template match="*[local-name()='tr']">
2008
- <xsl:variable name="parent-name" select="local-name(..)"/>
2009
- <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
2010
- <fo:table-row min-height="4mm">
2011
- <xsl:if test="$parent-name = 'thead'">
2012
- <xsl:attribute name="font-weight">bold</xsl:attribute>
2013
-
2014
-
2015
-
2016
-
2017
-
2018
-
2019
-
2020
-
2021
- </xsl:if>
2022
- <xsl:if test="$parent-name = 'tfoot'">
2023
-
2024
-
2025
-
2026
- </xsl:if>
2027
-
2028
-
2029
-
2030
-
2031
-
2032
-
2033
-
2034
-
2035
-
2036
-
2037
- <!-- <xsl:if test="$namespace = 'bipm'">
2038
- <xsl:attribute name="height">8mm</xsl:attribute>
2039
- </xsl:if> -->
2040
-
2041
- <xsl:apply-templates/>
2042
- </fo:table-row>
2043
- </xsl:template><xsl:template match="*[local-name()='th']">
2044
- <fo:table-cell text-align="{@align}" font-weight="bold" border="solid black 1pt" padding-left="1mm" display-align="center">
2045
- <xsl:attribute name="text-align">
2046
- <xsl:choose>
2047
- <xsl:when test="@align">
2048
- <xsl:call-template name="setAlignment"/>
2049
- <!-- <xsl:value-of select="@align"/> -->
2050
- </xsl:when>
2051
- <xsl:otherwise>center</xsl:otherwise>
2052
- </xsl:choose>
2053
- </xsl:attribute>
2144
+ </xsl:template><xsl:template match="*[local-name()='thead']/*[local-name()='tr']" priority="2">
2145
+ <fo:table-row xsl:use-attribute-sets="table-header-row-style">
2146
+
2147
+
2148
+
2054
2149
 
2150
+
2151
+
2152
+
2153
+ <xsl:call-template name="setTableRowAttributes"/>
2154
+
2155
+ <xsl:apply-templates/>
2156
+ </fo:table-row>
2157
+ </xsl:template><xsl:template match="*[local-name()='tfoot']/*[local-name()='tr']" priority="2">
2158
+ <fo:table-row xsl:use-attribute-sets="table-footer-row-style">
2055
2159
 
2160
+ <xsl:call-template name="setTableRowAttributes"/>
2161
+ <xsl:apply-templates/>
2162
+ </fo:table-row>
2163
+ </xsl:template><xsl:template match="*[local-name()='tr']">
2164
+ <fo:table-row xsl:use-attribute-sets="table-body-row-style">
2165
+
2056
2166
 
2167
+
2057
2168
 
2169
+
2170
+ <xsl:call-template name="setTableRowAttributes"/>
2171
+ <xsl:apply-templates/>
2172
+ </fo:table-row>
2173
+ </xsl:template><xsl:template name="setTableRowAttributes">
2174
+
2175
+
2176
+
2177
+
2178
+
2179
+
2180
+
2181
+
2182
+ </xsl:template><xsl:template match="*[local-name()='th']">
2183
+ <fo:table-cell xsl:use-attribute-sets="table-header-cell-style"> <!-- text-align="{@align}" -->
2184
+ <xsl:call-template name="setTextAlignment">
2185
+ <xsl:with-param name="default">center</xsl:with-param>
2186
+ </xsl:call-template>
2058
2187
 
2059
2188
 
2060
2189
 
2061
2190
 
2191
+
2062
2192
 
2063
2193
 
2064
-
2065
- <xsl:attribute name="border-top">solid black 2pt</xsl:attribute>
2066
- <xsl:attribute name="border-bottom">solid black 2pt</xsl:attribute>
2067
2194
 
2068
2195
 
2069
2196
 
2070
2197
  <xsl:if test="$lang = 'ar'">
2071
2198
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2072
2199
  </xsl:if>
2073
- <xsl:if test="@colspan">
2074
- <xsl:attribute name="number-columns-spanned">
2075
- <xsl:value-of select="@colspan"/>
2076
- </xsl:attribute>
2077
- </xsl:if>
2078
- <xsl:if test="@rowspan">
2079
- <xsl:attribute name="number-rows-spanned">
2080
- <xsl:value-of select="@rowspan"/>
2081
- </xsl:attribute>
2082
- </xsl:if>
2083
- <xsl:call-template name="display-align"/>
2200
+
2201
+ <xsl:call-template name="setTableCellAttributes"/>
2202
+
2084
2203
  <fo:block>
2085
2204
  <xsl:apply-templates/>
2086
2205
  </fo:block>
2087
2206
  </fo:table-cell>
2207
+ </xsl:template><xsl:template name="setTableCellAttributes">
2208
+ <xsl:if test="@colspan">
2209
+ <xsl:attribute name="number-columns-spanned">
2210
+ <xsl:value-of select="@colspan"/>
2211
+ </xsl:attribute>
2212
+ </xsl:if>
2213
+ <xsl:if test="@rowspan">
2214
+ <xsl:attribute name="number-rows-spanned">
2215
+ <xsl:value-of select="@rowspan"/>
2216
+ </xsl:attribute>
2217
+ </xsl:if>
2218
+ <xsl:call-template name="display-align"/>
2088
2219
  </xsl:template><xsl:template name="display-align">
2089
2220
  <xsl:if test="@valign">
2090
2221
  <xsl:attribute name="display-align">
@@ -2097,22 +2228,18 @@
2097
2228
  </xsl:attribute>
2098
2229
  </xsl:if>
2099
2230
  </xsl:template><xsl:template match="*[local-name()='td']">
2100
- <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
2101
- <xsl:attribute name="text-align">
2102
- <xsl:choose>
2103
- <xsl:when test="@align">
2104
- <xsl:call-template name="setAlignment"/>
2105
- <!-- <xsl:value-of select="@align"/> -->
2106
- </xsl:when>
2107
- <xsl:otherwise>left</xsl:otherwise>
2108
- </xsl:choose>
2109
- </xsl:attribute>
2231
+ <fo:table-cell xsl:use-attribute-sets="table-cell-style"> <!-- text-align="{@align}" -->
2232
+ <xsl:call-template name="setTextAlignment">
2233
+ <xsl:with-param name="default">left</xsl:with-param>
2234
+ </xsl:call-template>
2235
+
2110
2236
  <xsl:if test="$lang = 'ar'">
2111
2237
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2112
2238
  </xsl:if>
2113
2239
 
2114
2240
 
2115
2241
 
2242
+ <!-- bsi -->
2116
2243
 
2117
2244
 
2118
2245
 
@@ -2121,34 +2248,36 @@
2121
2248
 
2122
2249
 
2123
2250
 
2251
+
2252
+
2124
2253
 
2125
2254
 
2126
2255
 
2127
2256
 
2128
2257
 
2129
- <xsl:if test=".//*[local-name() = 'table']">
2258
+ <xsl:if test=".//*[local-name() = 'table']"> <!-- if there is nested table -->
2130
2259
  <xsl:attribute name="padding-right">1mm</xsl:attribute>
2131
2260
  </xsl:if>
2132
- <xsl:if test="@colspan">
2133
- <xsl:attribute name="number-columns-spanned">
2134
- <xsl:value-of select="@colspan"/>
2135
- </xsl:attribute>
2136
- </xsl:if>
2137
- <xsl:if test="@rowspan">
2138
- <xsl:attribute name="number-rows-spanned">
2139
- <xsl:value-of select="@rowspan"/>
2140
- </xsl:attribute>
2141
- </xsl:if>
2142
- <xsl:call-template name="display-align"/>
2261
+
2262
+ <xsl:call-template name="setTableCellAttributes"/>
2263
+
2143
2264
  <fo:block>
2144
-
2265
+
2266
+
2267
+
2145
2268
  <xsl:apply-templates/>
2146
2269
  </fo:block>
2147
2270
  </fo:table-cell>
2148
2271
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']" priority="2"/><xsl:template match="*[local-name()='table']/*[local-name()='note']" mode="process">
2272
+
2273
+ <fo:block xsl:use-attribute-sets="table-note-style">
2274
+
2275
+
2276
+
2277
+
2149
2278
 
2150
-
2151
- <fo:block font-size="10pt" margin-bottom="12pt">
2279
+ <!-- Table's note name (NOTE, for example) -->
2280
+ <fo:inline xsl:use-attribute-sets="table-note-name-style">
2152
2281
 
2153
2282
 
2154
2283
 
@@ -2156,23 +2285,14 @@
2156
2285
 
2157
2286
 
2158
2287
 
2159
-
2160
- <!-- Table's note name (NOTE, for example) -->
2161
-
2162
- <fo:inline padding-right="2mm" xsl:use-attribute-sets="table-note-name-style">
2163
-
2164
-
2288
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
2165
2289
 
2166
-
2167
-
2168
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2169
-
2170
- </fo:inline>
2171
-
2172
-
2173
-
2174
- <xsl:apply-templates mode="process"/>
2175
- </fo:block>
2290
+ </fo:inline>
2291
+
2292
+
2293
+
2294
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]" mode="process"/>
2295
+ </fo:block>
2176
2296
 
2177
2297
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='name']" mode="process"/><xsl:template match="*[local-name()='table']/*[local-name()='note']/*[local-name()='p']" mode="process">
2178
2298
  <xsl:apply-templates/>
@@ -2252,8 +2372,7 @@
2252
2372
  <xsl:copy-of select="$footnote_inline"/>
2253
2373
  <fo:footnote-body>
2254
2374
 
2255
- <fo:block-container text-indent="0" start-indent="0">
2256
-
2375
+ <fo:block-container xsl:use-attribute-sets="fn-container-body-style">
2257
2376
 
2258
2377
  <fo:block xsl:use-attribute-sets="fn-body-style">
2259
2378
 
@@ -2272,7 +2391,7 @@
2272
2391
  <xsl:copy-of select="$footnote_inline"/>
2273
2392
  </xsl:otherwise>
2274
2393
  </xsl:choose>
2275
- </xsl:template><xsl:template name="fn_display">
2394
+ </xsl:template><xsl:template name="table_fn_display">
2276
2395
  <xsl:variable name="references">
2277
2396
 
2278
2397
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
@@ -2283,31 +2402,26 @@
2283
2402
  <xsl:for-each select="xalan:nodeset($references)//fn">
2284
2403
  <xsl:variable name="reference" select="@reference"/>
2285
2404
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
2286
- <fo:block margin-bottom="12pt">
2405
+ <fo:block xsl:use-attribute-sets="table-fn-style">
2287
2406
 
2288
2407
 
2289
2408
 
2290
-
2291
-
2292
-
2293
-
2294
- <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
2409
+ <fo:inline id="{@id}" xsl:use-attribute-sets="table-fn-number-style">
2295
2410
 
2296
2411
 
2297
2412
 
2298
2413
 
2299
2414
 
2415
+ <xsl:value-of select="@reference"/>
2300
2416
 
2301
2417
 
2302
2418
 
2303
- <xsl:value-of select="@reference"/>
2304
2419
 
2305
2420
 
2306
2421
 
2307
- </fo:inline>
2308
- <fo:inline>
2309
2422
 
2310
- <!-- <xsl:apply-templates /> -->
2423
+ </fo:inline>
2424
+ <fo:inline xsl:use-attribute-sets="table-fn-body-style">
2311
2425
  <xsl:copy-of select="./node()"/>
2312
2426
  </fo:inline>
2313
2427
  </fo:block>
@@ -2319,15 +2433,7 @@
2319
2433
 
2320
2434
  <xsl:apply-templates/>
2321
2435
  </fn>
2322
- </xsl:template><xsl:template name="fn_name_display">
2323
- <!-- <xsl:variable name="references">
2324
- <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
2325
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
2326
- <xsl:apply-templates />
2327
- </fn>
2328
- </xsl:for-each>
2329
- </xsl:variable>
2330
- $references=<xsl:copy-of select="$references"/> -->
2436
+ </xsl:template><xsl:template name="table_name_fn_display">
2331
2437
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
2332
2438
  <xsl:variable name="reference" select="@reference"/>
2333
2439
  <fo:block id="{@reference}_{ancestor::*[@id][1]/@id}"><xsl:value-of select="@reference"/></fo:block>
@@ -2336,9 +2442,7 @@
2336
2442
  </fo:block>
2337
2443
  </xsl:for-each>
2338
2444
  </xsl:template><xsl:template name="fn_display_figure">
2339
- <xsl:variable name="key_iso">
2340
- <!-- and (not(@class) or @class !='pseudocode') -->
2341
- </xsl:variable>
2445
+
2342
2446
  <xsl:variable name="references">
2343
2447
  <xsl:for-each select=".//*[local-name()='fn'][not(parent::*[local-name()='name'])]">
2344
2448
  <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
@@ -2346,50 +2450,52 @@
2346
2450
  </fn>
2347
2451
  </xsl:for-each>
2348
2452
  </xsl:variable>
2453
+
2454
+ <xsl:if test="xalan:nodeset($references)//fn">
2349
2455
 
2350
- <!-- current hierarchy is 'figure' element -->
2351
- <xsl:variable name="following_dl_colwidths">
2352
- <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
2353
- <xsl:variable name="html-table">
2354
- <xsl:variable name="doc_ns">
2456
+ <xsl:variable name="key_iso">
2457
+
2458
+ </xsl:variable>
2459
+
2460
+ <!-- current hierarchy is 'figure' element -->
2461
+ <xsl:variable name="following_dl_colwidths">
2462
+ <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
2463
+ <xsl:variable name="html-table">
2464
+ <xsl:variable name="doc_ns">
2465
+
2466
+ </xsl:variable>
2467
+ <xsl:variable name="ns">
2468
+ <xsl:choose>
2469
+ <xsl:when test="normalize-space($doc_ns) != ''">
2470
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2471
+ </xsl:when>
2472
+ <xsl:otherwise>
2473
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2474
+ </xsl:otherwise>
2475
+ </xsl:choose>
2476
+ </xsl:variable>
2355
2477
 
2356
- </xsl:variable>
2357
- <xsl:variable name="ns">
2358
- <xsl:choose>
2359
- <xsl:when test="normalize-space($doc_ns) != ''">
2360
- <xsl:value-of select="normalize-space($doc_ns)"/>
2361
- </xsl:when>
2362
- <xsl:otherwise>
2363
- <xsl:value-of select="substring-before(name(/*), '-')"/>
2364
- </xsl:otherwise>
2365
- </xsl:choose>
2366
- </xsl:variable>
2367
- <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2368
- <!-- <xsl:element name="{$ns}:table"> -->
2369
2478
  <xsl:for-each select="*[local-name() = 'dl'][1]">
2370
2479
  <tbody>
2371
2480
  <xsl:apply-templates mode="dl"/>
2372
2481
  </tbody>
2373
2482
  </xsl:for-each>
2374
- <!-- </xsl:element> -->
2375
- </xsl:variable>
2376
-
2377
- <xsl:call-template name="calculate-column-widths">
2378
- <xsl:with-param name="cols-count" select="2"/>
2379
- <xsl:with-param name="table" select="$html-table"/>
2380
- </xsl:call-template>
2381
-
2382
- </xsl:if>
2383
- </xsl:variable>
2384
-
2385
-
2386
- <xsl:variable name="maxlength_dt">
2387
- <xsl:for-each select="*[local-name() = 'dl'][1]">
2388
- <xsl:call-template name="getMaxLength_dt"/>
2389
- </xsl:for-each>
2390
- </xsl:variable>
2391
-
2392
- <xsl:if test="xalan:nodeset($references)//fn">
2483
+ </xsl:variable>
2484
+
2485
+ <xsl:call-template name="calculate-column-widths">
2486
+ <xsl:with-param name="cols-count" select="2"/>
2487
+ <xsl:with-param name="table" select="$html-table"/>
2488
+ </xsl:call-template>
2489
+
2490
+ </xsl:if>
2491
+ </xsl:variable>
2492
+
2493
+ <xsl:variable name="maxlength_dt">
2494
+ <xsl:for-each select="*[local-name() = 'dl'][1]">
2495
+ <xsl:call-template name="getMaxLength_dt"/>
2496
+ </xsl:for-each>
2497
+ </xsl:variable>
2498
+
2393
2499
  <fo:block>
2394
2500
  <fo:table width="95%" table-layout="fixed">
2395
2501
  <xsl:if test="normalize-space($key_iso) = 'true'">
@@ -2416,20 +2522,18 @@
2416
2522
  <fo:table-row>
2417
2523
  <fo:table-cell>
2418
2524
  <fo:block>
2419
- <fo:inline font-size="80%" padding-right="5mm" vertical-align="super" id="{@id}">
2420
-
2525
+ <fo:inline id="{@id}" xsl:use-attribute-sets="figure-fn-number-style">
2421
2526
  <xsl:value-of select="@reference"/>
2422
2527
  </fo:inline>
2423
2528
  </fo:block>
2424
2529
  </fo:table-cell>
2425
2530
  <fo:table-cell>
2426
- <fo:block text-align="justify" margin-bottom="12pt">
2427
-
2531
+ <fo:block xsl:use-attribute-sets="figure-fn-body-style">
2428
2532
  <xsl:if test="normalize-space($key_iso) = 'true'">
2429
- <xsl:attribute name="margin-bottom">0</xsl:attribute>
2533
+
2534
+ <xsl:attribute name="margin-bottom">0</xsl:attribute>
2535
+
2430
2536
  </xsl:if>
2431
-
2432
- <!-- <xsl:apply-templates /> -->
2433
2537
  <xsl:copy-of select="./node()"/>
2434
2538
  </fo:block>
2435
2539
  </fo:table-cell>
@@ -2442,14 +2546,8 @@
2442
2546
  </xsl:if>
2443
2547
 
2444
2548
  </xsl:template><xsl:template match="*[local-name()='fn']">
2445
- <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
2446
- <fo:inline font-size="80%" keep-with-previous.within-line="always">
2447
-
2448
-
2449
-
2450
-
2451
-
2452
-
2549
+ <fo:inline xsl:use-attribute-sets="fn-reference-style">
2550
+
2453
2551
 
2454
2552
 
2455
2553
 
@@ -2473,10 +2571,10 @@
2473
2571
  <xsl:variable name="isDeleted" select="@deleted"/>
2474
2572
  <fo:block-container>
2475
2573
 
2476
- <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
2477
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2478
- </xsl:if>
2479
-
2574
+ <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
2575
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2576
+ </xsl:if>
2577
+
2480
2578
 
2481
2579
  <xsl:if test="parent::*[local-name() = 'note']">
2482
2580
  <xsl:attribute name="margin-left">
@@ -2493,11 +2591,11 @@
2493
2591
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
2494
2592
  </xsl:call-template>
2495
2593
 
2496
- <fo:block-container>
2497
-
2498
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2499
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
2594
+ <fo:block-container margin-left="0mm">
2595
+
2500
2596
 
2597
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2598
+
2501
2599
 
2502
2600
  <xsl:variable name="parent" select="local-name(..)"/>
2503
2601
 
@@ -2508,20 +2606,19 @@
2508
2606
  <xsl:choose>
2509
2607
  <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
2510
2608
 
2511
-
2512
- <fo:block margin-bottom="12pt" text-align="left">
2513
-
2514
- <xsl:variable name="title-where">
2515
- <xsl:call-template name="getLocalizedString">
2516
- <xsl:with-param name="key">where</xsl:with-param>
2517
- </xsl:call-template>
2518
- </xsl:variable>
2519
- <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2520
- <xsl:apply-templates select="*[local-name()='dt']/*"/>
2521
- <xsl:text/>
2522
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
2523
- </fo:block>
2524
-
2609
+ <fo:block margin-bottom="12pt" text-align="left">
2610
+
2611
+ <xsl:variable name="title-where">
2612
+ <xsl:call-template name="getLocalizedString">
2613
+ <xsl:with-param name="key">where</xsl:with-param>
2614
+ </xsl:call-template>
2615
+ </xsl:variable>
2616
+ <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2617
+ <xsl:apply-templates select="*[local-name()='dt']/*"/>
2618
+ <xsl:text/>
2619
+ <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
2620
+ </fo:block>
2621
+
2525
2622
  </xsl:when>
2526
2623
  <xsl:when test="$parent = 'formula'"> <!-- a few components -->
2527
2624
  <fo:block margin-bottom="12pt" text-align="left">
@@ -2568,9 +2665,7 @@
2568
2665
  <fo:table width="95%" table-layout="fixed">
2569
2666
 
2570
2667
  <xsl:choose>
2571
- <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
2572
- <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
2573
- </xsl:when>
2668
+ <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'"/>
2574
2669
  <xsl:when test="normalize-space($key_iso) = 'true'">
2575
2670
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2576
2671
 
@@ -2591,12 +2686,9 @@
2591
2686
  </xsl:otherwise>
2592
2687
  </xsl:choose>
2593
2688
  </xsl:variable>
2594
- <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2595
- <!-- <xsl:element name="{$ns}:table"> -->
2596
- <tbody>
2597
- <xsl:apply-templates mode="dl"/>
2598
- </tbody>
2599
- <!-- </xsl:element> -->
2689
+ <tbody>
2690
+ <xsl:apply-templates mode="dl"/>
2691
+ </tbody>
2600
2692
  </xsl:variable>
2601
2693
  <!-- html-table<xsl:copy-of select="$html-table"/> -->
2602
2694
  <xsl:variable name="colwidths">
@@ -2676,8 +2768,6 @@
2676
2768
  </xsl:for-each>
2677
2769
  </xsl:otherwise>
2678
2770
  </xsl:choose>
2679
- <!-- <fo:table-column column-width="15%"/>
2680
- <fo:table-column column-width="85%"/> -->
2681
2771
  </xsl:otherwise>
2682
2772
  </xsl:choose>
2683
2773
  </xsl:template><xsl:template name="getMaxLength_dt">
@@ -2692,12 +2782,6 @@
2692
2782
  </xsl:for-each>
2693
2783
  </xsl:variable>
2694
2784
  <xsl:variable name="maxLength">
2695
- <!-- <xsl:for-each select="*[local-name()='dt']">
2696
- <xsl:sort select="string-length(normalize-space(.))" data-type="number" order="descending"/>
2697
- <xsl:if test="position() = 1">
2698
- <xsl:value-of select="string-length(normalize-space(.))"/>
2699
- </xsl:if>
2700
- </xsl:for-each> -->
2701
2785
  <xsl:for-each select="xalan:nodeset($lengths)/length">
2702
2786
  <xsl:sort select="." data-type="number" order="descending"/>
2703
2787
  <xsl:if test="position() = 1">
@@ -2723,12 +2807,12 @@
2723
2807
  <xsl:if test="normalize-space($key_iso) = 'true'">
2724
2808
  <xsl:attribute name="margin-top">0</xsl:attribute>
2725
2809
  </xsl:if>
2726
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2810
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
2727
2811
  </fo:block>
2728
2812
  </fo:table-cell>
2729
2813
  <fo:table-cell>
2730
2814
  <fo:block>
2731
- <xsl:apply-templates/>
2815
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
2732
2816
  </fo:block>
2733
2817
  </fo:table-cell>
2734
2818
  </fo:table-row>
@@ -2739,76 +2823,37 @@
2739
2823
  </td>
2740
2824
  <td>
2741
2825
 
2742
-
2743
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2744
-
2826
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2827
+
2745
2828
  </td>
2746
2829
  </tr>
2747
2830
 
2748
2831
  </xsl:template><xsl:template match="*[local-name()='dt']">
2749
2832
  <xsl:param name="key_iso"/>
2750
2833
 
2751
- <fo:table-row>
2752
-
2753
-
2834
+ <fo:table-row xsl:use-attribute-sets="dt-row-style">
2754
2835
  <fo:table-cell>
2755
2836
 
2756
- <fo:block margin-top="6pt">
2837
+ <fo:block xsl:use-attribute-sets="dt-style">
2757
2838
  <xsl:copy-of select="@id"/>
2758
2839
 
2759
-
2760
2840
  <xsl:if test="normalize-space($key_iso) = 'true'">
2761
2841
  <xsl:attribute name="margin-top">0</xsl:attribute>
2762
-
2763
2842
  </xsl:if>
2764
2843
 
2765
2844
 
2766
2845
 
2767
-
2768
-
2769
-
2770
-
2771
2846
  <xsl:apply-templates/>
2772
- <!-- <xsl:if test="$namespace = 'gb'">
2773
- <xsl:if test="ancestor::*[local-name()='formula']">
2774
- <xsl:text>—</xsl:text>
2775
- </xsl:if>
2776
- </xsl:if> -->
2777
2847
  </fo:block>
2778
2848
  </fo:table-cell>
2779
2849
  <fo:table-cell>
2780
2850
  <fo:block>
2781
2851
 
2782
- <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2783
- <xsl:if test="local-name(*[1]) != 'stem'">
2784
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2785
- </xsl:if>
2786
- </xsl:if> -->
2787
-
2788
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2789
-
2852
+
2853
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2790
2854
  </fo:block>
2791
2855
  </fo:table-cell>
2792
2856
  </fo:table-row>
2793
- <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2794
- <xsl:if test="local-name(*[1]) = 'stem'">
2795
- <fo:table-row>
2796
- <fo:table-cell>
2797
- <fo:block margin-top="6pt">
2798
- <xsl:if test="normalize-space($key_iso) = 'true'">
2799
- <xsl:attribute name="margin-top">0</xsl:attribute>
2800
- </xsl:if>
2801
- <xsl:text>&#xA0;</xsl:text>
2802
- </fo:block>
2803
- </fo:table-cell>
2804
- <fo:table-cell>
2805
- <fo:block>
2806
- <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2807
- </fo:block>
2808
- </fo:table-cell>
2809
- </fo:table-row>
2810
- </xsl:if>
2811
- </xsl:if> -->
2812
2857
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
2813
2858
  <xsl:apply-templates/>
2814
2859
  </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
@@ -2837,6 +2882,7 @@
2837
2882
  </fo:inline>
2838
2883
  </xsl:template><xsl:template match="*[local-name()='tt']">
2839
2884
  <fo:inline xsl:use-attribute-sets="tt-style">
2885
+
2840
2886
  <xsl:variable name="_font-size">
2841
2887
 
2842
2888
 
@@ -2873,15 +2919,21 @@
2873
2919
  <xsl:apply-templates/>
2874
2920
  </fo:inline>
2875
2921
  </xsl:template><xsl:template match="*[local-name()='add']">
2922
+ <xsl:param name="skip">true</xsl:param>
2876
2923
  <xsl:choose>
2877
2924
  <xsl:when test="starts-with(., $ace_tag)"> <!-- examples: ace-tag_A1_start, ace-tag_A2_end, C1_start, AC_start -->
2878
- <fo:inline>
2879
- <xsl:call-template name="insertTag">
2880
- <xsl:with-param name="type" select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end -->
2881
- <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
2882
- <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
2883
- </xsl:call-template>
2884
- </fo:inline>
2925
+ <xsl:choose>
2926
+ <xsl:when test="$skip = 'true' and ((local-name(../..) = 'note' and not(preceding-sibling::node())) or (local-name(..) = 'title' and preceding-sibling::node()[1][local-name() = 'tab'])) and ../node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]"><!-- start tag displayed in template name="note" and title --></xsl:when>
2927
+ <xsl:otherwise>
2928
+ <fo:inline>
2929
+ <xsl:call-template name="insertTag">
2930
+ <xsl:with-param name="type" select="substring-after(substring-after(., $ace_tag), '_')"/> <!-- start or end -->
2931
+ <xsl:with-param name="kind" select="substring(substring-before(substring-after(., $ace_tag), '_'), 1, 1)"/> <!-- A or C -->
2932
+ <xsl:with-param name="value" select="substring(substring-before(substring-after(., $ace_tag), '_'), 2)"/> <!-- 1, 2, C -->
2933
+ </xsl:call-template>
2934
+ </fo:inline>
2935
+ </xsl:otherwise>
2936
+ </xsl:choose>
2885
2937
  </xsl:when>
2886
2938
  <xsl:when test="@amendment">
2887
2939
  <fo:inline>
@@ -2924,8 +2976,6 @@
2924
2976
  <xsl:variable name="add_width" select="string-length($value) * 20"/>
2925
2977
  <xsl:variable name="maxwidth" select="60 + $add_width"/>
2926
2978
  <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-20%"><!-- alignment-baseline="middle" -->
2927
- <!-- <xsl:attribute name="width">7mm</xsl:attribute>
2928
- <xsl:attribute name="content-height">100%</xsl:attribute> -->
2929
2979
  <xsl:attribute name="height">5mm</xsl:attribute>
2930
2980
  <xsl:attribute name="content-width">100%</xsl:attribute>
2931
2981
  <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
@@ -3143,14 +3193,6 @@
3143
3193
 
3144
3194
  <xsl:copy-of select="xalan:nodeset($simple-table-rowspan)"/>
3145
3195
 
3146
- <!-- <xsl:choose>
3147
- <xsl:when test="current()//*[local-name()='th'][@colspan] or current()//*[local-name()='td'][@colspan] ">
3148
-
3149
- </xsl:when>
3150
- <xsl:otherwise>
3151
- <xsl:copy-of select="current()"/>
3152
- </xsl:otherwise>
3153
- </xsl:choose> -->
3154
3196
  </xsl:variable>
3155
3197
  <xsl:copy-of select="$simple-table"/>
3156
3198
  </xsl:template><xsl:template match="*[local-name()='thead'] | *[local-name()='tbody']" mode="simple-table-colspan">
@@ -3269,8 +3311,6 @@
3269
3311
  <xsl:choose>
3270
3312
  <xsl:when test="contains($str2, ' ')">
3271
3313
  <xsl:variable name="substr" select="substring-before($str2, ' ')"/>
3272
- <!-- <xsl:value-of select="translate(substring($substr, 1, 1), $lower, $upper)"/>
3273
- <xsl:value-of select="substring($substr, 2)"/> -->
3274
3314
  <xsl:call-template name="capitalize">
3275
3315
  <xsl:with-param name="str" select="$substr"/>
3276
3316
  </xsl:call-template>
@@ -3280,8 +3320,6 @@
3280
3320
  </xsl:call-template>
3281
3321
  </xsl:when>
3282
3322
  <xsl:otherwise>
3283
- <!-- <xsl:value-of select="translate(substring($str2, 1, 1), $lower, $upper)"/>
3284
- <xsl:value-of select="substring($str2, 2)"/> -->
3285
3323
  <xsl:call-template name="capitalize">
3286
3324
  <xsl:with-param name="str" select="$str2"/>
3287
3325
  </xsl:call-template>
@@ -3309,6 +3347,7 @@
3309
3347
  <xsl:apply-templates select="." mode="mathml"/>
3310
3348
  </xsl:variable>
3311
3349
  <fo:instream-foreign-object fox:alt-text="Math">
3350
+
3312
3351
 
3313
3352
 
3314
3353
  <xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
@@ -3340,7 +3379,7 @@
3340
3379
  </xsl:attribute>
3341
3380
 
3342
3381
 
3343
- <!-- <xsl:copy-of select="."/> -->
3382
+
3344
3383
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
3345
3384
  </fo:instream-foreign-object>
3346
3385
  </fo:inline>
@@ -3399,6 +3438,10 @@
3399
3438
 
3400
3439
 
3401
3440
 
3441
+
3442
+
3443
+
3444
+
3402
3445
  <xsl:choose>
3403
3446
  <xsl:when test="$target_text = ''">
3404
3447
  <xsl:apply-templates/>
@@ -3456,7 +3499,6 @@
3456
3499
  </fo:inline>
3457
3500
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
3458
3501
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
3459
-
3460
3502
  <xsl:apply-templates/>
3461
3503
  </fo:basic-link>
3462
3504
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
@@ -3484,49 +3526,64 @@
3484
3526
  <fo:inline>
3485
3527
  <xsl:apply-templates/>
3486
3528
  </fo:inline>
3487
- </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']" mode="presentation">
3529
+ </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'name']" mode="formula_number"> <!-- show by demand -->
3488
3530
  <xsl:if test="normalize-space() != ''">
3489
3531
  <xsl:text>(</xsl:text><xsl:apply-templates/><xsl:text>)</xsl:text>
3490
3532
  </xsl:if>
3491
3533
  </xsl:template><xsl:template match="*[local-name() = 'note']" name="note">
3492
3534
 
3493
3535
  <fo:block-container id="{@id}" xsl:use-attribute-sets="note-style">
3536
+
3537
+
3538
+
3494
3539
 
3495
3540
 
3496
3541
 
3497
3542
 
3498
3543
 
3544
+
3545
+
3546
+
3499
3547
  <fo:block-container margin-left="0mm">
3548
+
3500
3549
 
3501
3550
 
3502
3551
 
3552
+
3503
3553
 
3504
-
3505
-
3506
-
3507
-
3508
- <fo:block>
3509
-
3510
-
3511
-
3512
-
3513
-
3554
+ <fo:block>
3555
+
3556
+
3514
3557
 
3515
- <fo:inline xsl:use-attribute-sets="note-name-style">
3516
3558
 
3517
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3518
- </fo:inline>
3519
- <xsl:apply-templates/>
3520
- </fo:block>
3521
-
3522
-
3559
+
3560
+
3561
+
3562
+ <fo:inline xsl:use-attribute-sets="note-name-style">
3563
+
3564
+
3565
+
3566
+ <!-- if note contains only one element and first and last childs are `add` ace-tag, then move start ace-tag before NOTE's name-->
3567
+ <xsl:if test="count(*[not(local-name() = 'name')]) = 1 and *[not(local-name() = 'name')]/node()[last()][local-name() = 'add'][starts-with(text(), $ace_tag)]">
3568
+ <xsl:apply-templates select="*[not(local-name() = 'name')]/node()[1][local-name() = 'add'][starts-with(text(), $ace_tag)]">
3569
+ <xsl:with-param name="skip">false</xsl:with-param>
3570
+ </xsl:apply-templates>
3571
+ </xsl:if>
3572
+
3573
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
3574
+
3575
+ </fo:inline>
3576
+
3577
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
3578
+ </fo:block>
3579
+
3523
3580
  </fo:block-container>
3524
3581
  </fo:block-container>
3525
3582
 
3526
3583
  </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'p']">
3527
3584
  <xsl:variable name="num"><xsl:number/></xsl:variable>
3528
3585
  <xsl:choose>
3529
- <xsl:when test="$num = 1">
3586
+ <xsl:when test="$num = 1"> <!-- display first NOTE's paragraph in the same line with label NOTE -->
3530
3587
  <fo:inline xsl:use-attribute-sets="note-p-style">
3531
3588
  <xsl:apply-templates/>
3532
3589
  </fo:inline>
@@ -3541,12 +3598,16 @@
3541
3598
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
3542
3599
 
3543
3600
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
3601
+
3602
+
3603
+
3604
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
3544
3605
 
3545
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3546
3606
  </fo:inline>
3547
- <xsl:apply-templates/>
3607
+
3608
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
3548
3609
  </fo:block>
3549
- </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name'] | *[local-name() = 'termnote']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']" mode="presentation">
3610
+ </xsl:template><xsl:template match="*[local-name() = 'note']/*[local-name() = 'name']">
3550
3611
  <xsl:param name="sfx"/>
3551
3612
  <xsl:variable name="suffix">
3552
3613
  <xsl:choose>
@@ -3563,7 +3624,7 @@
3563
3624
  <xsl:apply-templates/>
3564
3625
  <xsl:value-of select="$suffix"/>
3565
3626
  </xsl:if>
3566
- </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']" mode="presentation">
3627
+ </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'name']">
3567
3628
  <xsl:param name="sfx"/>
3568
3629
  <xsl:variable name="suffix">
3569
3630
  <xsl:choose>
@@ -3588,25 +3649,23 @@
3588
3649
  <xsl:apply-templates/>
3589
3650
  </fo:block>
3590
3651
  </xsl:template><xsl:template match="*[local-name() = 'term']">
3591
- <!-- <xsl:message>'term' <xsl:number/> processing, name=<xsl:value-of select="iso:name"/>, preferred=<xsl:value-of select="iso:preferred"/>...</xsl:message> -->
3592
3652
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
3593
3653
 
3594
3654
 
3655
+
3656
+
3595
3657
  <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
3596
3658
 
3597
3659
  </xsl:if>
3598
- <xsl:apply-templates/>
3660
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
3599
3661
  </fo:block>
3600
- </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
3662
+ </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']">
3601
3663
  <xsl:if test="normalize-space() != ''">
3602
3664
  <xsl:variable name="level">
3603
3665
  <xsl:call-template name="getLevelTermName"/>
3604
3666
  </xsl:variable>
3605
3667
  <fo:inline role="H{$level}">
3606
3668
  <xsl:apply-templates/>
3607
- <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
3608
- <xsl:text>.</xsl:text>
3609
- </xsl:if> -->
3610
3669
  </fo:inline>
3611
3670
  </xsl:if>
3612
3671
  </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
@@ -3619,9 +3678,10 @@
3619
3678
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
3620
3679
  </xsl:call-template>
3621
3680
 
3622
- <fo:block>
3623
-
3624
- <xsl:apply-templates/>
3681
+
3682
+
3683
+ <fo:block xsl:use-attribute-sets="figure-style">
3684
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
3625
3685
  </fo:block>
3626
3686
  <xsl:call-template name="fn_display_figure"/>
3627
3687
  <xsl:for-each select="*[local-name() = 'note']">
@@ -3629,14 +3689,15 @@
3629
3689
  </xsl:for-each>
3630
3690
 
3631
3691
 
3632
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3692
+ <xsl:apply-templates select="*[local-name() = 'name']"/> <!-- show figure's name AFTER image -->
3693
+
3633
3694
 
3634
3695
  </fo:block-container>
3635
3696
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
3636
3697
  <fo:block id="{@id}">
3637
- <xsl:apply-templates/>
3698
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
3638
3699
  </fo:block>
3639
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3700
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
3640
3701
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
3641
3702
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
3642
3703
  <xsl:apply-templates/>
@@ -3743,9 +3804,7 @@
3743
3804
  <xsl:variable name="bis" select="java:java.io.ByteArrayInputStream.new($fileContent)"/>
3744
3805
  <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($bis)"/>
3745
3806
  <xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
3746
- <!-- width=<xsl:value-of select="$width"/> -->
3747
3807
  <xsl:variable name="height" select="java:getHeight($bufferedImage)"/>
3748
- <!-- height=<xsl:value-of select="$height"/> -->
3749
3808
  <svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="enable-background:new 0 0 595.28 841.89;" height="{$height}" width="{$width}" viewBox="0 0 {$width} {$height}" y="0px" x="0px" id="Layer_1" version="1.1">
3750
3809
  <image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{@src}" height="{$height}" width="{$width}" style="overflow:visible;"/>
3751
3810
  <xsl:call-template name="svg_cross">
@@ -4015,7 +4074,7 @@
4015
4074
  </fo:basic-link>
4016
4075
  </fo:block>
4017
4076
  </fo:block-container>
4018
- </xsl:template><xsl:template match="*[local-name() = 'emf']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
4077
+ </xsl:template><xsl:template match="*[local-name() = 'emf']"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name']" mode="contents">
4019
4078
  <xsl:apply-templates mode="contents"/>
4020
4079
  <xsl:text> </xsl:text>
4021
4080
  </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'table']/*[local-name() = 'name'] | *[local-name() = 'permission']/*[local-name() = 'name'] | *[local-name() = 'recommendation']/*[local-name() = 'name'] | *[local-name() = 'requirement']/*[local-name() = 'name'] | *[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="bookmarks">
@@ -4168,8 +4227,6 @@
4168
4227
 
4169
4228
 
4170
4229
 
4171
-
4172
-
4173
4230
  </fo:bookmark-tree>
4174
4231
  </xsl:if>
4175
4232
  </xsl:template><xsl:template name="insertFigureBookmarks">
@@ -4240,7 +4297,7 @@
4240
4297
  <xsl:apply-templates mode="bookmark"/>
4241
4298
  </xsl:otherwise>
4242
4299
  </xsl:choose>
4243
- </xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
4300
+ </xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']">
4244
4301
  <xsl:if test="normalize-space() != ''">
4245
4302
  <fo:block xsl:use-attribute-sets="figure-name-style">
4246
4303
 
@@ -4256,12 +4313,6 @@
4256
4313
  <!-- <xsl:text> </xsl:text> -->
4257
4314
  </xsl:template><xsl:template name="getSection">
4258
4315
  <xsl:value-of select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
4259
- <!--
4260
- <xsl:for-each select="*[local-name() = 'title']/*[local-name() = 'tab'][1]/preceding-sibling::node()">
4261
- <xsl:value-of select="."/>
4262
- </xsl:for-each>
4263
- -->
4264
-
4265
4316
  </xsl:template><xsl:template name="getName">
4266
4317
  <xsl:choose>
4267
4318
  <xsl:when test="*[local-name() = 'title']/*[local-name() = 'tab']">
@@ -4330,16 +4381,21 @@
4330
4381
  <xsl:apply-templates mode="contents_item">
4331
4382
  <xsl:with-param name="mode" select="$mode"/>
4332
4383
  </xsl:apply-templates>
4333
- </xsl:template><xsl:template match="*[local-name() = 'add'][starts-with(text(), $ace_tag)]" mode="contents_item">
4384
+ </xsl:template><xsl:template match="*[local-name() = 'add']" mode="contents_item">
4334
4385
  <xsl:param name="mode">bookmarks</xsl:param>
4335
- <xsl:if test="$mode = 'contents'">
4336
- <xsl:copy>
4337
- <xsl:apply-templates mode="contents_item"/>
4338
- </xsl:copy>
4339
- </xsl:if>
4386
+ <xsl:choose>
4387
+ <xsl:when test="starts-with(text(), $ace_tag)">
4388
+ <xsl:if test="$mode = 'contents'">
4389
+ <xsl:copy>
4390
+ <xsl:apply-templates mode="contents_item"/>
4391
+ </xsl:copy>
4392
+ </xsl:if>
4393
+ </xsl:when>
4394
+ <xsl:otherwise><xsl:apply-templates mode="contents_item"/></xsl:otherwise>
4395
+ </xsl:choose>
4340
4396
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
4341
4397
 
4342
- <fo:block-container margin-left="0mm">
4398
+ <fo:block-container xsl:use-attribute-sets="sourcecode-container-style">
4343
4399
  <xsl:copy-of select="@id"/>
4344
4400
 
4345
4401
  <xsl:if test="parent::*[local-name() = 'note']">
@@ -4376,6 +4432,7 @@
4376
4432
 
4377
4433
 
4378
4434
  </xsl:variable>
4435
+
4379
4436
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
4380
4437
  <xsl:if test="$font-size != ''">
4381
4438
  <xsl:attribute name="font-size">
@@ -4392,11 +4449,11 @@
4392
4449
 
4393
4450
 
4394
4451
 
4395
- <xsl:apply-templates/>
4452
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4396
4453
  </fo:block>
4397
4454
 
4398
4455
 
4399
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4456
+ <xsl:apply-templates select="*[local-name()='name']"/> <!-- show sourcecode's name AFTER content -->
4400
4457
 
4401
4458
 
4402
4459
 
@@ -4410,7 +4467,7 @@
4410
4467
  <xsl:call-template name="add-zero-spaces-java">
4411
4468
  <xsl:with-param name="text" select="$text"/>
4412
4469
  </xsl:call-template>
4413
- </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
4470
+ </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']">
4414
4471
  <xsl:if test="normalize-space() != ''">
4415
4472
  <fo:block xsl:use-attribute-sets="sourcecode-name-style">
4416
4473
  <xsl:apply-templates/>
@@ -4418,10 +4475,10 @@
4418
4475
  </xsl:if>
4419
4476
  </xsl:template><xsl:template match="*[local-name() = 'permission']">
4420
4477
  <fo:block id="{@id}" xsl:use-attribute-sets="permission-style">
4421
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4422
- <xsl:apply-templates/>
4478
+ <xsl:apply-templates select="*[local-name()='name']"/>
4479
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4423
4480
  </fo:block>
4424
- </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']" mode="presentation">
4481
+ </xsl:template><xsl:template match="*[local-name() = 'permission']/*[local-name() = 'name']">
4425
4482
  <xsl:if test="normalize-space() != ''">
4426
4483
  <fo:block xsl:use-attribute-sets="permission-name-style">
4427
4484
  <xsl:apply-templates/>
@@ -4434,13 +4491,13 @@
4434
4491
  </fo:block>
4435
4492
  </xsl:template><xsl:template match="*[local-name() = 'requirement']">
4436
4493
  <fo:block id="{@id}" xsl:use-attribute-sets="requirement-style">
4437
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4438
- <xsl:apply-templates select="*[local-name()='label']" mode="presentation"/>
4439
- <xsl:apply-templates select="@obligation" mode="presentation"/>
4440
- <xsl:apply-templates select="*[local-name()='subject']" mode="presentation"/>
4441
- <xsl:apply-templates/>
4494
+ <xsl:apply-templates select="*[local-name()='name']"/>
4495
+ <xsl:apply-templates select="*[local-name()='label']"/>
4496
+ <xsl:apply-templates select="@obligation"/>
4497
+ <xsl:apply-templates select="*[local-name()='subject']"/>
4498
+ <xsl:apply-templates select="node()[not(local-name() = 'name') and not(local-name() = 'label') and not(local-name() = 'subject')]"/>
4442
4499
  </fo:block>
4443
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']" mode="presentation">
4500
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'name']">
4444
4501
  <xsl:if test="normalize-space() != ''">
4445
4502
  <fo:block xsl:use-attribute-sets="requirement-name-style">
4446
4503
 
@@ -4448,20 +4505,24 @@
4448
4505
 
4449
4506
  </fo:block>
4450
4507
  </xsl:if>
4451
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']" mode="presentation">
4508
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'label']">
4452
4509
  <fo:block xsl:use-attribute-sets="requirement-label-style">
4453
4510
  <xsl:apply-templates/>
4454
4511
  </fo:block>
4455
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/@obligation" mode="presentation">
4512
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/@obligation">
4456
4513
  <fo:block>
4457
4514
  <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
4458
4515
  </fo:block>
4516
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2">
4517
+ <fo:block xsl:use-attribute-sets="subject-style">
4518
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4519
+ </fo:block>
4459
4520
  </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
4460
4521
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
4461
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4462
- <xsl:apply-templates/>
4522
+ <xsl:apply-templates select="*[local-name()='name']"/>
4523
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4463
4524
  </fo:block>
4464
- </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']" mode="presentation">
4525
+ </xsl:template><xsl:template match="*[local-name() = 'recommendation']/*[local-name() = 'name']">
4465
4526
  <xsl:if test="normalize-space() != ''">
4466
4527
  <fo:block xsl:use-attribute-sets="recommendation-name-style">
4467
4528
  <xsl:apply-templates/>
@@ -4472,10 +4533,6 @@
4472
4533
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
4473
4534
  <xsl:apply-templates/>
4474
4535
  </fo:block>
4475
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
4476
- <fo:block xsl:use-attribute-sets="subject-style">
4477
- <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4478
- </fo:block>
4479
4536
  </xsl:template><xsl:template match="*[local-name() = 'subject']">
4480
4537
  <fo:block xsl:use-attribute-sets="subject-style">
4481
4538
  <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
@@ -4519,8 +4576,6 @@
4519
4576
  </xsl:variable>
4520
4577
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
4521
4578
  <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
4522
- <!-- <fo:table-column column-width="35mm"/>
4523
- <fo:table-column column-width="115mm"/> -->
4524
4579
  <fo:table-column column-width="30%"/>
4525
4580
  <fo:table-column column-width="70%"/>
4526
4581
  </xsl:if>
@@ -4530,7 +4585,7 @@
4530
4585
  <xsl:if test=".//*[local-name() = 'fn']">
4531
4586
  <xsl:for-each select="*[local-name() = 'tbody']">
4532
4587
  <fo:block font-size="90%" border-bottom="1pt solid black">
4533
- <xsl:call-template name="fn_display"/>
4588
+ <xsl:call-template name="table_fn_display"/>
4534
4589
  </fo:block>
4535
4590
  </xsl:for-each>
4536
4591
  </xsl:if>
@@ -4547,7 +4602,6 @@
4547
4602
  </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
4548
4603
  <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
4549
4604
  <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
4550
- <!-- <xsl:attribute name="border">1pt solid black</xsl:attribute> -->
4551
4605
  <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
4552
4606
  </xsl:if>
4553
4607
  <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
@@ -4560,34 +4614,11 @@
4560
4614
  </fo:table-row>
4561
4615
  </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
4562
4616
  <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
4563
- <xsl:attribute name="text-align">
4564
- <xsl:choose>
4565
- <xsl:when test="@align">
4566
- <xsl:value-of select="@align"/>
4567
- </xsl:when>
4568
- <xsl:otherwise>left</xsl:otherwise>
4569
- </xsl:choose>
4570
- </xsl:attribute>
4571
- <xsl:if test="@colspan">
4572
- <xsl:attribute name="number-columns-spanned">
4573
- <xsl:value-of select="@colspan"/>
4574
- </xsl:attribute>
4575
- </xsl:if>
4576
- <xsl:if test="@rowspan">
4577
- <xsl:attribute name="number-rows-spanned">
4578
- <xsl:value-of select="@rowspan"/>
4579
- </xsl:attribute>
4580
- </xsl:if>
4581
- <xsl:call-template name="display-align"/>
4617
+ <xsl:call-template name="setTextAlignment">
4618
+ <xsl:with-param name="default">left</xsl:with-param>
4619
+ </xsl:call-template>
4582
4620
 
4583
- <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
4584
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
4585
- <xsl:attribute name="background-color">rgb(165, 165, 165)</xsl:attribute>
4586
- </xsl:if>
4587
- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommendtest'">
4588
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
4589
- <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
4590
- </xsl:if> -->
4621
+ <xsl:call-template name="setTableCellAttributes"/>
4591
4622
 
4592
4623
  <fo:block>
4593
4624
  <xsl:apply-templates/>
@@ -4599,37 +4630,15 @@
4599
4630
  <xsl:attribute name="padding">0mm</xsl:attribute>
4600
4631
  <xsl:attribute name="padding-left">0mm</xsl:attribute>
4601
4632
  </xsl:if>
4602
- <xsl:attribute name="text-align">
4603
- <xsl:choose>
4604
- <xsl:when test="@align">
4605
- <xsl:value-of select="@align"/>
4606
- </xsl:when>
4607
- <xsl:otherwise>left</xsl:otherwise>
4608
- </xsl:choose>
4609
- </xsl:attribute>
4633
+ <xsl:call-template name="setTextAlignment">
4634
+ <xsl:with-param name="default">left</xsl:with-param>
4635
+ </xsl:call-template>
4636
+
4610
4637
  <xsl:if test="following-sibling::*[local-name()='td'] and not(preceding-sibling::*[local-name()='td'])">
4611
4638
  <xsl:attribute name="font-weight">bold</xsl:attribute>
4612
4639
  </xsl:if>
4613
- <xsl:if test="@colspan">
4614
- <xsl:attribute name="number-columns-spanned">
4615
- <xsl:value-of select="@colspan"/>
4616
- </xsl:attribute>
4617
- </xsl:if>
4618
- <xsl:if test="@rowspan">
4619
- <xsl:attribute name="number-rows-spanned">
4620
- <xsl:value-of select="@rowspan"/>
4621
- </xsl:attribute>
4622
- </xsl:if>
4623
- <xsl:call-template name="display-align"/>
4624
4640
 
4625
- <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
4626
- <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
4627
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
4628
- <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])">
4629
- <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
4630
- </xsl:if>
4631
- </xsl:if> -->
4632
- <!-- 2nd line and below -->
4641
+ <xsl:call-template name="setTableCellAttributes"/>
4633
4642
 
4634
4643
  <fo:block>
4635
4644
  <xsl:apply-templates/>
@@ -4641,15 +4650,15 @@
4641
4650
  <xsl:apply-templates/>
4642
4651
  </fo:block>
4643
4652
  </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
4644
- <fo:block> <!-- margin-bottom="10pt" -->
4653
+ <fo:block>
4645
4654
  <xsl:apply-templates/>
4646
4655
  </fo:block>
4647
4656
  </xsl:template><xsl:template match="*[local-name() = 'termexample']">
4648
4657
  <fo:block id="{@id}" xsl:use-attribute-sets="termexample-style">
4649
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4650
- <xsl:apply-templates/>
4658
+ <xsl:apply-templates select="*[local-name()='name']"/>
4659
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
4651
4660
  </fo:block>
4652
- </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']" mode="presentation">
4661
+ </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'name']">
4653
4662
  <xsl:if test="normalize-space() != ''">
4654
4663
  <fo:inline xsl:use-attribute-sets="termexample-name-style">
4655
4664
  <xsl:apply-templates/>
@@ -4675,9 +4684,7 @@
4675
4684
 
4676
4685
  <xsl:variable name="fo_element">
4677
4686
  <xsl:if test=".//*[local-name() = 'table'] or .//*[local-name() = 'dl']">block</xsl:if>
4678
- block
4679
-
4680
-
4687
+ block
4681
4688
  </xsl:variable>
4682
4689
 
4683
4690
  <!-- display 'EXAMPLE' -->
@@ -4750,6 +4757,8 @@
4750
4757
  </xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
4751
4758
  <fo:block xsl:use-attribute-sets="termsource-style">
4752
4759
 
4760
+
4761
+
4753
4762
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
4754
4763
  <xsl:variable name="termsource_text">
4755
4764
  <xsl:apply-templates/>
@@ -4787,9 +4796,7 @@
4787
4796
  <xsl:value-of select="."/>
4788
4797
  </xsl:if>
4789
4798
  </xsl:template><xsl:template match="*[local-name() = 'termsource']/*[local-name() = 'strong'][1][following-sibling::*[1][local-name() = 'origin']]/text()">
4790
- <fo:inline>
4791
-
4792
-
4799
+ <fo:inline xsl:use-attribute-sets="termsource-text-style">
4793
4800
  <xsl:value-of select="."/>
4794
4801
  </fo:inline>
4795
4802
  </xsl:template><xsl:template match="*[local-name() = 'origin']">
@@ -4832,7 +4839,6 @@
4832
4839
  <fo:block-container margin-left="0mm">
4833
4840
 
4834
4841
  <fo:block xsl:use-attribute-sets="quote-style">
4835
- <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
4836
4842
 
4837
4843
  <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
4838
4844
  </fo:block>
@@ -4875,15 +4881,13 @@
4875
4881
  </xsl:variable>
4876
4882
 
4877
4883
  <xsl:choose>
4878
- <xsl:when test="normalize-space($bibitemid) != ''">
4884
+ <xsl:when test="normalize-space($bibitemid) != ''"> <!-- if in the bibliography there is the item with @bibitemid (and not hidden), then create link -->
4879
4885
  <fo:inline xsl:use-attribute-sets="eref-style">
4880
4886
  <xsl:if test="@type = 'footnote'">
4881
-
4882
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
4883
- <xsl:attribute name="font-size">80%</xsl:attribute>
4884
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
4885
- <xsl:attribute name="vertical-align">super</xsl:attribute>
4886
-
4887
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
4888
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
4889
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
4890
+ <xsl:attribute name="font-size">80%</xsl:attribute>
4887
4891
 
4888
4892
  </xsl:if>
4889
4893
 
@@ -4903,7 +4907,6 @@
4903
4907
 
4904
4908
 
4905
4909
 
4906
-
4907
4910
  </xsl:if>
4908
4911
 
4909
4912
 
@@ -4956,8 +4959,6 @@
4956
4959
  </xsl:choose>
4957
4960
  </xsl:variable>
4958
4961
 
4959
- <!-- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/> -->
4960
-
4961
4962
  <xsl:choose>
4962
4963
  <xsl:when test="$lang = 'zh'">
4963
4964
  <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
@@ -5013,7 +5014,6 @@
5013
5014
  <xsl:apply-templates/>
5014
5015
  </xsl:template><xsl:template match="*[local-name() = 'definition'][preceding-sibling::*[local-name() = 'domain']]/*[local-name() = 'p'][1]">
5015
5016
  <fo:inline> <xsl:apply-templates/></fo:inline>
5016
- <!-- <fo:block>&#xA0;</fo:block> -->
5017
5017
  <fo:block/>
5018
5018
  </xsl:template><xsl:template match="/*/*[local-name() = 'sections']/*" priority="2">
5019
5019
 
@@ -5049,11 +5049,6 @@
5049
5049
  <xsl:apply-templates/>
5050
5050
  </fo:block>
5051
5051
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
5052
- <fo:block id="{@id}">
5053
- <xsl:apply-templates/>
5054
- </fo:block>
5055
- </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/><xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/><xsl:template match="/*/*[local-name() = 'bibliography']/*[local-name() = 'references'][@normative='true']">
5056
-
5057
5052
  <fo:block id="{@id}">
5058
5053
  <xsl:apply-templates/>
5059
5054
  </fo:block>
@@ -5321,52 +5316,100 @@
5321
5316
  <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
5322
5317
  <fo:block><xsl:apply-templates/></fo:block>
5323
5318
  </fo:table-cell>
5324
- </xsl:template><xsl:template name="processBibitem">
5325
-
5326
-
5327
-
5319
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" priority="3"/><xsl:template match="*[local-name() = 'bibitem'][@hidden='true']" priority="3"/><xsl:template match="*[local-name() = 'bibitem'][starts-with(@id, 'hidden_bibitem_')]" priority="3"/><xsl:template match="*[local-name() = 'references'][@normative='true']" priority="2">
5328
5320
 
5329
5321
 
5330
5322
 
5323
+ <fo:block id="{@id}">
5324
+ <xsl:apply-templates/>
5325
+ </fo:block>
5326
+ </xsl:template><xsl:template match="*[local-name() = 'references']">
5327
+ <xsl:if test="not(ancestor::*[local-name() = 'annex'])">
5328
+
5329
+ <fo:block break-after="page"/>
5330
+
5331
+ </xsl:if>
5331
5332
 
5333
+ <!-- <xsl:if test="ancestor::*[local-name() = 'annex']">
5334
+ <xsl:if test="$namespace = 'csa' or $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'iso' or $namespace = 'itu'">
5335
+ <fo:block break-after="page"/>
5336
+ </xsl:if>
5337
+ </xsl:if> -->
5332
5338
 
5339
+ <fo:block id="{@id}" xsl:use-attribute-sets="references-non-normative-style">
5340
+ <xsl:apply-templates/>
5341
+ </fo:block>
5333
5342
 
5334
5343
 
5335
5344
 
5336
-
5337
5345
 
5346
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']">
5347
+ <xsl:call-template name="bibitem"/>
5348
+ </xsl:template><xsl:template match="*[local-name() = 'references'][@normative='true']/*[local-name() = 'bibitem']" name="bibitem" priority="2">
5338
5349
 
5350
+ <fo:block id="{@id}" xsl:use-attribute-sets="bibitem-normative-style">
5351
+ <xsl:call-template name="processBibitem"/>
5352
+ </fo:block>
5353
+
5339
5354
 
5355
+ </xsl:template><xsl:template match="*[local-name() = 'references'][not(@normative='true')]/*[local-name() = 'bibitem']" priority="2">
5356
+
5357
+ <!-- $namespace = 'csd' or $namespace = 'gb' or $namespace = 'iec' or $namespace = 'iso' or $namespace = 'jcgm' or $namespace = 'm3d' or
5358
+ $namespace = 'mpfd' or $namespace = 'ogc' or $namespace = 'ogc-white-paper' -->
5359
+ <!-- Example: [1] ISO 9:1995, Information and documentation – Transliteration of Cyrillic characters into Latin characters – Slavic and non-Slavic languages -->
5360
+ <fo:list-block id="{@id}" xsl:use-attribute-sets="bibitem-non-normative-list-style">
5361
+ <fo:list-item>
5362
+ <fo:list-item-label end-indent="label-end()">
5363
+ <fo:block>
5364
+ <fo:inline>
5365
+
5366
+ <xsl:value-of select="*[local-name()='docidentifier'][@type = 'metanorma-ordinal']"/>
5367
+ <xsl:if test="not(*[local-name()='docidentifier'][@type = 'metanorma-ordinal'])">
5368
+ <xsl:number format="[1]"/>
5369
+ </xsl:if>
5370
+
5371
+ </fo:inline>
5372
+ </fo:block>
5373
+ </fo:list-item-label>
5374
+ <fo:list-item-body start-indent="body-start()">
5375
+ <fo:block xsl:use-attribute-sets="bibitem-non-normative-list-body-style">
5376
+ <xsl:call-template name="processBibitem"/>
5377
+ </fo:block>
5378
+ </fo:list-item-body>
5379
+ </fo:list-item>
5380
+ </fo:list-block>
5381
+
5382
+
5383
+ </xsl:template><xsl:template name="processBibitem">
5340
5384
 
5341
-
5342
5385
 
5343
- <!-- start MPFD bibitem processing -->
5344
- <xsl:variable name="docidentifier">
5386
+ <!-- start bibitem processing -->
5387
+ <xsl:if test=".//*[local-name() = 'fn']">
5388
+ <xsl:attribute name="line-height-shift-adjustment">disregard-shifts</xsl:attribute>
5389
+ </xsl:if>
5390
+ <xsl:variable name="docidentifier">
5391
+ <xsl:choose>
5392
+ <xsl:when test="*[local-name() = 'docidentifier']/@type = 'metanorma'"/>
5393
+ <xsl:otherwise><xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma-ordinal')]"/></xsl:otherwise>
5394
+ </xsl:choose>
5395
+ </xsl:variable>
5396
+ <fo:inline><xsl:value-of select="$docidentifier"/></fo:inline>
5397
+ <xsl:apply-templates select="*[local-name() = 'note']"/>
5398
+ <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
5345
5399
  <xsl:choose>
5346
- <xsl:when test="mpfd:docidentifier/@type = 'metanorma'"/>
5347
- <xsl:otherwise><xsl:value-of select="mpfd:docidentifier[not(@type = 'metanorma-ordinal')]"/></xsl:otherwise>
5400
+ <xsl:when test="*[local-name() = 'title'][@type = 'main' and @language = $lang]">
5401
+ <xsl:apply-templates select="*[local-name() = 'title'][@type = 'main' and @language = $lang]"/>
5402
+ </xsl:when>
5403
+ <xsl:when test="*[local-name() = 'title'][@type = 'main' and @language = 'en']">
5404
+ <xsl:apply-templates select="*[local-name() = 'title'][@type = 'main' and @language = 'en']"/>
5405
+ </xsl:when>
5406
+ <xsl:otherwise>
5407
+ <xsl:apply-templates select="*[local-name() = 'title']"/>
5408
+ </xsl:otherwise>
5348
5409
  </xsl:choose>
5349
- </xsl:variable>
5350
- <fo:inline><xsl:value-of select="$docidentifier"/></fo:inline>
5351
- <xsl:apply-templates select="mpfd:note"/>
5352
- <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
5353
- <xsl:choose>
5354
- <xsl:when test="mpfd:title[@type = 'main' and @language = 'en']">
5355
- <xsl:apply-templates select="mpfd:title[@type = 'main' and @language = 'en']"/>
5356
- </xsl:when>
5357
- <xsl:otherwise>
5358
- <xsl:apply-templates select="mpfd:title"/>
5359
- </xsl:otherwise>
5360
- </xsl:choose>
5361
- <xsl:apply-templates select="mpfd:formattedref"/>
5362
-
5363
- <!-- end MPFD bibitem processing -->
5364
-
5365
- <!-- start M3D bibitem processing -->
5366
-
5367
-
5368
-
5369
-
5410
+ <xsl:apply-templates select="*[local-name() = 'formattedref']"/>
5411
+ <!-- end bibitem processing -->
5412
+
5370
5413
  </xsl:template><xsl:template name="processBibitemDocId">
5371
5414
  <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'metanorma-ordinal' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
5372
5415
  <xsl:choose>
@@ -5423,6 +5466,48 @@
5423
5466
  <xsl:value-of select="substring(.,1,1)"/>
5424
5467
  </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
5425
5468
  <fo:inline><xsl:apply-templates/></fo:inline>
5469
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'title']" priority="2">
5470
+ <!-- <fo:inline><xsl:apply-templates /></fo:inline> -->
5471
+ <fo:inline font-style="italic"> <!-- BIPM BSI CSD CSA GB IEC IHO ISO ITU JCGM -->
5472
+ <xsl:apply-templates/>
5473
+ </fo:inline>
5474
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'note']" priority="2">
5475
+ <fo:footnote>
5476
+ <xsl:variable name="number">
5477
+
5478
+ <xsl:number level="any" count="*[local-name() = 'bibitem']/*[local-name() = 'note']"/>
5479
+
5480
+ </xsl:variable>
5481
+ <fo:inline xsl:use-attribute-sets="bibitem-note-fn-style">
5482
+ <fo:basic-link internal-destination="{generate-id()}" fox:alt-text="footnote {$number}">
5483
+ <xsl:value-of select="$number"/>
5484
+
5485
+ </fo:basic-link>
5486
+ </fo:inline>
5487
+ <fo:footnote-body>
5488
+ <fo:block xsl:use-attribute-sets="bibitem-note-fn-body-style">
5489
+ <fo:inline id="{generate-id()}" xsl:use-attribute-sets="bibitem-note-fn-number-style">
5490
+ <xsl:value-of select="$number"/>
5491
+
5492
+ </fo:inline>
5493
+ <xsl:apply-templates/>
5494
+ </fo:block>
5495
+ </fo:footnote-body>
5496
+ </fo:footnote>
5497
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'edition']"> <!-- for iho -->
5498
+ <xsl:text> edition </xsl:text>
5499
+ <xsl:value-of select="."/>
5500
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'uri']"> <!-- for iho -->
5501
+ <xsl:text> (</xsl:text>
5502
+ <fo:inline xsl:use-attribute-sets="link-style">
5503
+ <fo:basic-link external-destination="." fox:alt-text=".">
5504
+ <xsl:value-of select="."/>
5505
+ </fo:basic-link>
5506
+ </fo:inline>
5507
+ <xsl:text>)</xsl:text>
5508
+ </xsl:template><xsl:template match="*[local-name() = 'bibitem']/*[local-name() = 'docidentifier']"/><xsl:template match="*[local-name() = 'formattedref']">
5509
+
5510
+ <xsl:apply-templates/>
5426
5511
  </xsl:template><xsl:template match="*[local-name() = 'form']">
5427
5512
  <fo:block>
5428
5513
  <xsl:apply-templates/>
@@ -5495,24 +5580,7 @@
5495
5580
  <xsl:when test="$htmltoclevels != ''"><xsl:value-of select="number($htmltoclevels)"/></xsl:when> <!-- if there is value in xml -->
5496
5581
  <xsl:when test="$toclevels != ''"><xsl:value-of select="number($toclevels)"/></xsl:when> <!-- if there is value in xml -->
5497
5582
  <xsl:otherwise><!-- default value -->
5498
-
5499
-
5500
-
5501
-
5502
-
5503
-
5504
-
5505
-
5506
-
5507
-
5508
5583
  2
5509
-
5510
-
5511
-
5512
-
5513
-
5514
-
5515
-
5516
5584
  </xsl:otherwise>
5517
5585
  </xsl:choose>
5518
5586
  </xsl:variable><xsl:template match="*[local-name() = 'toc']">
@@ -5610,6 +5678,57 @@
5610
5678
  <xsl:copy-of select="."/>
5611
5679
  </xsl:template><xsl:template match="*[local-name() = 'p'][@type = 'floating-title']" priority="4">
5612
5680
  <xsl:call-template name="title"/>
5681
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']">
5682
+
5683
+
5684
+
5685
+
5686
+
5687
+ <!-- text in the box -->
5688
+ <fo:block-container id="{@id}" xsl:use-attribute-sets="admonition-style">
5689
+
5690
+
5691
+
5692
+
5693
+
5694
+ <fo:block-container xsl:use-attribute-sets="admonition-container-style">
5695
+
5696
+
5697
+ <fo:block xsl:use-attribute-sets="admonition-name-style">
5698
+ <xsl:call-template name="displayAdmonitionName"/>
5699
+ </fo:block>
5700
+ <fo:block xsl:use-attribute-sets="admonition-p-style">
5701
+ <xsl:apply-templates select="node()[not(local-name() = 'name')]"/>
5702
+ </fo:block>
5703
+
5704
+ </fo:block-container>
5705
+
5706
+ </fo:block-container>
5707
+
5708
+ </xsl:template><xsl:template name="displayAdmonitionName">
5709
+
5710
+ <xsl:apply-templates select="*[local-name() = 'name']"/>
5711
+ <xsl:if test="not(*[local-name() = 'name'])">
5712
+ <xsl:apply-templates select="@type"/>
5713
+ </xsl:if>
5714
+
5715
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'name']">
5716
+ <xsl:apply-templates/>
5717
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']/@type">
5718
+ <xsl:variable name="admonition_type_">
5719
+ <xsl:call-template name="getLocalizedString">
5720
+ <xsl:with-param name="key">admonition.<xsl:value-of select="."/></xsl:with-param>
5721
+ </xsl:call-template>
5722
+ </xsl:variable>
5723
+ <xsl:variable name="admonition_type" select="normalize-space(java:toUpperCase(java:java.lang.String.new($admonition_type_)))"/>
5724
+ <xsl:value-of select="$admonition_type"/>
5725
+ <xsl:if test="$admonition_type = ''">
5726
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(.))"/>
5727
+ </xsl:if>
5728
+ </xsl:template><xsl:template match="*[local-name() = 'admonition']/*[local-name() = 'p']">
5729
+ <!-- processing for admonition/p found in the template for 'p' -->
5730
+ <xsl:call-template name="paragraph"/>
5731
+
5613
5732
  </xsl:template><xsl:template name="convertDate">
5614
5733
  <xsl:param name="date"/>
5615
5734
  <xsl:param name="format" select="'short'"/>
@@ -5618,78 +5737,39 @@
5618
5737
  <xsl:variable name="day" select="substring($date, 9, 2)"/>
5619
5738
  <xsl:variable name="monthStr">
5620
5739
  <xsl:choose>
5621
- <xsl:when test="$month = '01'">January</xsl:when>
5622
- <xsl:when test="$month = '02'">February</xsl:when>
5623
- <xsl:when test="$month = '03'">March</xsl:when>
5624
- <xsl:when test="$month = '04'">April</xsl:when>
5625
- <xsl:when test="$month = '05'">May</xsl:when>
5626
- <xsl:when test="$month = '06'">June</xsl:when>
5627
- <xsl:when test="$month = '07'">July</xsl:when>
5628
- <xsl:when test="$month = '08'">August</xsl:when>
5629
- <xsl:when test="$month = '09'">September</xsl:when>
5630
- <xsl:when test="$month = '10'">October</xsl:when>
5631
- <xsl:when test="$month = '11'">November</xsl:when>
5632
- <xsl:when test="$month = '12'">December</xsl:when>
5633
- </xsl:choose>
5634
- </xsl:variable>
5635
- <xsl:variable name="result">
5636
- <xsl:choose>
5637
- <xsl:when test="$format = 'ddMMyyyy'">
5638
- <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
5639
- <xsl:text> </xsl:text>
5640
- <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
5641
- </xsl:when>
5642
- <xsl:when test="$format = 'ddMM'">
5643
- <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
5644
- <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
5645
- </xsl:when>
5646
- <xsl:when test="$format = 'short' or $day = ''">
5647
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
5648
- </xsl:when>
5649
- <xsl:otherwise>
5650
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
5651
- </xsl:otherwise>
5740
+ <xsl:when test="$month = '01'">january</xsl:when>
5741
+ <xsl:when test="$month = '02'">february</xsl:when>
5742
+ <xsl:when test="$month = '03'">march</xsl:when>
5743
+ <xsl:when test="$month = '04'">april</xsl:when>
5744
+ <xsl:when test="$month = '05'">may</xsl:when>
5745
+ <xsl:when test="$month = '06'">june</xsl:when>
5746
+ <xsl:when test="$month = '07'">july</xsl:when>
5747
+ <xsl:when test="$month = '08'">august</xsl:when>
5748
+ <xsl:when test="$month = '09'">september</xsl:when>
5749
+ <xsl:when test="$month = '10'">october</xsl:when>
5750
+ <xsl:when test="$month = '11'">november</xsl:when>
5751
+ <xsl:when test="$month = '12'">december</xsl:when>
5652
5752
  </xsl:choose>
5653
5753
  </xsl:variable>
5654
- <xsl:value-of select="$result"/>
5655
- </xsl:template><xsl:template name="convertDateLocalized">
5656
- <xsl:param name="date"/>
5657
- <xsl:param name="format" select="'short'"/>
5658
- <xsl:variable name="year" select="substring($date, 1, 4)"/>
5659
- <xsl:variable name="month" select="substring($date, 6, 2)"/>
5660
- <xsl:variable name="day" select="substring($date, 9, 2)"/>
5661
- <xsl:variable name="monthStr">
5662
- <xsl:choose>
5663
- <xsl:when test="$month = '01'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_january</xsl:with-param></xsl:call-template></xsl:when>
5664
- <xsl:when test="$month = '02'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_february</xsl:with-param></xsl:call-template></xsl:when>
5665
- <xsl:when test="$month = '03'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_march</xsl:with-param></xsl:call-template></xsl:when>
5666
- <xsl:when test="$month = '04'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_april</xsl:with-param></xsl:call-template></xsl:when>
5667
- <xsl:when test="$month = '05'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_may</xsl:with-param></xsl:call-template></xsl:when>
5668
- <xsl:when test="$month = '06'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_june</xsl:with-param></xsl:call-template></xsl:when>
5669
- <xsl:when test="$month = '07'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_july</xsl:with-param></xsl:call-template></xsl:when>
5670
- <xsl:when test="$month = '08'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_august</xsl:with-param></xsl:call-template></xsl:when>
5671
- <xsl:when test="$month = '09'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_september</xsl:with-param></xsl:call-template></xsl:when>
5672
- <xsl:when test="$month = '10'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_october</xsl:with-param></xsl:call-template></xsl:when>
5673
- <xsl:when test="$month = '11'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_november</xsl:with-param></xsl:call-template></xsl:when>
5674
- <xsl:when test="$month = '12'"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_december</xsl:with-param></xsl:call-template></xsl:when>
5675
- </xsl:choose>
5754
+ <xsl:variable name="monthStr_localized">
5755
+ <xsl:if test="normalize-space($monthStr) != ''"><xsl:call-template name="getLocalizedString"><xsl:with-param name="key">month_<xsl:value-of select="$monthStr"/></xsl:with-param></xsl:call-template></xsl:if>
5676
5756
  </xsl:variable>
5677
5757
  <xsl:variable name="result">
5678
5758
  <xsl:choose>
5679
5759
  <xsl:when test="$format = 'ddMMyyyy'">
5680
5760
  <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
5681
5761
  <xsl:text> </xsl:text>
5682
- <xsl:value-of select="normalize-space(concat($monthStr, ' ' , $year))"/>
5762
+ <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ' , $year))"/>
5683
5763
  </xsl:when>
5684
5764
  <xsl:when test="$format = 'ddMM'">
5685
5765
  <xsl:if test="$day != ''"><xsl:value-of select="number($day)"/></xsl:if>
5686
- <xsl:text> </xsl:text><xsl:value-of select="$monthStr"/>
5766
+ <xsl:text> </xsl:text><xsl:value-of select="$monthStr_localized"/>
5687
5767
  </xsl:when>
5688
5768
  <xsl:when test="$format = 'short' or $day = ''">
5689
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $year))"/>
5769
+ <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ', $year))"/>
5690
5770
  </xsl:when>
5691
5771
  <xsl:otherwise>
5692
- <xsl:value-of select="normalize-space(concat($monthStr, ' ', $day, ', ' , $year))"/>
5772
+ <xsl:value-of select="normalize-space(concat($monthStr_localized, ' ', $day, ', ' , $year))"/>
5693
5773
  </xsl:otherwise>
5694
5774
  </xsl:choose>
5695
5775
  </xsl:variable>
@@ -5741,14 +5821,9 @@
5741
5821
  <dc:title>
5742
5822
  <xsl:variable name="title">
5743
5823
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
5744
-
5745
-
5746
-
5747
-
5748
- <xsl:value-of select="*[local-name() = 'title'][@language = $lang]"/>
5749
-
5750
-
5751
5824
 
5825
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang]"/>
5826
+
5752
5827
  </xsl:for-each>
5753
5828
  </xsl:variable>
5754
5829
  <xsl:choose>
@@ -5763,14 +5838,18 @@
5763
5838
  <dc:creator>
5764
5839
  <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
5765
5840
 
5766
-
5767
-
5841
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
5842
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
5843
+ <xsl:if test="position() != last()">; </xsl:if>
5844
+ </xsl:for-each>
5845
+
5768
5846
  </xsl:for-each>
5769
5847
  </dc:creator>
5770
5848
  <dc:description>
5771
5849
  <xsl:variable name="abstract">
5772
5850
 
5773
-
5851
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
5852
+
5774
5853
  </xsl:variable>
5775
5854
  <xsl:value-of select="normalize-space($abstract)"/>
5776
5855
  </dc:description>
@@ -5790,7 +5869,6 @@
5790
5869
  <xsl:value-of select="../@id"/>
5791
5870
  </xsl:when>
5792
5871
  <xsl:otherwise>
5793
- <!-- <xsl:value-of select="concat(local-name(..), '_', text())"/> -->
5794
5872
  <xsl:value-of select="concat(generate-id(..), '_', text())"/>
5795
5873
  </xsl:otherwise>
5796
5874
  </xsl:choose>
@@ -5816,9 +5894,6 @@
5816
5894
  <xsl:when test="ancestor::*[local-name() = 'preface']">
5817
5895
  <xsl:value-of select="$level_total - 2"/>
5818
5896
  </xsl:when>
5819
- <!-- <xsl:when test="parent::*[local-name() = 'sections']">
5820
- <xsl:value-of select="$level_total - 1"/>
5821
- </xsl:when> -->
5822
5897
  <xsl:when test="ancestor::*[local-name() = 'sections']">
5823
5898
  <xsl:value-of select="$level_total - 1"/>
5824
5899
  </xsl:when>
@@ -6008,7 +6083,6 @@
6008
6083
  <xsl:value-of select="$key_"/>
6009
6084
  </xsl:otherwise>
6010
6085
  </xsl:choose>
6011
-
6012
6086
  </xsl:template><xsl:template name="setTrackChangesStyles">
6013
6087
  <xsl:param name="isAdded"/>
6014
6088
  <xsl:param name="isDeleted"/>
@@ -6031,7 +6105,6 @@
6031
6105
  <xsl:if test="local-name() = 'table'">
6032
6106
  <xsl:attribute name="background-color">rgb(255, 185, 185)</xsl:attribute>
6033
6107
  </xsl:if>
6034
- <!-- <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute> -->
6035
6108
  <xsl:attribute name="padding">2mm</xsl:attribute>
6036
6109
  </xsl:if>
6037
6110
  </xsl:otherwise>
@@ -6051,15 +6124,18 @@
6051
6124
  </xsl:choose>
6052
6125
  </xsl:template><xsl:template name="setTextAlignment">
6053
6126
  <xsl:param name="default">left</xsl:param>
6127
+ <xsl:variable name="align" select="normalize-space(@align)"/>
6054
6128
  <xsl:attribute name="text-align">
6055
6129
  <xsl:choose>
6056
- <xsl:when test="@align and not(@align = 'indent')"><xsl:value-of select="@align"/></xsl:when>
6130
+ <xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
6131
+ <xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
6132
+ <xsl:when test="$align != '' and not($align = 'indent')"><xsl:value-of select="$align"/></xsl:when>
6057
6133
  <xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
6058
6134
  <xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
6059
6135
  <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
6060
6136
  </xsl:choose>
6061
6137
  </xsl:attribute>
6062
- <xsl:if test="@align = 'indent'">
6138
+ <xsl:if test="$align = 'indent'">
6063
6139
  <xsl:attribute name="margin-left">7mm</xsl:attribute>
6064
6140
  </xsl:if>
6065
6141
  </xsl:template><xsl:template name="number-to-words">