metanorma-iho 0.2.2 → 0.2.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,7 +16,7 @@ fieldset, form, label, legend,
16
16
  table, caption, tbody, tfoot, thead, tr, th, td,
17
17
  article, aside, canvas, details, embed,
18
18
  figure, figcaption, footer, header, hgroup,
19
- menu, nav, output, ruby, section, summary,
19
+ menu, output, ruby, section, summary,
20
20
  time, mark, audio, video {
21
21
  margin: 0;
22
22
  padding: 0; }
@@ -111,6 +111,10 @@ b, strong {
111
111
  div.document-stage-band, div.document-type-band {
112
112
  background-color: #333333; }
113
113
 
114
+ a.FootnoteRef + a.FootnoteRef:before {
115
+ content: ", ";
116
+ vertical-align: super; }
117
+
114
118
  #standard-band {
115
119
  background-color: #0AC442; }
116
120
 
@@ -667,7 +667,7 @@ div.WordSection2 {
667
667
  div.WordSection3 {
668
668
  page: WordSection3; }
669
669
 
670
- table.MsoISOTable {
670
+ table.MsoISOTable, table.MsoISOTableBig {
671
671
  mso-style-name: "Table ISO";
672
672
  mso-tstyle-rowband-size: 0;
673
673
  mso-tstyle-colband-size: 0;
@@ -688,17 +688,17 @@ table.MsoISOTable {
688
688
  font-size: 12.0pt;
689
689
  font-family: {{bodyfont}}; }
690
690
 
691
- table.MsoISOTable th {
691
+ table.MsoISOTable th, table.MsoISOTableBig th {
692
692
  border: solid windowtext 1pt;
693
693
  mso-border-alt: solid windowtext 1pt;
694
694
  padding: 0cm 2.85pt 0cm 2.85pt; }
695
695
 
696
- table.MsoISOTable td {
696
+ table.MsoISOTable td, table.MsoISOTableBig td {
697
697
  border: solid windowtext 1pt;
698
698
  mso-border-alt: solid windowtext 1pt;
699
699
  padding: 0cm 2.85pt 0cm 2.85pt; }
700
700
 
701
- table.MsoISOTable p {
701
+ table.MsoISOTable p, table.MsoISOTableBig p {
702
702
  font-size: 12.0pt; }
703
703
 
704
704
  table.MsoTableGrid {
@@ -785,8 +785,20 @@ div.example p.MsoListParagraph {
785
785
  font-size: 11.0pt; }
786
786
 
787
787
  div.Note p.MsoListParagraph {
788
+ font-size: 11.0pt;
789
+ margin-left: 1.0cm; }
790
+
791
+ div.Note span.stem {
788
792
  font-size: 11.0pt; }
789
793
 
794
+ div.Note p.Sourcecode, div.Note pre.Sourcecode {
795
+ font-size: 9.0pt;
796
+ margin-left: 1.0cm; }
797
+
798
+ div.Note table.dl {
799
+ font-size: 11.0pt;
800
+ margin-left: 1.0cm; }
801
+
790
802
  span.note_label, span.example_label, td.example_label, td.note_label {
791
803
  font-size: 11.0pt;
792
804
  font-family: {{bodyfont}}; }
@@ -630,7 +630,7 @@ div.WordSection2
630
630
  mso-paper-source:0;}
631
631
  div.WordSection3
632
632
  {page:WordSection3;}
633
- table.MsoISOTable
633
+ table.MsoISOTable, table.MsoISOTableBig
634
634
  {mso-style-name:"Table ISO";
635
635
  mso-tstyle-rowband-size:0;
636
636
  mso-tstyle-colband-size:0;
@@ -650,15 +650,15 @@ table.MsoISOTable
650
650
  mso-border-insidev:.75pt solid windowtext;
651
651
  font-size:12.0pt;
652
652
  font-family:$bodyfont;}
653
- table.MsoISOTable th
653
+ table.MsoISOTable th, table.MsoISOTableBig th
654
654
  {border:solid windowtext 1pt;
655
655
  mso-border-alt:solid windowtext 1pt;
656
656
  padding:0cm 2.85pt 0cm 2.85pt;}
657
- table.MsoISOTable td
657
+ table.MsoISOTable td, table.MsoISOTableBig td
658
658
  {border:solid windowtext 1pt;
659
659
  mso-border-alt:solid windowtext 1pt;
660
660
  padding:0cm 2.85pt 0cm 2.85pt;}
661
- table.MsoISOTable p
661
+ table.MsoISOTable p, table.MsoISOTableBig p
662
662
  {font-size:12.0pt; }
663
663
  table.MsoTableGrid
664
664
  {mso-style-name:"Table Grid";
@@ -744,6 +744,20 @@ div.example p.MsoListParagraph {
744
744
 
745
745
  div.Note p.MsoListParagraph {
746
746
  font-size: 11.0pt;
747
+ margin-left: 1.0cm;
748
+ }
749
+
750
+ div.Note span.stem {
751
+ font-size: 11.0pt; }
752
+
753
+ div.Note p.Sourcecode, div.Note pre.Sourcecode {
754
+ font-size: 9.0pt;
755
+ margin-left: 1.0cm;
756
+ }
757
+
758
+ div.Note table.dl {
759
+ font-size: 11.0pt;
760
+ margin-left: 1.0cm;
747
761
  }
748
762
 
749
763
  span.note_label, span.example_label, td.example_label, td.note_label
@@ -0,0 +1,2 @@
1
+ clause: Chapter
2
+ subclause: Section
@@ -111,6 +111,10 @@
111
111
 
112
112
  <xsl:call-template name="addPDFUAmeta"/>
113
113
 
114
+ <xsl:call-template name="addBookmarks">
115
+ <xsl:with-param name="contents" select="$contents"/>
116
+ </xsl:call-template>
117
+
114
118
  <!-- =========================== -->
115
119
  <!-- Cover Page -->
116
120
  <fo:page-sequence master-reference="cover">
@@ -217,7 +221,7 @@
217
221
  <xsl:text disable-output-escaping="yes">--&gt;</xsl:text>
218
222
  </xsl:if>
219
223
 
220
- <xsl:for-each select="xalan:nodeset($contents)//item"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
224
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
221
225
  <fo:block>
222
226
  <xsl:if test="@level = 1">
223
227
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
@@ -243,8 +247,8 @@
243
247
  </fo:list-item-label>
244
248
  <fo:list-item-body start-indent="body-start()">
245
249
  <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
246
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
247
- <xsl:apply-templates/>
250
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
251
+ <xsl:apply-templates select="title"/>
248
252
  <fo:inline keep-together.within-line="always">
249
253
  <fo:leader font-size="9pt" font-weight="normal" leader-pattern="dots"/>
250
254
  <fo:inline><fo:page-number-citation ref-id="{@id}"/></fo:inline>
@@ -361,15 +365,21 @@
361
365
  </xsl:variable>
362
366
 
363
367
  <xsl:variable name="display">
364
- <xsl:choose>
365
- <xsl:when test="ancestor-or-self::iho:bibitem">false</xsl:when>
366
- <xsl:when test="ancestor-or-self::iho:term">false</xsl:when>
368
+ <xsl:choose>
367
369
  <xsl:when test="$level &lt;= 2">true</xsl:when>
368
370
  <xsl:otherwise>false</xsl:otherwise>
369
371
  </xsl:choose>
370
372
  </xsl:variable>
371
373
 
372
- <xsl:if test="$display = 'true'">
374
+ <xsl:variable name="skip">
375
+ <xsl:choose>
376
+ <xsl:when test="ancestor-or-self::iho:bibitem">true</xsl:when>
377
+ <xsl:when test="ancestor-or-self::iho:term">true</xsl:when>
378
+ <xsl:otherwise>false</xsl:otherwise>
379
+ </xsl:choose>
380
+ </xsl:variable>
381
+
382
+ <xsl:if test="$skip = 'false'">
373
383
 
374
384
  <xsl:variable name="section">
375
385
  <xsl:call-template name="getSection"/>
@@ -388,10 +398,13 @@
388
398
  <xsl:if test="ancestor-or-self::iho:annex">annex</xsl:if>
389
399
  </xsl:variable>
390
400
 
391
- <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}">
392
- <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
401
+ <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}" display="{$display}">
402
+ <title>
403
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
404
+ </title>
405
+ <xsl:apply-templates mode="contents"/>
393
406
  </item>
394
- <xsl:apply-templates mode="contents"/>
407
+
395
408
  </xsl:if>
396
409
 
397
410
  </xsl:template>
@@ -608,7 +621,7 @@
608
621
  </xsl:template>
609
622
 
610
623
 
611
- <xsl:template match="iho:ul | iho:ol">
624
+ <xsl:template match="iho:ul | iho:ol" mode="ul_ol">
612
625
  <fo:list-block provisional-distance-between-starts="6mm">
613
626
  <xsl:apply-templates/>
614
627
  </fo:list-block>
@@ -624,13 +637,16 @@
624
637
  <xsl:apply-templates mode="process"/>
625
638
  </fo:block>
626
639
  </xsl:template>
627
- <xsl:template match="iho:ul//iho:note/iho:name | iho:ol//iho:note/iho:name" mode="process"/>
628
- <xsl:template match="iho:ul//iho:note/iho:p | iho:ol//iho:note/iho:p" mode="process">
640
+ <xsl:template match="iho:ul//iho:note/iho:name | iho:ol//iho:note/iho:name" mode="process" priority="2"/>
641
+ <xsl:template match="iho:ul//iho:note/iho:p | iho:ol//iho:note/iho:p" mode="process" priority="2">
629
642
  <fo:block font-size="11pt" margin-top="4pt">
630
643
  <xsl:apply-templates/>
631
644
  </fo:block>
632
645
  </xsl:template>
633
646
 
647
+ <xsl:template match="iho:ul//iho:note/* | iho:ol//iho:note/*" mode="process">
648
+ <xsl:apply-templates select="."/>
649
+ </xsl:template>
634
650
 
635
651
 
636
652
  <xsl:template match="iho:li">
@@ -690,7 +706,13 @@
690
706
  </fo:block>
691
707
  </xsl:template>
692
708
 
693
- <!-- Example: [1] IHO S-100, Universal Hydrographic Data Model v4.0.0, December 2018 (Encoding, Feature Catalogue) -->
709
+
710
+ <!-- IHO documents:
711
+ "[1] S57 edition 3.1: IHO Transfer Standard for Digital Hydrographic Data, International Hydrographic Organization (www.iho.int)”
712
+ [{number}] {docID} edition {edition}: {title}, {author/organization}
713
+
714
+ Non-IHO documents:
715
+ Provide title and publisher -->
694
716
  <xsl:template match="iho:bibitem">
695
717
  <fo:list-block margin-bottom="12pt" provisional-distance-between-starts="12mm" line-height="115%">
696
718
  <fo:list-item>
@@ -703,38 +725,34 @@
703
725
  </fo:list-item-label>
704
726
  <fo:list-item-body start-indent="body-start()">
705
727
  <fo:block>
706
- <xsl:variable name="docidentifier">
707
- <xsl:if test="iho:docidentifier">
708
- <xsl:choose>
709
- <xsl:when test="iho:docidentifier/@type = 'metanorma'"/>
710
- <xsl:otherwise><xsl:value-of select="iho:docidentifier"/></xsl:otherwise>
711
- </xsl:choose>
712
- </xsl:if>
713
- </xsl:variable>
714
- <xsl:value-of select="$docidentifier"/>
715
- <xsl:apply-templates select="iho:note"/>
716
- <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
717
- <xsl:choose>
718
- <xsl:when test="iho:title[@type = 'main' and @language = 'en']">
719
- <xsl:apply-templates select="iho:title[@type = 'main' and @language = 'en']"/>
720
- </xsl:when>
721
- <xsl:otherwise>
722
- <xsl:apply-templates select="iho:title"/>
723
- </xsl:otherwise>
724
- </xsl:choose>
725
- <xsl:apply-templates select="iho:formattedref"/>
728
+ <xsl:call-template name="processBibitem"/>
726
729
  </fo:block>
727
730
  </fo:list-item-body>
728
731
  </fo:list-item>
729
732
  </fo:list-block>
730
733
  </xsl:template>
731
734
 
735
+ <xsl:template match="iho:bibitem/iho:edition">
736
+ <xsl:text> edition </xsl:text>
737
+ <xsl:value-of select="."/>
738
+ </xsl:template>
739
+
732
740
  <xsl:template match="iho:bibitem/iho:title">
733
741
  <fo:inline font-style="italic">
734
742
  <xsl:apply-templates/>
735
743
  </fo:inline>
736
744
  </xsl:template>
737
745
 
746
+ <xsl:template match="iho:bibitem/iho:uri">
747
+ <xsl:text> (</xsl:text>
748
+ <fo:inline xsl:use-attribute-sets="link-style">
749
+ <fo:basic-link external-destination="." fox:alt-text=".">
750
+ <xsl:value-of select="."/>
751
+ </fo:basic-link>
752
+ </fo:inline>
753
+ <xsl:text>)</xsl:text>
754
+ </xsl:template>
755
+
738
756
  <xsl:template match="iho:bibitem/iho:note" priority="2">
739
757
  <fo:footnote>
740
758
  <xsl:variable name="number">
@@ -949,6 +967,12 @@
949
967
 
950
968
  </title-edition>
951
969
 
970
+ <title-edition lang="fr">
971
+
972
+ <xsl:text>Édition </xsl:text>
973
+
974
+ </title-edition>
975
+
952
976
 
953
977
  <title-toc lang="en">
954
978
 
@@ -957,7 +981,12 @@
957
981
 
958
982
 
959
983
  </title-toc>
960
- <title-toc lang="fr">Sommaire</title-toc>
984
+ <title-toc lang="fr">
985
+
986
+ <xsl:text>Sommaire</xsl:text>
987
+
988
+
989
+ </title-toc>
961
990
 
962
991
  <title-toc lang="zh">Contents</title-toc>
963
992
 
@@ -977,13 +1006,22 @@
977
1006
  <title-part lang="en">
978
1007
 
979
1008
 
1009
+
980
1010
  </title-part>
981
1011
  <title-part lang="fr">
982
1012
 
983
1013
 
1014
+
984
1015
  </title-part>
985
1016
  <title-part lang="zh">第 # 部分:</title-part>
986
1017
 
1018
+ <title-subpart lang="en">
1019
+
1020
+ </title-subpart>
1021
+ <title-subpart lang="fr">
1022
+
1023
+ </title-subpart>
1024
+
987
1025
  <title-modified lang="en">modified</title-modified>
988
1026
  <title-modified lang="fr">modifiée</title-modified>
989
1027
 
@@ -991,7 +1029,12 @@
991
1029
 
992
1030
 
993
1031
 
994
- <title-source lang="en">SOURCE</title-source>
1032
+ <title-source lang="en">
1033
+
1034
+ <xsl:text>SOURCE</xsl:text>
1035
+
1036
+
1037
+ </title-source>
995
1038
 
996
1039
  <title-keywords lang="en">Keywords</title-keywords>
997
1040
 
@@ -1034,12 +1077,25 @@
1034
1077
  <title-warning lang="zh">警告</title-warning>
1035
1078
 
1036
1079
  <title-amendment lang="en">AMENDMENT</title-amendment>
1080
+
1081
+ <title-continued lang="en">(continued)</title-continued>
1082
+ <title-continued lang="fr">(continué)</title-continued>
1083
+
1037
1084
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
1038
1085
  <xsl:param name="name"/>
1039
- <xsl:variable name="lang">
1040
- <xsl:call-template name="getLang"/>
1086
+ <xsl:param name="lang"/>
1087
+ <xsl:variable name="lang_">
1088
+ <xsl:choose>
1089
+ <xsl:when test="$lang != ''">
1090
+ <xsl:value-of select="$lang"/>
1091
+ </xsl:when>
1092
+ <xsl:otherwise>
1093
+ <xsl:call-template name="getLang"/>
1094
+ </xsl:otherwise>
1095
+ </xsl:choose>
1041
1096
  </xsl:variable>
1042
- <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/>
1097
+ <xsl:variable name="language" select="normalize-space($lang_)"/>
1098
+ <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $language]"/>
1043
1099
  <xsl:choose>
1044
1100
  <xsl:when test="normalize-space($title_) != ''">
1045
1101
  <xsl:value-of select="$title_"/>
@@ -1048,12 +1104,15 @@
1048
1104
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
1049
1105
  </xsl:otherwise>
1050
1106
  </xsl:choose>
1051
- </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="link-style">
1107
+ </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">
1108
+
1109
+ </xsl:attribute-set><xsl:attribute-set name="link-style">
1052
1110
 
1053
1111
  <xsl:attribute name="color">blue</xsl:attribute>
1054
1112
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1055
1113
 
1056
1114
 
1115
+
1057
1116
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
1058
1117
  <xsl:attribute name="white-space">pre</xsl:attribute>
1059
1118
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -1065,8 +1124,8 @@
1065
1124
 
1066
1125
 
1067
1126
 
1068
- <xsl:attribute name="font-family">SFMono-Regular</xsl:attribute>
1069
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1127
+
1128
+ <xsl:attribute name="font-family">SFMono-Regular</xsl:attribute>
1070
1129
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1071
1130
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
1072
1131
  <xsl:attribute name="line-height">113%</xsl:attribute>
@@ -1121,6 +1180,7 @@
1121
1180
 
1122
1181
 
1123
1182
 
1183
+
1124
1184
  </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1125
1185
 
1126
1186
 
@@ -1142,6 +1202,7 @@
1142
1202
 
1143
1203
 
1144
1204
 
1205
+
1145
1206
 
1146
1207
 
1147
1208
 
@@ -1188,6 +1249,7 @@
1188
1249
 
1189
1250
 
1190
1251
 
1252
+
1191
1253
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1192
1254
 
1193
1255
 
@@ -1201,11 +1263,13 @@
1201
1263
 
1202
1264
  <xsl:attribute name="color">blue</xsl:attribute>
1203
1265
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1204
-
1266
+
1267
+
1205
1268
  </xsl:attribute-set><xsl:attribute-set name="eref-style">
1206
1269
 
1207
1270
 
1208
1271
 
1272
+
1209
1273
  </xsl:attribute-set><xsl:attribute-set name="note-style">
1210
1274
 
1211
1275
 
@@ -1226,8 +1290,7 @@
1226
1290
 
1227
1291
 
1228
1292
 
1229
-
1230
- </xsl:attribute-set><xsl:attribute-set name="note-name-style">
1293
+ </xsl:attribute-set><xsl:variable name="note-body-indent">10mm</xsl:variable><xsl:variable name="note-body-indent-table">5mm</xsl:variable><xsl:attribute-set name="note-name-style">
1231
1294
 
1232
1295
 
1233
1296
 
@@ -1239,7 +1302,9 @@
1239
1302
 
1240
1303
 
1241
1304
 
1242
-
1305
+
1306
+
1307
+
1243
1308
 
1244
1309
  </xsl:attribute-set><xsl:attribute-set name="note-p-style">
1245
1310
 
@@ -1269,6 +1334,8 @@
1269
1334
 
1270
1335
 
1271
1336
 
1337
+ </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1338
+
1272
1339
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1273
1340
 
1274
1341
 
@@ -1299,6 +1366,7 @@
1299
1366
  <xsl:attribute name="color">blue</xsl:attribute>
1300
1367
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
1301
1368
 
1369
+
1302
1370
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1303
1371
 
1304
1372
  <xsl:attribute name="margin-bottom">10pt</xsl:attribute>
@@ -1310,6 +1378,7 @@
1310
1378
 
1311
1379
 
1312
1380
 
1381
+
1313
1382
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1314
1383
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1315
1384
  <xsl:attribute name="text-align">center</xsl:attribute>
@@ -1351,14 +1420,16 @@
1351
1420
  </xsl:attribute-set><xsl:attribute-set name="tt-style">
1352
1421
 
1353
1422
 
1354
- <xsl:attribute name="font-family">Courier</xsl:attribute>
1355
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1423
+ <xsl:attribute name="font-family">Courier</xsl:attribute>
1424
+
1356
1425
 
1357
1426
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
1358
1427
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1359
1428
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1360
1429
  <xsl:attribute name="text-align">center</xsl:attribute>
1361
1430
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1431
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1432
+
1362
1433
  </xsl:attribute-set><xsl:attribute-set name="domain-style">
1363
1434
 
1364
1435
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
@@ -1424,6 +1495,12 @@
1424
1495
 
1425
1496
 
1426
1497
 
1498
+ <!-- <xsl:if test="$namespace = 'bipm'">
1499
+ <fo:block>&#xA0;</fo:block>
1500
+ </xsl:if> -->
1501
+
1502
+ <!-- $namespace = 'iso' or -->
1503
+
1427
1504
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1428
1505
 
1429
1506
 
@@ -1459,6 +1536,7 @@
1459
1536
  <xsl:with-param name="table" select="$simple-table"/>
1460
1537
  </xsl:call-template>
1461
1538
  </xsl:variable>
1539
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1462
1540
 
1463
1541
  <!-- <xsl:variable name="colwidths2">
1464
1542
  <xsl:call-template name="calculate-column-widths">
@@ -1480,9 +1558,12 @@
1480
1558
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1481
1559
 
1482
1560
 
1561
+
1562
+
1563
+
1483
1564
 
1484
1565
 
1485
-
1566
+
1486
1567
 
1487
1568
 
1488
1569
 
@@ -1491,21 +1572,42 @@
1491
1572
  <xsl:attribute name="margin-right">0mm</xsl:attribute>
1492
1573
 
1493
1574
 
1494
- <fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm" table-omit-footer-at-break="true">
1495
-
1496
-
1497
-
1575
+
1576
+
1577
+
1578
+ <xsl:variable name="table_attributes">
1579
+ <attribute name="table-layout">fixed</attribute>
1580
+ <attribute name="width">100%</attribute>
1581
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1582
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1498
1583
 
1499
1584
 
1500
1585
 
1501
1586
 
1587
+
1588
+
1589
+
1590
+
1591
+ <attribute name="margin-left">0mm</attribute>
1592
+ <attribute name="margin-right">0mm</attribute>
1502
1593
 
1594
+
1503
1595
 
1596
+ </xsl:variable>
1597
+
1598
+
1599
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
1504
1600
 
1505
-
1506
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
1507
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
1601
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1602
+ <xsl:attribute name="{@name}">
1603
+ <xsl:value-of select="."/>
1604
+ </xsl:attribute>
1605
+ </xsl:for-each>
1508
1606
 
1607
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1608
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1609
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1610
+ </xsl:if>
1509
1611
 
1510
1612
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
1511
1613
  <xsl:choose>
@@ -1529,6 +1631,33 @@
1529
1631
 
1530
1632
  </fo:table>
1531
1633
 
1634
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1635
+ <xsl:call-template name="insertTableFooterInSeparateTable">
1636
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
1637
+ <xsl:with-param name="colwidths" select="$colwidths"/>
1638
+ </xsl:call-template>
1639
+ </xsl:for-each>
1640
+
1641
+ <!-- insert footer as table -->
1642
+ <!-- <fo:table>
1643
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1644
+ <xsl:attribute name="{@name}">
1645
+ <xsl:value-of select="."/>
1646
+ </xsl:attribute>
1647
+ </xsl:for-each>
1648
+
1649
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1650
+ <xsl:choose>
1651
+ <xsl:when test=". = 1 or . = 0">
1652
+ <fo:table-column column-width="proportional-column-width(2)"/>
1653
+ </xsl:when>
1654
+ <xsl:otherwise>
1655
+ <fo:table-column column-width="proportional-column-width({.})"/>
1656
+ </xsl:otherwise>
1657
+ </xsl:choose>
1658
+ </xsl:for-each>
1659
+ </fo:table>-->
1660
+
1532
1661
 
1533
1662
 
1534
1663
 
@@ -1537,8 +1666,10 @@
1537
1666
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1538
1667
  <xsl:if test="normalize-space() != ''">
1539
1668
  <fo:block xsl:use-attribute-sets="table-name-style">
1540
- <xsl:apply-templates/>
1541
- </fo:block>
1669
+
1670
+
1671
+ <xsl:apply-templates/>
1672
+ </fo:block>
1542
1673
  </xsl:if>
1543
1674
  </xsl:template><xsl:template name="calculate-columns-numbers">
1544
1675
  <xsl:param name="table-row"/>
@@ -1592,6 +1723,13 @@
1592
1723
  <xsl:for-each select="xalan:nodeset($table)//tr">
1593
1724
  <xsl:variable name="td_text">
1594
1725
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
1726
+
1727
+ <!-- <xsl:if test="$namespace = 'bipm'">
1728
+ <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
1729
+ <word><xsl:value-of select="normalize-space(.)"/></word>
1730
+ </xsl:for-each>
1731
+ </xsl:if> -->
1732
+
1595
1733
  </xsl:variable>
1596
1734
  <xsl:variable name="words">
1597
1735
  <xsl:variable name="string_with_added_zerospaces">
@@ -1651,13 +1789,31 @@
1651
1789
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
1652
1790
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
1653
1791
  <xsl:value-of select="@target"/>
1792
+ </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
1793
+ <xsl:variable name="math_text" select="normalize-space(.)"/>
1794
+ <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
1654
1795
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1655
1796
  <xsl:param name="cols-count"/>
1656
1797
  <!-- font-weight="bold" -->
1657
- <fo:table-header>
1798
+ <fo:table-header>
1658
1799
 
1659
1800
  <xsl:apply-templates/>
1660
1801
  </fo:table-header>
1802
+ </xsl:template><xsl:template name="table-header-title">
1803
+ <xsl:param name="cols-count"/>
1804
+ <!-- row for title -->
1805
+ <fo:table-row>
1806
+ <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">
1807
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
1808
+ <xsl:for-each select="ancestor::*[local-name()='table'][1]">
1809
+ <xsl:call-template name="fn_name_display"/>
1810
+ </xsl:for-each>
1811
+ <fo:block text-align="right" font-style="italic">
1812
+ <xsl:text> </xsl:text>
1813
+ <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
1814
+ </fo:block>
1815
+ </fo:table-cell>
1816
+ </fo:table-row>
1661
1817
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
1662
1818
  <fo:table-body>
1663
1819
  <xsl:apply-templates/>
@@ -1665,6 +1821,13 @@
1665
1821
  </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
1666
1822
  <xsl:apply-templates/>
1667
1823
  </xsl:template><xsl:template name="insertTableFooter">
1824
+ <xsl:param name="cols-count"/>
1825
+ <xsl:if test="../*[local-name()='tfoot']">
1826
+ <fo:table-footer>
1827
+ <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
1828
+ </fo:table-footer>
1829
+ </xsl:if>
1830
+ </xsl:template><xsl:template name="insertTableFooter2">
1668
1831
  <xsl:param name="cols-count"/>
1669
1832
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1670
1833
  <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
@@ -1686,11 +1849,29 @@
1686
1849
  <!-- fn will be processed inside 'note' processing -->
1687
1850
 
1688
1851
 
1852
+
1853
+
1854
+
1855
+
1689
1856
  <!-- except gb -->
1690
1857
 
1691
1858
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1692
1859
 
1693
1860
 
1861
+ <!-- show Note under table in preface (ex. abstract) sections -->
1862
+ <!-- empty, because notes show at page side in main sections -->
1863
+ <!-- <xsl:if test="$namespace = 'bipm'">
1864
+ <xsl:choose>
1865
+ <xsl:when test="ancestor::*[local-name()='preface']">
1866
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1867
+ </xsl:when>
1868
+ <xsl:otherwise>
1869
+ <fo:block/>
1870
+ </xsl:otherwise>
1871
+ </xsl:choose>
1872
+ </xsl:if> -->
1873
+
1874
+
1694
1875
  <!-- horizontal row separator -->
1695
1876
 
1696
1877
 
@@ -1704,6 +1885,88 @@
1704
1885
  </fo:table-footer>
1705
1886
 
1706
1887
  </xsl:if>
1888
+ </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
1889
+ <xsl:param name="table_attributes"/>
1890
+ <xsl:param name="colwidths"/>
1891
+
1892
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1893
+
1894
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1895
+
1896
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
1897
+
1898
+ <fo:table keep-with-previous="always">
1899
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1900
+ <xsl:choose>
1901
+ <xsl:when test="@name = 'border-top'">
1902
+ <xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
1903
+ </xsl:when>
1904
+ <xsl:when test="@name = 'border'">
1905
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
1906
+ <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
1907
+ </xsl:when>
1908
+ <xsl:otherwise>
1909
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
1910
+ </xsl:otherwise>
1911
+ </xsl:choose>
1912
+ </xsl:for-each>
1913
+
1914
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1915
+ <xsl:choose>
1916
+ <xsl:when test=". = 1 or . = 0">
1917
+ <fo:table-column column-width="proportional-column-width(2)"/>
1918
+ </xsl:when>
1919
+ <xsl:otherwise>
1920
+ <fo:table-column column-width="proportional-column-width({.})"/>
1921
+ </xsl:otherwise>
1922
+ </xsl:choose>
1923
+ </xsl:for-each>
1924
+
1925
+ <fo:table-body>
1926
+ <fo:table-row>
1927
+ <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
1928
+
1929
+
1930
+
1931
+ <!-- fn will be processed inside 'note' processing -->
1932
+
1933
+
1934
+
1935
+
1936
+
1937
+
1938
+
1939
+ <!-- except gb -->
1940
+
1941
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1942
+
1943
+
1944
+ <!-- <xsl:if test="$namespace = 'bipm'">
1945
+ <xsl:choose>
1946
+ <xsl:when test="ancestor::*[local-name()='preface']">
1947
+ show Note under table in preface (ex. abstract) sections
1948
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1949
+ </xsl:when>
1950
+ <xsl:otherwise>
1951
+ empty, because notes show at page side in main sections
1952
+ <fo:block/>
1953
+ </xsl:otherwise>
1954
+ </xsl:choose>
1955
+ </xsl:if> -->
1956
+
1957
+
1958
+ <!-- horizontal row separator -->
1959
+
1960
+
1961
+ <!-- fn processing -->
1962
+ <xsl:call-template name="fn_display"/>
1963
+
1964
+ </fo:table-cell>
1965
+ </fo:table-row>
1966
+ </fo:table-body>
1967
+
1968
+ </fo:table>
1969
+ </xsl:if>
1707
1970
  </xsl:template><xsl:template match="*[local-name()='tbody']">
1708
1971
 
1709
1972
  <xsl:variable name="cols-count">
@@ -1721,6 +1984,8 @@
1721
1984
  </xsl:choose>
1722
1985
  </xsl:variable>
1723
1986
 
1987
+
1988
+
1724
1989
  <xsl:apply-templates select="../*[local-name()='thead']" mode="process">
1725
1990
  <xsl:with-param name="cols-count" select="$cols-count"/>
1726
1991
  </xsl:apply-templates>
@@ -1730,6 +1995,8 @@
1730
1995
  </xsl:call-template>
1731
1996
 
1732
1997
  <fo:table-body>
1998
+
1999
+
1733
2000
  <xsl:apply-templates/>
1734
2001
  <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> -->
1735
2002
 
@@ -1753,6 +2020,12 @@
1753
2020
  </xsl:if>
1754
2021
 
1755
2022
 
2023
+
2024
+
2025
+ <!-- <xsl:if test="$namespace = 'bipm'">
2026
+ <xsl:attribute name="height">8mm</xsl:attribute>
2027
+ </xsl:if> -->
2028
+
1756
2029
  <xsl:apply-templates/>
1757
2030
  </fo:table-row>
1758
2031
  </xsl:template><xsl:template match="*[local-name()='th']">
@@ -1774,6 +2047,8 @@
1774
2047
 
1775
2048
 
1776
2049
 
2050
+
2051
+
1777
2052
  <xsl:if test="@colspan">
1778
2053
  <xsl:attribute name="number-columns-spanned">
1779
2054
  <xsl:value-of select="@colspan"/>
@@ -1784,10 +2059,22 @@
1784
2059
  <xsl:value-of select="@rowspan"/>
1785
2060
  </xsl:attribute>
1786
2061
  </xsl:if>
2062
+ <xsl:call-template name="display-align"/>
1787
2063
  <fo:block>
1788
2064
  <xsl:apply-templates/>
1789
2065
  </fo:block>
1790
2066
  </fo:table-cell>
2067
+ </xsl:template><xsl:template name="display-align">
2068
+ <xsl:if test="@valign">
2069
+ <xsl:attribute name="display-align">
2070
+ <xsl:choose>
2071
+ <xsl:when test="@valign = 'top'">before</xsl:when>
2072
+ <xsl:when test="@valign = 'middle'">center</xsl:when>
2073
+ <xsl:when test="@valign = 'bottom'">after</xsl:when>
2074
+ <xsl:otherwise>before</xsl:otherwise>
2075
+ </xsl:choose>
2076
+ </xsl:attribute>
2077
+ </xsl:if>
1791
2078
  </xsl:template><xsl:template match="*[local-name()='td']">
1792
2079
  <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
1793
2080
  <xsl:attribute name="text-align">
@@ -1803,7 +2090,9 @@
1803
2090
 
1804
2091
 
1805
2092
 
1806
-
2093
+
2094
+
2095
+
1807
2096
 
1808
2097
 
1809
2098
 
@@ -1819,6 +2108,7 @@
1819
2108
  <xsl:value-of select="@rowspan"/>
1820
2109
  </xsl:attribute>
1821
2110
  </xsl:if>
2111
+ <xsl:call-template name="display-align"/>
1822
2112
  <fo:block>
1823
2113
 
1824
2114
  <xsl:apply-templates/>
@@ -1834,6 +2124,8 @@
1834
2124
 
1835
2125
  <xsl:attribute name="font-size">12pt</xsl:attribute>
1836
2126
 
2127
+
2128
+
1837
2129
  <fo:inline padding-right="2mm">
1838
2130
 
1839
2131
 
@@ -1841,10 +2133,11 @@
1841
2133
  <xsl:attribute name="padding-right">3mm</xsl:attribute>
1842
2134
 
1843
2135
 
1844
-
2136
+
1845
2137
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
1846
2138
 
1847
2139
  </fo:inline>
2140
+
1848
2141
  <xsl:apply-templates mode="process"/>
1849
2142
  </fo:block>
1850
2143
 
@@ -1868,6 +2161,7 @@
1868
2161
 
1869
2162
 
1870
2163
 
2164
+
1871
2165
  <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
1872
2166
 
1873
2167
  <xsl:attribute name="vertical-align">super</xsl:attribute>
@@ -1877,12 +2171,15 @@
1877
2171
 
1878
2172
 
1879
2173
 
2174
+
1880
2175
  <xsl:value-of select="@reference"/>
1881
2176
 
2177
+
1882
2178
  </fo:inline>
1883
2179
  <fo:inline>
1884
2180
 
1885
- <xsl:apply-templates/>
2181
+ <!-- <xsl:apply-templates /> -->
2182
+ <xsl:copy-of select="./node()"/>
1886
2183
  </fo:inline>
1887
2184
  </fo:block>
1888
2185
  </xsl:if>
@@ -1919,7 +2216,20 @@
1919
2216
  <xsl:variable name="following_dl_colwidths">
1920
2217
  <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
1921
2218
  <xsl:variable name="html-table">
1922
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2219
+ <xsl:variable name="doc_ns">
2220
+
2221
+ </xsl:variable>
2222
+ <xsl:variable name="ns">
2223
+ <xsl:choose>
2224
+ <xsl:when test="normalize-space($doc_ns) != ''">
2225
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2226
+ </xsl:when>
2227
+ <xsl:otherwise>
2228
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2229
+ </xsl:otherwise>
2230
+ </xsl:choose>
2231
+ </xsl:variable>
2232
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
1923
2233
  <xsl:element name="{$ns}:table">
1924
2234
  <xsl:for-each select="*[local-name() = 'dl'][1]">
1925
2235
  <tbody>
@@ -1984,7 +2294,8 @@
1984
2294
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
1985
2295
  </xsl:if>
1986
2296
 
1987
- <xsl:apply-templates/>
2297
+ <!-- <xsl:apply-templates /> -->
2298
+ <xsl:copy-of select="./node()"/>
1988
2299
  </fo:block>
1989
2300
  </fo:table-cell>
1990
2301
  </fo:table-row>
@@ -2002,9 +2313,13 @@
2002
2313
 
2003
2314
 
2004
2315
 
2316
+
2317
+
2005
2318
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
2006
2319
 
2320
+
2007
2321
  <xsl:value-of select="@reference"/>
2322
+
2008
2323
  </fo:basic-link>
2009
2324
  </fo:inline>
2010
2325
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -2012,119 +2327,162 @@
2012
2327
  <xsl:apply-templates/>
2013
2328
  </fo:inline>
2014
2329
  </xsl:template><xsl:template match="*[local-name()='dl']">
2015
- <xsl:variable name="parent" select="local-name(..)"/>
2016
-
2017
- <xsl:variable name="key_iso">
2018
- <!-- and (not(../@class) or ../@class !='pseudocode') -->
2019
- </xsl:variable>
2020
-
2021
- <xsl:choose>
2022
- <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
2330
+ <fo:block-container>
2331
+
2332
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2333
+
2334
+
2335
+ <xsl:if test="parent::*[local-name() = 'note']">
2336
+ <xsl:attribute name="margin-left">
2337
+ <xsl:choose>
2338
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
2339
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
2340
+ </xsl:choose>
2341
+ </xsl:attribute>
2023
2342
 
2343
+ </xsl:if>
2344
+ <fo:block-container>
2024
2345
 
2025
- <fo:block margin-bottom="12pt" text-align="left">
2026
-
2027
- <xsl:variable name="title-where">
2028
- <xsl:call-template name="getTitle">
2029
- <xsl:with-param name="name" select="'title-where'"/>
2030
- </xsl:call-template>
2031
- </xsl:variable>
2032
- <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2033
- <xsl:apply-templates select="*[local-name()='dt']/*"/>
2034
- <xsl:text/>
2035
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
2036
- </fo:block>
2037
-
2038
- </xsl:when>
2039
- <xsl:when test="$parent = 'formula'"> <!-- a few components -->
2040
- <fo:block margin-bottom="12pt" text-align="left">
2041
-
2042
-
2043
-
2044
-
2045
- <xsl:variable name="title-where">
2046
- <xsl:call-template name="getTitle">
2047
- <xsl:with-param name="name" select="'title-where'"/>
2048
- </xsl:call-template>
2049
- </xsl:variable>
2050
- <xsl:value-of select="$title-where"/>
2051
- </fo:block>
2052
- </xsl:when>
2053
- <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
2054
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
2055
-
2056
-
2057
-
2058
- <xsl:variable name="title-key">
2059
- <xsl:call-template name="getTitle">
2060
- <xsl:with-param name="name" select="'title-key'"/>
2061
- </xsl:call-template>
2062
- </xsl:variable>
2063
- <xsl:value-of select="$title-key"/>
2064
- </fo:block>
2065
- </xsl:when>
2066
- </xsl:choose>
2067
-
2068
- <!-- a few components -->
2069
- <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
2070
- <fo:block>
2346
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2071
2347
 
2072
2348
 
2349
+ <xsl:variable name="parent" select="local-name(..)"/>
2073
2350
 
2351
+ <xsl:variable name="key_iso">
2352
+ <!-- and (not(../@class) or ../@class !='pseudocode') -->
2353
+ </xsl:variable>
2074
2354
 
2075
- <xsl:attribute name="margin-left">7mm</xsl:attribute>
2355
+ <xsl:choose>
2356
+ <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
2357
+
2358
+
2359
+ <fo:block margin-bottom="12pt" text-align="left">
2360
+
2361
+ <xsl:variable name="title-where">
2362
+
2363
+
2364
+ <xsl:call-template name="getTitle">
2365
+ <xsl:with-param name="name" select="'title-where'"/>
2366
+ </xsl:call-template>
2367
+
2368
+ </xsl:variable>
2369
+ <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2370
+ <xsl:apply-templates select="*[local-name()='dt']/*"/>
2371
+ <xsl:text/>
2372
+ <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
2373
+ </fo:block>
2374
+
2375
+ </xsl:when>
2376
+ <xsl:when test="$parent = 'formula'"> <!-- a few components -->
2377
+ <fo:block margin-bottom="12pt" text-align="left">
2378
+
2379
+
2380
+
2381
+
2382
+ <xsl:variable name="title-where">
2383
+
2384
+
2385
+ <xsl:call-template name="getTitle">
2386
+ <xsl:with-param name="name" select="'title-where'"/>
2387
+ </xsl:call-template>
2388
+
2389
+ </xsl:variable>
2390
+ <xsl:value-of select="$title-where"/>
2391
+ </fo:block>
2392
+ </xsl:when>
2393
+ <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
2394
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
2395
+
2396
+
2397
+
2398
+ <xsl:variable name="title-key">
2399
+
2400
+
2401
+ <xsl:call-template name="getTitle">
2402
+ <xsl:with-param name="name" select="'title-key'"/>
2403
+ </xsl:call-template>
2404
+
2405
+ </xsl:variable>
2406
+ <xsl:value-of select="$title-key"/>
2407
+ </fo:block>
2408
+ </xsl:when>
2409
+ </xsl:choose>
2076
2410
 
2077
- <fo:block>
2078
-
2079
-
2080
-
2081
- <xsl:attribute name="margin-left">-3.5mm</xsl:attribute>
2082
-
2083
-
2084
- <fo:table width="95%" table-layout="fixed">
2411
+ <!-- a few components -->
2412
+ <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
2413
+ <fo:block>
2085
2414
 
2086
- <xsl:choose>
2087
- <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
2088
- <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
2089
- </xsl:when>
2090
- <xsl:when test="normalize-space($key_iso) = 'true'">
2091
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2415
+
2416
+
2417
+
2418
+ <xsl:attribute name="margin-left">7mm</xsl:attribute>
2419
+
2420
+ <fo:block>
2421
+
2422
+
2423
+
2424
+ <xsl:attribute name="margin-left">-3.5mm</xsl:attribute>
2425
+
2426
+
2427
+ <fo:table width="95%" table-layout="fixed">
2092
2428
 
2093
- </xsl:when>
2094
- </xsl:choose>
2095
- <!-- create virtual html table for dl/[dt and dd] -->
2096
- <xsl:variable name="html-table">
2097
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2098
- <xsl:element name="{$ns}:table">
2099
- <tbody>
2100
- <xsl:apply-templates mode="dl"/>
2101
- </tbody>
2102
- </xsl:element>
2103
- </xsl:variable>
2104
- <!-- html-table<xsl:copy-of select="$html-table"/> -->
2105
- <xsl:variable name="colwidths">
2106
- <xsl:call-template name="calculate-column-widths">
2107
- <xsl:with-param name="cols-count" select="2"/>
2108
- <xsl:with-param name="table" select="$html-table"/>
2109
- </xsl:call-template>
2110
- </xsl:variable>
2111
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2112
- <xsl:variable name="maxlength_dt">
2113
- <xsl:call-template name="getMaxLength_dt"/>
2114
- </xsl:variable>
2115
- <xsl:call-template name="setColumnWidth_dl">
2116
- <xsl:with-param name="colwidths" select="$colwidths"/>
2117
- <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2118
- </xsl:call-template>
2119
- <fo:table-body>
2120
- <xsl:apply-templates>
2121
- <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
2122
- </xsl:apply-templates>
2123
- </fo:table-body>
2124
- </fo:table>
2125
- </fo:block>
2126
- </fo:block>
2127
- </xsl:if>
2429
+ <xsl:choose>
2430
+ <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
2431
+ <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
2432
+ </xsl:when>
2433
+ <xsl:when test="normalize-space($key_iso) = 'true'">
2434
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2435
+
2436
+ </xsl:when>
2437
+ </xsl:choose>
2438
+ <!-- create virtual html table for dl/[dt and dd] -->
2439
+ <xsl:variable name="html-table">
2440
+ <xsl:variable name="doc_ns">
2441
+
2442
+ </xsl:variable>
2443
+ <xsl:variable name="ns">
2444
+ <xsl:choose>
2445
+ <xsl:when test="normalize-space($doc_ns) != ''">
2446
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2447
+ </xsl:when>
2448
+ <xsl:otherwise>
2449
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2450
+ </xsl:otherwise>
2451
+ </xsl:choose>
2452
+ </xsl:variable>
2453
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2454
+ <xsl:element name="{$ns}:table">
2455
+ <tbody>
2456
+ <xsl:apply-templates mode="dl"/>
2457
+ </tbody>
2458
+ </xsl:element>
2459
+ </xsl:variable>
2460
+ <!-- html-table<xsl:copy-of select="$html-table"/> -->
2461
+ <xsl:variable name="colwidths">
2462
+ <xsl:call-template name="calculate-column-widths">
2463
+ <xsl:with-param name="cols-count" select="2"/>
2464
+ <xsl:with-param name="table" select="$html-table"/>
2465
+ </xsl:call-template>
2466
+ </xsl:variable>
2467
+ <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2468
+ <xsl:variable name="maxlength_dt">
2469
+ <xsl:call-template name="getMaxLength_dt"/>
2470
+ </xsl:variable>
2471
+ <xsl:call-template name="setColumnWidth_dl">
2472
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2473
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2474
+ </xsl:call-template>
2475
+ <fo:table-body>
2476
+ <xsl:apply-templates>
2477
+ <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
2478
+ </xsl:apply-templates>
2479
+ </fo:table-body>
2480
+ </fo:table>
2481
+ </fo:block>
2482
+ </fo:block>
2483
+ </xsl:if>
2484
+ </fo:block-container>
2485
+ </fo:block-container>
2128
2486
  </xsl:template><xsl:template name="setColumnWidth_dl">
2129
2487
  <xsl:param name="colwidths"/>
2130
2488
  <xsl:param name="maxlength_dt"/>
@@ -2221,6 +2579,7 @@
2221
2579
  <xsl:param name="key_iso"/>
2222
2580
 
2223
2581
  <fo:table-row>
2582
+
2224
2583
  <fo:table-cell>
2225
2584
 
2226
2585
  <fo:block margin-top="6pt">
@@ -2238,6 +2597,7 @@
2238
2597
 
2239
2598
 
2240
2599
 
2600
+
2241
2601
  <xsl:apply-templates/>
2242
2602
  <!-- <xsl:if test="$namespace = 'gb'">
2243
2603
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -2303,6 +2663,31 @@
2303
2663
  </fo:inline>
2304
2664
  </xsl:template><xsl:template match="*[local-name()='tt']">
2305
2665
  <fo:inline xsl:use-attribute-sets="tt-style">
2666
+ <xsl:variable name="_font-size">
2667
+
2668
+
2669
+
2670
+
2671
+ 10
2672
+
2673
+
2674
+
2675
+
2676
+
2677
+
2678
+
2679
+
2680
+
2681
+ </xsl:variable>
2682
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
2683
+ <xsl:if test="$font-size != ''">
2684
+ <xsl:attribute name="font-size">
2685
+ <xsl:choose>
2686
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
2687
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
2688
+ </xsl:choose>
2689
+ </xsl:attribute>
2690
+ </xsl:if>
2306
2691
  <xsl:apply-templates/>
2307
2692
  </fo:inline>
2308
2693
  </xsl:template><xsl:template match="*[local-name()='del']">
@@ -2594,7 +2979,18 @@
2594
2979
  <xsl:with-param name="previousRow" select="$newRow"/>
2595
2980
  </xsl:apply-templates>
2596
2981
  </xsl:template><xsl:template name="getLang">
2597
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
2982
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
2983
+ <xsl:variable name="language">
2984
+ <xsl:choose>
2985
+ <xsl:when test="$language_current != ''">
2986
+ <xsl:value-of select="$language_current"/>
2987
+ </xsl:when>
2988
+ <xsl:otherwise>
2989
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
2990
+ </xsl:otherwise>
2991
+ </xsl:choose>
2992
+ </xsl:variable>
2993
+
2598
2994
  <xsl:choose>
2599
2995
  <xsl:when test="$language = 'English'">en</xsl:when>
2600
2996
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -2628,11 +3024,25 @@
2628
3024
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
2629
3025
  <xsl:value-of select="substring($str, 2)"/>
2630
3026
  </xsl:template><xsl:template match="mathml:math">
2631
- <fo:inline font-family="STIX2Math">
2632
- <fo:instream-foreign-object fox:alt-text="Math">
2633
- <xsl:copy-of select="."/>
2634
- </fo:instream-foreign-object>
3027
+ <fo:inline font-family="STIX Two Math"> <!-- -->
3028
+
3029
+ <xsl:variable name="mathml">
3030
+ <xsl:apply-templates select="." mode="mathml"/>
3031
+ </xsl:variable>
3032
+ <fo:instream-foreign-object fox:alt-text="Math">
3033
+ <!-- <xsl:copy-of select="."/> -->
3034
+ <xsl:copy-of select="xalan:nodeset($mathml)"/>
3035
+ </fo:instream-foreign-object>
2635
3036
  </fo:inline>
3037
+ </xsl:template><xsl:template match="@*|node()" mode="mathml">
3038
+ <xsl:copy>
3039
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
3040
+ </xsl:copy>
3041
+ </xsl:template><xsl:template match="mathml:mtext" mode="mathml">
3042
+ <xsl:copy>
3043
+ <!-- replace start and end spaces to non-break space -->
3044
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
3045
+ </xsl:copy>
2636
3046
  </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
2637
3047
  <xsl:variable name="target">
2638
3048
  <xsl:choose>
@@ -2698,10 +3108,14 @@
2698
3108
  </fo:inline>
2699
3109
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
2700
3110
  <xsl:variable name="title-modified">
2701
- <xsl:call-template name="getTitle">
2702
- <xsl:with-param name="name" select="'title-modified'"/>
2703
- </xsl:call-template>
3111
+
3112
+
3113
+ <xsl:call-template name="getTitle">
3114
+ <xsl:with-param name="name" select="'title-modified'"/>
3115
+ </xsl:call-template>
3116
+
2704
3117
  </xsl:variable>
3118
+
2705
3119
  <xsl:choose>
2706
3120
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
2707
3121
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -2709,13 +3123,26 @@
2709
3123
  <xsl:apply-templates/>
2710
3124
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
2711
3125
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
2712
-
3126
+
2713
3127
  <xsl:apply-templates/>
2714
3128
  </fo:basic-link>
2715
3129
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
2716
- <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
2717
- <xsl:apply-templates/>
2718
- </fo:block>
3130
+ <fo:block-container margin-left="0mm">
3131
+ <xsl:if test="parent::*[local-name() = 'note']">
3132
+ <xsl:attribute name="margin-left">
3133
+ <xsl:choose>
3134
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3135
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3136
+ </xsl:choose>
3137
+ </xsl:attribute>
3138
+
3139
+ </xsl:if>
3140
+ <fo:block-container margin-left="0mm">
3141
+ <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
3142
+ <xsl:apply-templates/>
3143
+ </fo:block>
3144
+ </fo:block-container>
3145
+ </fo:block-container>
2719
3146
  </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'dt']/*[local-name() = 'stem']">
2720
3147
  <fo:inline>
2721
3148
  <xsl:apply-templates/>
@@ -2753,6 +3180,8 @@
2753
3180
 
2754
3181
 
2755
3182
 
3183
+
3184
+
2756
3185
  <fo:inline xsl:use-attribute-sets="note-name-style">
2757
3186
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2758
3187
  </fo:inline>
@@ -2779,7 +3208,9 @@
2779
3208
  </xsl:choose>
2780
3209
  </xsl:template><xsl:template match="*[local-name() = 'termnote']">
2781
3210
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
2782
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3211
+ <fo:inline xsl:use-attribute-sets="termnote-name-style">
3212
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3213
+ </fo:inline>
2783
3214
  <xsl:apply-templates/>
2784
3215
  </fo:block>
2785
3216
  </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">
@@ -2874,15 +3305,109 @@
2874
3305
 
2875
3306
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
2876
3307
  </fo:block>
2877
- </xsl:template><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">
3308
+ </xsl:template><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">
2878
3309
  <xsl:apply-templates mode="contents"/>
2879
3310
  <xsl:text> </xsl:text>
2880
- </xsl:template><xsl:template match="text()" mode="contents">
3311
+ </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']" mode="bookmarks">
3312
+ <xsl:apply-templates mode="bookmarks"/>
3313
+ <xsl:text> </xsl:text>
3314
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
2881
3315
  <xsl:value-of select="."/>
2882
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
3316
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
3317
+ <xsl:value-of select="."/>
3318
+ </xsl:template><xsl:template match="node()" mode="contents">
3319
+ <xsl:apply-templates mode="contents"/>
3320
+ </xsl:template><xsl:template match="node()" mode="bookmarks">
3321
+ <xsl:apply-templates mode="bookmarks"/>
3322
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3323
+ <xsl:apply-templates select="."/>
3324
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3325
+ <xsl:apply-templates mode="bookmarks"/>
3326
+ </xsl:template><xsl:template name="addBookmarks">
3327
+ <xsl:param name="contents"/>
3328
+ <xsl:if test="xalan:nodeset($contents)//item">
3329
+ <fo:bookmark-tree>
3330
+ <xsl:choose>
3331
+ <xsl:when test="xalan:nodeset($contents)/doc">
3332
+ <xsl:choose>
3333
+ <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
3334
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3335
+ <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
3336
+ <fo:bookmark-title>
3337
+ <xsl:variable name="bookmark-title_">
3338
+ <xsl:call-template name="getLangVersion">
3339
+ <xsl:with-param name="lang" select="@lang"/>
3340
+ </xsl:call-template>
3341
+ </xsl:variable>
3342
+ <xsl:choose>
3343
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
3344
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
3345
+ </xsl:when>
3346
+ <xsl:otherwise>
3347
+ <xsl:choose>
3348
+ <xsl:when test="@lang = 'en'">English</xsl:when>
3349
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
3350
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3351
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3352
+ </xsl:choose>
3353
+ </xsl:otherwise>
3354
+ </xsl:choose>
3355
+ </fo:bookmark-title>
3356
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3357
+ </fo:bookmark>
3358
+
3359
+ </xsl:for-each>
3360
+ </xsl:when>
3361
+ <xsl:otherwise>
3362
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3363
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3364
+ </xsl:for-each>
3365
+ </xsl:otherwise>
3366
+ </xsl:choose>
3367
+ </xsl:when>
3368
+ <xsl:otherwise>
3369
+ <xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
3370
+ </xsl:otherwise>
3371
+ </xsl:choose>
3372
+
3373
+
3374
+
3375
+
3376
+
3377
+
3378
+
3379
+
3380
+ </fo:bookmark-tree>
3381
+ </xsl:if>
3382
+ </xsl:template><xsl:template name="getLangVersion">
3383
+ <xsl:param name="lang"/>
3384
+ <xsl:choose>
3385
+ <xsl:when test="$lang = 'en'">
3386
+
3387
+
3388
+ </xsl:when>
3389
+ <xsl:when test="$lang = 'fr'">
3390
+
3391
+
3392
+ </xsl:when>
3393
+ <xsl:when test="$lang = 'de'">Deutsche</xsl:when>
3394
+ <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
3395
+ </xsl:choose>
3396
+ </xsl:template><xsl:template match="item" mode="bookmark">
3397
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
3398
+ <fo:bookmark-title>
3399
+ <xsl:if test="@section != ''">
3400
+ <xsl:value-of select="@section"/>
3401
+ <xsl:text> </xsl:text>
3402
+ </xsl:if>
3403
+ <xsl:value-of select="normalize-space(title)"/>
3404
+ </fo:bookmark-title>
3405
+ <xsl:apply-templates mode="bookmark"/>
3406
+ </fo:bookmark>
3407
+ </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">
2883
3408
  <xsl:if test="normalize-space() != ''">
2884
3409
  <fo:block xsl:use-attribute-sets="figure-name-style">
2885
-
3410
+
2886
3411
  <xsl:apply-templates/>
2887
3412
  </fo:block>
2888
3413
  </xsl:if>
@@ -2937,7 +3462,7 @@
2937
3462
  <xsl:apply-templates/>
2938
3463
  </xsl:otherwise>
2939
3464
  </xsl:choose>
2940
- </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
3465
+ </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
2941
3466
  <xsl:text> </xsl:text>
2942
3467
  </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
2943
3468
  <xsl:copy>
@@ -2946,21 +3471,61 @@
2946
3471
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
2947
3472
  <xsl:text> </xsl:text>
2948
3473
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
2949
- <fo:block xsl:use-attribute-sets="sourcecode-style">
2950
- <xsl:apply-templates/>
2951
- </fo:block>
2952
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2953
- </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()">
3474
+
3475
+ <fo:block-container margin-left="0mm">
3476
+ <xsl:if test="parent::*[local-name() = 'note']">
3477
+ <xsl:attribute name="margin-left">
3478
+ <xsl:choose>
3479
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3480
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3481
+ </xsl:choose>
3482
+ </xsl:attribute>
3483
+
3484
+ </xsl:if>
3485
+ <fo:block-container margin-left="0mm">
3486
+
3487
+ <fo:block xsl:use-attribute-sets="sourcecode-style">
3488
+ <xsl:variable name="_font-size">
3489
+
3490
+
3491
+
3492
+
3493
+ 10
3494
+
3495
+
3496
+
3497
+
3498
+
3499
+
3500
+
3501
+
3502
+
3503
+ </xsl:variable>
3504
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
3505
+ <xsl:if test="$font-size != ''">
3506
+ <xsl:attribute name="font-size">
3507
+ <xsl:choose>
3508
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3509
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3510
+ </xsl:choose>
3511
+ </xsl:attribute>
3512
+ </xsl:if>
3513
+ <xsl:apply-templates/>
3514
+ </fo:block>
3515
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3516
+
3517
+ </fo:block-container>
3518
+ </fo:block-container>
3519
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
2954
3520
  <xsl:variable name="text">
2955
3521
  <xsl:call-template name="add-zero-spaces-equal"/>
2956
3522
  </xsl:variable>
2957
- <xsl:call-template name="add-zero-spaces">
3523
+ <xsl:call-template name="add-zero-spaces-java">
2958
3524
  <xsl:with-param name="text" select="$text"/>
2959
3525
  </xsl:call-template>
2960
3526
  </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
2961
3527
  <xsl:if test="normalize-space() != ''">
2962
- <fo:block xsl:use-attribute-sets="sourcecode-name-style">
2963
-
3528
+ <fo:block xsl:use-attribute-sets="sourcecode-name-style">
2964
3529
  <xsl:apply-templates/>
2965
3530
  </fo:block>
2966
3531
  </xsl:if>
@@ -3034,9 +3599,9 @@
3034
3599
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
3035
3600
  </xsl:if>
3036
3601
  <fo:block-container margin-left="0mm" margin-right="0mm">
3037
- <fo:table id="{@id}" table-layout="fixed" width="100%" border="1pt solid black">
3602
+ <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
3038
3603
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3039
- <xsl:attribute name="border">0.5pt solid black</xsl:attribute>
3604
+ <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
3040
3605
  </xsl:if>
3041
3606
  <xsl:variable name="simple-table">
3042
3607
  <xsl:call-template name="getSimpleTable"/>
@@ -3045,8 +3610,8 @@
3045
3610
  <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
3046
3611
  <!-- <fo:table-column column-width="35mm"/>
3047
3612
  <fo:table-column column-width="115mm"/> -->
3048
- <fo:table-column column-width="25%"/>
3049
- <fo:table-column column-width="75%"/>
3613
+ <fo:table-column column-width="30%"/>
3614
+ <fo:table-column column-width="70%"/>
3050
3615
  </xsl:if>
3051
3616
  <xsl:apply-templates mode="requirement"/>
3052
3617
  </fo:table>
@@ -3069,14 +3634,21 @@
3069
3634
  <xsl:apply-templates mode="requirement"/>
3070
3635
  </fo:table-body>
3071
3636
  </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
3072
- <fo:table-row height="7mm">
3073
- <xsl:if test="parent::*[local-name()='thead'] and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission'])">
3074
- <xsl:attribute name="border">1pt solid black</xsl:attribute>
3637
+ <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
3638
+ <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
3639
+ <!-- <xsl:attribute name="border">1pt solid black</xsl:attribute> -->
3640
+ <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
3641
+ </xsl:if>
3642
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
3643
+ <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
3644
+ </xsl:if>
3645
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
3646
+ <xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
3075
3647
  </xsl:if>
3076
3648
  <xsl:apply-templates mode="requirement"/>
3077
3649
  </fo:table-row>
3078
3650
  </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
3079
- <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm" border="0.5pt solid black">
3651
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
3080
3652
  <xsl:attribute name="text-align">
3081
3653
  <xsl:choose>
3082
3654
  <xsl:when test="@align">
@@ -3095,6 +3667,7 @@
3095
3667
  <xsl:value-of select="@rowspan"/>
3096
3668
  </xsl:attribute>
3097
3669
  </xsl:if>
3670
+ <xsl:call-template name="display-align"/>
3098
3671
 
3099
3672
  <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3100
3673
  <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
@@ -3110,7 +3683,7 @@
3110
3683
  </fo:block>
3111
3684
  </fo:table-cell>
3112
3685
  </xsl:template><xsl:template match="*[local-name()='td']" mode="requirement">
3113
- <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm" border="0.5pt solid black">
3686
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
3114
3687
  <xsl:if test="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3115
3688
  <xsl:attribute name="padding">0mm</xsl:attribute>
3116
3689
  <xsl:attribute name="padding-left">0mm</xsl:attribute>
@@ -3123,6 +3696,9 @@
3123
3696
  <xsl:otherwise>left</xsl:otherwise>
3124
3697
  </xsl:choose>
3125
3698
  </xsl:attribute>
3699
+ <xsl:if test="following-sibling::*[local-name()='td'] and not(preceding-sibling::*[local-name()='td'])">
3700
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3701
+ </xsl:if>
3126
3702
  <xsl:if test="@colspan">
3127
3703
  <xsl:attribute name="number-columns-spanned">
3128
3704
  <xsl:value-of select="@colspan"/>
@@ -3133,6 +3709,7 @@
3133
3709
  <xsl:value-of select="@rowspan"/>
3134
3710
  </xsl:attribute>
3135
3711
  </xsl:if>
3712
+ <xsl:call-template name="display-align"/>
3136
3713
 
3137
3714
  <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3138
3715
  <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
@@ -3148,7 +3725,7 @@
3148
3725
  </fo:block>
3149
3726
  </fo:table-cell>
3150
3727
  </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
3151
- <fo:block font-size="11pt" font-weight="bold"> <!-- margin-bottom="4pt" text-align="center" -->
3728
+ <fo:block font-size="11pt" color="rgb(237, 193, 35)"> <!-- font-weight="bold" margin-bottom="4pt" text-align="center" -->
3152
3729
  <xsl:apply-templates/>
3153
3730
  </fo:block>
3154
3731
  </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
@@ -3174,12 +3751,13 @@
3174
3751
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3175
3752
 
3176
3753
  <xsl:variable name="element">
3177
- block
3754
+ block
3178
3755
 
3756
+ <xsl:if test=".//*[local-name() = 'table']">block</xsl:if>
3179
3757
  </xsl:variable>
3180
3758
 
3181
3759
  <xsl:choose>
3182
- <xsl:when test="normalize-space($element) = 'block'">
3760
+ <xsl:when test="contains(normalize-space($element), 'block')">
3183
3761
  <fo:block xsl:use-attribute-sets="example-body-style">
3184
3762
  <xsl:apply-templates/>
3185
3763
  </fo:block>
@@ -3216,25 +3794,44 @@
3216
3794
  </xsl:otherwise>
3217
3795
  </xsl:choose>
3218
3796
 
3219
- </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3220
- <fo:block xsl:use-attribute-sets="example-p-style">
3797
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3798
+
3799
+ <xsl:variable name="element">
3800
+ block
3221
3801
 
3222
- <xsl:apply-templates/>
3223
- </fo:block>
3802
+ </xsl:variable>
3803
+ <xsl:choose>
3804
+ <xsl:when test="normalize-space($element) = 'block'">
3805
+ <fo:block xsl:use-attribute-sets="example-p-style">
3806
+
3807
+ <xsl:apply-templates/>
3808
+ </fo:block>
3809
+ </xsl:when>
3810
+ <xsl:otherwise>
3811
+ <fo:inline xsl:use-attribute-sets="example-p-style">
3812
+ <xsl:apply-templates/>
3813
+ </fo:inline>
3814
+ </xsl:otherwise>
3815
+ </xsl:choose>
3224
3816
  </xsl:template><xsl:template match="*[local-name() = 'termsource']">
3225
3817
  <fo:block xsl:use-attribute-sets="termsource-style">
3226
3818
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
3227
3819
  <xsl:variable name="termsource_text">
3228
3820
  <xsl:apply-templates/>
3229
3821
  </xsl:variable>
3822
+
3230
3823
  <xsl:choose>
3231
3824
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
3232
3825
  <xsl:apply-templates/>
3233
3826
  </xsl:when>
3234
- <xsl:otherwise>
3235
- <xsl:text>[</xsl:text>
3236
- <xsl:apply-templates/>
3237
- <xsl:text>]</xsl:text>
3827
+ <xsl:otherwise>
3828
+
3829
+ <xsl:text>[</xsl:text>
3830
+
3831
+ <xsl:apply-templates/>
3832
+
3833
+ <xsl:text>]</xsl:text>
3834
+
3238
3835
  </xsl:otherwise>
3239
3836
  </xsl:choose>
3240
3837
  </fo:block>
@@ -3245,10 +3842,18 @@
3245
3842
  </xsl:template><xsl:template match="*[local-name() = 'origin']">
3246
3843
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
3247
3844
 
3248
- <xsl:call-template name="getTitle">
3249
- <xsl:with-param name="name" select="'title-source'"/>
3250
- </xsl:call-template>
3251
- <xsl:text>: </xsl:text>
3845
+ <fo:inline>
3846
+
3847
+
3848
+
3849
+
3850
+ <xsl:call-template name="getTitle">
3851
+ <xsl:with-param name="name" select="'title-source'"/>
3852
+ </xsl:call-template>
3853
+
3854
+
3855
+ <xsl:text>: </xsl:text>
3856
+ </fo:inline>
3252
3857
 
3253
3858
  <fo:inline xsl:use-attribute-sets="origin-style">
3254
3859
  <xsl:apply-templates/>
@@ -3260,18 +3865,29 @@
3260
3865
  <xsl:if test="normalize-space() != ''">
3261
3866
  <xsl:value-of select="."/>
3262
3867
  </xsl:if>
3263
- </xsl:template><xsl:template match="*[local-name() = 'quote']">
3868
+ </xsl:template><xsl:template match="*[local-name() = 'quote']">
3869
+ <fo:block-container margin-left="0mm">
3870
+ <xsl:if test="parent::*[local-name() = 'note']">
3871
+ <xsl:if test="not(ancestor::*[local-name() = 'table'])">
3872
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
3873
+ </xsl:if>
3874
+ </xsl:if>
3875
+
3876
+ <fo:block-container margin-left="0mm">
3264
3877
 
3265
- <fo:block xsl:use-attribute-sets="quote-style">
3266
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3267
- </fo:block>
3268
- <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3269
- <fo:block xsl:use-attribute-sets="quote-source-style">
3270
- <!-- — ISO, ISO 7301:2011, Clause 1 -->
3271
- <xsl:apply-templates select="*[local-name() = 'author']"/>
3272
- <xsl:apply-templates select="*[local-name() = 'source']"/>
3273
- </fo:block>
3274
- </xsl:if>
3878
+ <fo:block xsl:use-attribute-sets="quote-style">
3879
+ <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3880
+ </fo:block>
3881
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3882
+ <fo:block xsl:use-attribute-sets="quote-source-style">
3883
+ <!-- — ISO, ISO 7301:2011, Clause 1 -->
3884
+ <xsl:apply-templates select="*[local-name() = 'author']"/>
3885
+ <xsl:apply-templates select="*[local-name() = 'source']"/>
3886
+ </fo:block>
3887
+ </xsl:if>
3888
+
3889
+ </fo:block-container>
3890
+ </fo:block-container>
3275
3891
  </xsl:template><xsl:template match="*[local-name() = 'source']">
3276
3892
  <xsl:if test="../*[local-name() = 'author']">
3277
3893
  <xsl:text>, </xsl:text>
@@ -3302,6 +3918,7 @@
3302
3918
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
3303
3919
 
3304
3920
 
3921
+
3305
3922
  </xsl:if>
3306
3923
 
3307
3924
 
@@ -3340,6 +3957,7 @@
3340
3957
 
3341
3958
 
3342
3959
 
3960
+
3343
3961
  </xsl:variable>
3344
3962
 
3345
3963
  <xsl:variable name="padding-right">
@@ -3386,9 +4004,12 @@
3386
4004
  </fo:block>
3387
4005
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
3388
4006
  <xsl:variable name="title-deprecated">
3389
- <xsl:call-template name="getTitle">
3390
- <xsl:with-param name="name" select="'title-deprecated'"/>
3391
- </xsl:call-template>
4007
+
4008
+
4009
+ <xsl:call-template name="getTitle">
4010
+ <xsl:with-param name="name" select="'title-deprecated'"/>
4011
+ </xsl:call-template>
4012
+
3392
4013
  </xsl:variable>
3393
4014
  <fo:block xsl:use-attribute-sets="deprecates-style">
3394
4015
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -3430,6 +4051,7 @@
3430
4051
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
3431
4052
  <fo:block>
3432
4053
  <xsl:call-template name="setId"/>
4054
+
3433
4055
  <xsl:apply-templates/>
3434
4056
  </fo:block>
3435
4057
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
@@ -3454,6 +4076,31 @@
3454
4076
  </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
3455
4077
  <!-- 0xA0 to space replacement -->
3456
4078
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
4079
+ </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
4080
+ <xsl:choose>
4081
+ <xsl:when test="parent::*[local-name() = 'note']">
4082
+ <fo:block-container>
4083
+ <xsl:attribute name="margin-left">
4084
+ <xsl:choose>
4085
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
4086
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
4087
+ </xsl:choose>
4088
+ </xsl:attribute>
4089
+
4090
+
4091
+ <fo:block-container margin-left="0mm">
4092
+ <fo:block>
4093
+ <xsl:apply-templates select="." mode="ul_ol"/>
4094
+ </fo:block>
4095
+ </fo:block-container>
4096
+ </fo:block-container>
4097
+ </xsl:when>
4098
+ <xsl:otherwise>
4099
+ <fo:block>
4100
+ <xsl:apply-templates select="." mode="ul_ol"/>
4101
+ </fo:block>
4102
+ </xsl:otherwise>
4103
+ </xsl:choose>
3457
4104
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
3458
4105
  <!-- <row>
3459
4106
  <date>05-07-2013</date>
@@ -3486,7 +4133,127 @@
3486
4133
  <fo:block><xsl:apply-templates/></fo:block>
3487
4134
  </fo:table-cell>
3488
4135
  </xsl:template><xsl:template name="processBibitem">
4136
+
4137
+
4138
+
3489
4139
 
4140
+ <!-- start IHO bibtem processing -->
4141
+ <xsl:choose>
4142
+ <xsl:when test="iho:formattedref">
4143
+ <xsl:apply-templates select="iho:formattedref"/>
4144
+ </xsl:when>
4145
+ <xsl:otherwise>
4146
+ <xsl:choose>
4147
+ <!-- IHO documents -->
4148
+ <!-- {docID} edition {edition}: {title}, {author/organization} -->
4149
+ <xsl:when test="iho:docidentifier[1]/@type='IHO'">
4150
+ <xsl:value-of select="iho:docidentifier[1]"/>
4151
+ <xsl:apply-templates select="iho:edition"/>
4152
+ <xsl:if test="iho:title or iho:contributor or iho:url">
4153
+ <xsl:text>: </xsl:text>
4154
+ </xsl:if>
4155
+ </xsl:when>
4156
+
4157
+ <!-- Non-IHO documents -->
4158
+ <!-- title and publisher -->
4159
+ <xsl:otherwise>
4160
+ <xsl:variable name="docID">
4161
+ <xsl:call-template name="processBibitemDocId"/>
4162
+ </xsl:variable>
4163
+ <xsl:value-of select="normalize-space($docID)"/>
4164
+ <xsl:if test="normalize-space($docID) != ''"><xsl:text>: </xsl:text></xsl:if>
4165
+ </xsl:otherwise>
4166
+ </xsl:choose>
4167
+
4168
+ <xsl:choose>
4169
+ <xsl:when test="iho:title[@type = 'main' and @language = 'en']">
4170
+ <xsl:apply-templates select="iho:title[@type = 'main' and @language = 'en']"/>
4171
+ </xsl:when>
4172
+ <xsl:otherwise>
4173
+ <xsl:apply-templates select="iho:title"/>
4174
+ </xsl:otherwise>
4175
+ </xsl:choose>
4176
+
4177
+ <xsl:if test="iho:title and iho:contributor">
4178
+ <xsl:text>, </xsl:text>
4179
+ </xsl:if>
4180
+
4181
+ <xsl:variable name="authors">
4182
+ <xsl:choose>
4183
+ <xsl:when test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
4184
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']">
4185
+ <xsl:copy-of select="."/>
4186
+ </xsl:for-each>
4187
+ </xsl:when>
4188
+ <xsl:when test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='editor']">
4189
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='editor']">
4190
+ <xsl:copy-of select="."/>
4191
+ </xsl:for-each>
4192
+ </xsl:when>
4193
+ <xsl:when test="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='publisher'][*[local-name() = 'organization']]">
4194
+ <xsl:for-each select="*[local-name() = 'contributor'][*[local-name() = 'role']/@type='publisher'][*[local-name() = 'organization']]">
4195
+ <xsl:copy>
4196
+ <xsl:choose>
4197
+ <xsl:when test="position() != 1 and position() != last()">, </xsl:when>
4198
+ <xsl:when test="position() != 1 and position() = last()"> and </xsl:when>
4199
+ </xsl:choose>
4200
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
4201
+ </xsl:copy>
4202
+ </xsl:for-each>
4203
+ </xsl:when>
4204
+ </xsl:choose>
4205
+ </xsl:variable>
4206
+
4207
+ <xsl:for-each select="xalan:nodeset($authors)/*">
4208
+ <xsl:choose>
4209
+ <xsl:when test="not(*[local-name() = 'role'])"><!-- publisher organisation -->
4210
+ <xsl:value-of select="."/>
4211
+ </xsl:when>
4212
+ <xsl:otherwise> <!-- author, editor -->
4213
+ <xsl:choose>
4214
+ <xsl:when test="*[local-name() = 'organization']/*[local-name() = 'name']">
4215
+ <xsl:value-of select="*[local-name() = 'organization']/*[local-name() = 'name']"/>
4216
+ </xsl:when>
4217
+ <xsl:otherwise>
4218
+ <xsl:for-each select="*[local-name() = 'person']">
4219
+ <xsl:variable name="author">
4220
+ <xsl:call-template name="processPersonalAuthor"/>
4221
+ </xsl:variable>
4222
+ <xsl:value-of select="xalan:nodeset($author)/author"/>
4223
+ </xsl:for-each>
4224
+ </xsl:otherwise>
4225
+ </xsl:choose>
4226
+ </xsl:otherwise>
4227
+ </xsl:choose>
4228
+ <xsl:if test="*[local-name() = 'organization']/*[local-name() = 'name'] and position() != last()">
4229
+ <xsl:text>, </xsl:text>
4230
+ </xsl:if>
4231
+ </xsl:for-each>
4232
+
4233
+ <xsl:apply-templates select="*[local-name() = 'uri'][1]"/>
4234
+
4235
+ </xsl:otherwise>
4236
+ </xsl:choose>
4237
+ <!-- end IHO bibitem processing -->
4238
+
4239
+ </xsl:template><xsl:template name="processBibitemDocId">
4240
+ <xsl:variable name="_doc_ident" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]"/>
4241
+ <xsl:choose>
4242
+ <xsl:when test="normalize-space($_doc_ident) != ''">
4243
+ <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or @type = 'ISBN' or @type = 'rfc-anchor')]/@type"/>
4244
+ <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
4245
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
4246
+ </xsl:if>
4247
+ <xsl:value-of select="$_doc_ident"/>
4248
+ </xsl:when>
4249
+ <xsl:otherwise>
4250
+ <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
4251
+ <xsl:if test="$type != ''">
4252
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
4253
+ </xsl:if>
4254
+ <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
4255
+ </xsl:otherwise>
4256
+ </xsl:choose>
3490
4257
  </xsl:template><xsl:template name="processPersonalAuthor">
3491
4258
  <xsl:choose>
3492
4259
  <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
@@ -3601,6 +4368,7 @@
3601
4368
  <dc:title>
3602
4369
  <xsl:variable name="title">
3603
4370
 
4371
+
3604
4372
 
3605
4373
  <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en']"/>
3606
4374
 
@@ -3621,6 +4389,7 @@
3621
4389
  <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'organization']/*[local-name() = 'name']"/>
3622
4390
 
3623
4391
 
4392
+
3624
4393
  </dc:creator>
3625
4394
  <dc:description>
3626
4395
  <xsl:variable name="abstract">
@@ -3630,6 +4399,7 @@
3630
4399
 
3631
4400
 
3632
4401
 
4402
+
3633
4403
  </xsl:variable>
3634
4404
  <xsl:value-of select="normalize-space($abstract)"/>
3635
4405
  </dc:description>
@@ -3701,13 +4471,22 @@
3701
4471
  </xsl:template><xsl:template name="split">
3702
4472
  <xsl:param name="pText" select="."/>
3703
4473
  <xsl:param name="sep" select="','"/>
4474
+ <xsl:param name="normalize-space" select="'true'"/>
3704
4475
  <xsl:if test="string-length($pText) &gt;0">
3705
4476
  <item>
3706
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
4477
+ <xsl:choose>
4478
+ <xsl:when test="$normalize-space = 'true'">
4479
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
4480
+ </xsl:when>
4481
+ <xsl:otherwise>
4482
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
4483
+ </xsl:otherwise>
4484
+ </xsl:choose>
3707
4485
  </item>
3708
4486
  <xsl:call-template name="split">
3709
4487
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
3710
4488
  <xsl:with-param name="sep" select="$sep"/>
4489
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
3711
4490
  </xsl:call-template>
3712
4491
  </xsl:if>
3713
4492
  </xsl:template><xsl:template name="getDocumentId">
@@ -3730,6 +4509,7 @@
3730
4509
 
3731
4510
 
3732
4511
 
4512
+
3733
4513
  </xsl:variable>
3734
4514
  <xsl:if test="$documentNS != $XSLNS">
3735
4515
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -3755,4 +4535,40 @@
3755
4535
  </xsl:otherwise>
3756
4536
  </xsl:choose>
3757
4537
  </xsl:attribute>
4538
+ </xsl:template><xsl:template name="add-letter-spacing">
4539
+ <xsl:param name="text"/>
4540
+ <xsl:param name="letter-spacing" select="'0.15'"/>
4541
+ <xsl:if test="string-length($text) &gt; 0">
4542
+ <xsl:variable name="char" select="substring($text, 1, 1)"/>
4543
+ <fo:inline padding-right="{$letter-spacing}mm">
4544
+ <xsl:if test="$char = '®'">
4545
+ <xsl:attribute name="font-size">58%</xsl:attribute>
4546
+ <xsl:attribute name="baseline-shift">30%</xsl:attribute>
4547
+ </xsl:if>
4548
+ <xsl:value-of select="$char"/>
4549
+ </fo:inline>
4550
+ <xsl:call-template name="add-letter-spacing">
4551
+ <xsl:with-param name="text" select="substring($text, 2)"/>
4552
+ <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4553
+ </xsl:call-template>
4554
+ </xsl:if>
4555
+ </xsl:template><xsl:template name="repeat">
4556
+ <xsl:param name="char" select="'*'"/>
4557
+ <xsl:param name="count"/>
4558
+ <xsl:if test="$count &gt; 0">
4559
+ <xsl:value-of select="$char"/>
4560
+ <xsl:call-template name="repeat">
4561
+ <xsl:with-param name="char" select="$char"/>
4562
+ <xsl:with-param name="count" select="$count - 1"/>
4563
+ </xsl:call-template>
4564
+ </xsl:if>
4565
+ </xsl:template><xsl:template name="getLocalizedString">
4566
+ <xsl:param name="key"/>
4567
+
4568
+ <xsl:variable name="curr_lang">
4569
+ <xsl:call-template name="getLang"/>
4570
+ </xsl:variable>
4571
+
4572
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
4573
+
3758
4574
  </xsl:template></xsl:stylesheet>