metanorma-m3aawg 1.5.1 → 1.5.6

Sign up to get free protection for your applications and to get access to all the features.
@@ -23,7 +23,7 @@ fieldset, form, label, legend,
23
23
  table, caption, tbody, tfoot, thead, tr, th, td,
24
24
  article, aside, canvas, details, embed,
25
25
  figure, figcaption, footer, header, hgroup,
26
- menu, nav, output, ruby, section, summary,
26
+ menu, output, ruby, section, summary,
27
27
  time, mark, audio, video {
28
28
  margin: 0;
29
29
  padding: 0; }
@@ -118,6 +118,10 @@ b, strong {
118
118
  div.document-stage-band, div.document-type-band {
119
119
  background-color: #333333; }
120
120
 
121
+ a.FootnoteRef + a.FootnoteRef:before {
122
+ content: ", ";
123
+ vertical-align: super; }
124
+
121
125
  #standard-band {
122
126
  background-color: #0AC442; }
123
127
 
@@ -238,6 +242,9 @@ body {
238
242
  main {
239
243
  margin: 0 3em 0 6em; }
240
244
 
245
+ div.colophon {
246
+ margin: 0 3em 0 6em; }
247
+
241
248
  #toc {
242
249
  font-family: {{bodyfont}};
243
250
  font-weight: 400; }
@@ -28,6 +28,9 @@ body {
28
28
  main {
29
29
  margin: 0 3em 0 6em;
30
30
  }
31
+ div.colophon {
32
+ margin: 0 3em 0 6em;
33
+ }
31
34
 
32
35
  #toc {
33
36
  @include toc(#69C5DC, #69C5DC, #69C5DC);
@@ -562,7 +562,7 @@ table.dl {
562
562
  margin-bottom: 11.0pt;
563
563
  margin-left: 20.15pt; }
564
564
 
565
- table.MsoISOTable {
565
+ table.MsoISOTable, table.MsoISOTableBig {
566
566
  mso-style-name: "Table ISO";
567
567
  mso-tstyle-rowband-size: 0;
568
568
  mso-tstyle-colband-size: 0;
@@ -583,17 +583,17 @@ table.MsoISOTable {
583
583
  font-size: 10.0pt;
584
584
  font-family: {{bodyfont}}; }
585
585
 
586
- table.MsoISOTable th {
586
+ table.MsoISOTable th, table.MsoISOTableBig th {
587
587
  border: solid windowtext 1pt;
588
588
  mso-border-alt: solid windowtext 1pt;
589
589
  padding: 0cm 2.85pt 0cm 2.85pt; }
590
590
 
591
- table.MsoISOTable td {
591
+ table.MsoISOTable td, table.MsoISOTableBig td {
592
592
  border: solid windowtext 1pt;
593
593
  mso-border-alt: solid windowtext 1pt;
594
594
  padding: 0cm 2.85pt 0cm 2.85pt; }
595
595
 
596
- table.MsoISOTable p {
596
+ table.MsoISOTable p, table.MsoISOTableBig p {
597
597
  font-size: 10.0pt; }
598
598
 
599
599
  table.MsoTableGrid {
@@ -751,8 +751,20 @@ div.example p.MsoListParagraph {
751
751
  font-size: 10.0pt; }
752
752
 
753
753
  div.Note p.MsoListParagraph {
754
+ font-size: 10.0pt;
755
+ margin-left: 1.0cm; }
756
+
757
+ div.Note span.stem {
754
758
  font-size: 10.0pt; }
755
759
 
760
+ div.Note p.Sourcecode, div.Note pre.Sourcecode {
761
+ font-size: 8.0pt;
762
+ margin-left: 1.0cm; }
763
+
764
+ div.Note table.dl {
765
+ font-size: 10.0pt;
766
+ margin-left: 1.0cm; }
767
+
756
768
  span.note_label, span.example_label, td.example_label, td.note_label {
757
769
  font-size: 10.0pt;
758
770
  font-family: {{bodyfont}}; }
@@ -534,7 +534,7 @@ table.dl
534
534
  margin-right:0cm;
535
535
  margin-bottom:11.0pt;
536
536
  margin-left:20.15pt;}
537
- table.MsoISOTable
537
+ table.MsoISOTable, table.MsoISOTableBig
538
538
  {mso-style-name:"Table ISO";
539
539
  mso-tstyle-rowband-size:0;
540
540
  mso-tstyle-colband-size:0;
@@ -554,15 +554,15 @@ table.MsoISOTable
554
554
  mso-border-insidev:.75pt solid windowtext;
555
555
  font-size:10.0pt;
556
556
  font-family:$bodyfont;}
557
- table.MsoISOTable th
557
+ table.MsoISOTable th, table.MsoISOTableBig th
558
558
  {border:solid windowtext 1pt;
559
559
  mso-border-alt:solid windowtext 1pt;
560
560
  padding:0cm 2.85pt 0cm 2.85pt;}
561
- table.MsoISOTable td
561
+ table.MsoISOTable td, table.MsoISOTableBig td
562
562
  {border:solid windowtext 1pt;
563
563
  mso-border-alt:solid windowtext 1pt;
564
564
  padding:0cm 2.85pt 0cm 2.85pt;}
565
- table.MsoISOTable p
565
+ table.MsoISOTable p, table.MsoISOTableBig p
566
566
  {font-size:10.0pt; }
567
567
  table.MsoTableGrid
568
568
  {mso-style-name:"Table Grid";
@@ -733,6 +733,20 @@ div.example p.MsoListParagraph {
733
733
 
734
734
  div.Note p.MsoListParagraph {
735
735
  font-size: 10.0pt;
736
+ margin-left: 1.0cm;
737
+ }
738
+
739
+ div.Note span.stem {
740
+ font-size: 10.0pt; }
741
+
742
+ div.Note p.Sourcecode, div.Note pre.Sourcecode {
743
+ font-size: 8.0pt;
744
+ margin-left: 1.0cm;
745
+ }
746
+
747
+ div.Note table.dl {
748
+ font-size: 10.0pt;
749
+ margin-left: 1.0cm;
736
750
  }
737
751
 
738
752
  span.note_label, span.example_label, td.example_label, td.note_label
@@ -1,7 +1,9 @@
1
1
  <div class="coverpage">
2
2
  <p class="zzSTDPreTitle">Messaging, Malware and Mobile Anti-Abuse Working Group</p>
3
3
  <p class="zzSTDTitle1">{{doctitle}}</p>
4
- <p><b>{{revdate_monthyear}}</b></p>
4
+ {% if edition %}<p><b>Version {{edition}}</b></p>{% endif %}
5
+ {% if revdate_monthyear %}<p><b>{{revdate_monthyear}}</b></p>{% endif %}
6
+ {% if url %}<p align='center' style="margin-top:12pt;">The direct URL to this paper is: <a href="{{url}}">{{url}}</a></p>{% endif %}
5
7
  </div>
6
8
 
7
9
 
@@ -26,6 +26,12 @@ lang="EN-GB" style='font-size:40.0pt'>{% if unpublished %}{{ stage }}{% endif %}
26
26
 
27
27
  </div>
28
28
 
29
+ {% if url %}
30
+ <p class="MsoNormal" align="center" style='text-align:center'><span
31
+ lang="EN-GB" style='font-size:12.0pt'>The direct URL to this paper is: <a href='{{url}}'>{{url}}</a></span></p>
32
+ {% endif %}
33
+
34
+
29
35
  <p class="MsoNormal" style='margin-bottom:6.0pt'><span lang="EN-GB"><o:p>&nbsp;</o:p></span></p>
30
36
 
31
37
  {% if unpublished %}
@@ -14,8 +14,10 @@ module IsoDoc
14
14
 
15
15
  def default_fonts(options)
16
16
  {
17
- bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' : '"Overpass",sans-serif'),
18
- headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' : '"Overpass",sans-serif'),
17
+ bodyfont: (options[:script] == "Hans" ? '"SimSun",serif' :
18
+ '"Overpass",sans-serif'),
19
+ headerfont: (options[:script] == "Hans" ? '"SimHei",sans-serif' :
20
+ '"Overpass",sans-serif'),
19
21
  monospacefont: '"Space Mono",monospace'
20
22
  }
21
23
  end
@@ -33,9 +35,12 @@ module IsoDoc
33
35
  def colophon(body, docxml)
34
36
  body.div **{ class: "colophon" } do |div|
35
37
  div << <<~"COLOPHON"
36
- <p>As with all M3AAWG documents that we publish, please check the M3AAWG website
37
- (<a href="http://www.m3aawg.org">www.m3aawg.org</a>) for updates to this paper.</p>
38
- <p>&copy; {{ docyear }} copyright by the Messaging, Malware and Mobile Anti-Abuse Working Group (M3AAWG)</p>
38
+ <p>As with all M<sup>3</sup>AAWG documents that we publish,
39
+ please check the M<sup>3</sup>AAWG website
40
+ (<a href="http://www.m3aawg.org">www.m3aawg.org</a>) for updates to
41
+ this paper.</p>
42
+ <p>&copy; #{@meta.get[:docyear]} copyright by the Messaging, Malware
43
+ and Mobile Anti-Abuse Working Group (M<sup>3</sup>AAWG)</p>
39
44
  COLOPHON
40
45
  end
41
46
  end
@@ -48,7 +53,8 @@ module IsoDoc
48
53
  end
49
54
 
50
55
  def make_body(xml, docxml)
51
- body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72", "xml:lang": "EN-US", class: "container" }
56
+ body_attr = { lang: "EN-US", link: "blue", vlink: "#954F72",
57
+ "xml:lang": "EN-US", class: "container" }
52
58
  xml.body **body_attr do |body|
53
59
  make_body1(body, docxml)
54
60
  make_body2(body, docxml)
@@ -75,6 +75,10 @@
75
75
 
76
76
  <xsl:call-template name="addPDFUAmeta"/>
77
77
 
78
+ <xsl:call-template name="addBookmarks">
79
+ <xsl:with-param name="contents" select="$contents"/>
80
+ </xsl:call-template>
81
+
78
82
  <fo:page-sequence master-reference="document" force-page-count="no-force">
79
83
 
80
84
  <fo:static-content flow-name="cover-header">
@@ -218,17 +222,17 @@
218
222
  <fo:table-column column-width="25mm"/>
219
223
  <fo:table-column column-width="155mm"/>
220
224
  <fo:table-body>
221
- <xsl:for-each select="xalan:nodeset($contents)//item"><!-- [@display = 'true'][not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
225
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
222
226
  <fo:table-row height="6mm">
223
227
  <fo:table-cell>
224
228
  <fo:block font-weight="bold">
225
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
229
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
226
230
  <xsl:choose>
227
231
  <xsl:when test="@section = ''">
228
- <xsl:apply-templates/>
232
+ <xsl:apply-templates select="title"/>
229
233
  </xsl:when>
230
234
  <xsl:when test="@type = 'references' and @section = ''">
231
- <xsl:apply-templates/>
235
+ <xsl:apply-templates select="title"/>
232
236
  </xsl:when>
233
237
  <xsl:when test="@level = 1">
234
238
  <xsl:value-of select="@section"/>
@@ -243,12 +247,12 @@
243
247
  <xsl:if test="@level = 1">
244
248
  <xsl:attribute name="font-weight">bold</xsl:attribute>
245
249
  </xsl:if>
246
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
250
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
247
251
  <xsl:choose>
248
252
  <xsl:when test="@section = ''"/>
249
253
  <xsl:when test="@type = 'references' and @section = ''"/>
250
254
  <xsl:otherwise>
251
- <xsl:apply-templates/>
255
+ <xsl:apply-templates select="title"/>
252
256
  </xsl:otherwise>
253
257
  </xsl:choose>
254
258
 
@@ -314,9 +318,7 @@
314
318
  </xsl:variable>
315
319
 
316
320
  <xsl:variable name="display">
317
- <xsl:choose>
318
- <xsl:when test="ancestor-or-self::m3d:bibitem">false</xsl:when>
319
- <xsl:when test="ancestor-or-self::m3d:term">false</xsl:when>
321
+ <xsl:choose>
320
322
  <xsl:when test="ancestor-or-self::m3d:preface and $level &gt;= 2">false</xsl:when>
321
323
  <xsl:when test="ancestor::m3d:annex and $level &gt;= 3">false</xsl:when>
322
324
  <xsl:when test="$level &lt;= 3">true</xsl:when>
@@ -324,8 +326,15 @@
324
326
  </xsl:choose>
325
327
  </xsl:variable>
326
328
 
329
+ <xsl:variable name="skip">
330
+ <xsl:choose>
331
+ <xsl:when test="ancestor-or-self::m3d:bibitem">true</xsl:when>
332
+ <xsl:when test="ancestor-or-self::m3d:term">true</xsl:when>
333
+ <xsl:otherwise>false</xsl:otherwise>
334
+ </xsl:choose>
335
+ </xsl:variable>
327
336
 
328
- <xsl:if test="$display = 'true'">
337
+ <xsl:if test="$skip = 'false'">
329
338
 
330
339
  <xsl:variable name="section">
331
340
  <xsl:call-template name="getSection"/>
@@ -339,12 +348,13 @@
339
348
  <xsl:value-of select="local-name()"/>
340
349
  </xsl:variable>
341
350
 
342
- <item id="{@id}" level="{$level}" section="{$section}" type="{$type}">
343
- <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
351
+ <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" display="{$display}">
352
+ <title>
353
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
354
+ </title>
355
+ <xsl:apply-templates mode="contents"/>
344
356
  </item>
345
- <xsl:apply-templates mode="contents"/>
346
357
  </xsl:if>
347
-
348
358
  </xsl:template>
349
359
 
350
360
 
@@ -635,7 +645,7 @@
635
645
 
636
646
 
637
647
 
638
- <xsl:template match="m3d:ul | m3d:ol">
648
+ <xsl:template match="m3d:ul | m3d:ol" mode="ul_ol">
639
649
  <fo:block-container margin-left="6mm">
640
650
  <fo:block-container margin-left="0mm">
641
651
  <fo:list-block margin-bottom="12pt" provisional-distance-between-starts="6mm"> <!-- margin-bottom="8pt" -->
@@ -673,7 +683,9 @@
673
683
  </fo:list-item>
674
684
  </xsl:template>
675
685
 
676
-
686
+ <xsl:template match="m3d:note" mode="process">
687
+ <xsl:call-template name="note"/>
688
+ </xsl:template>
677
689
 
678
690
  <xsl:template match="m3d:preferred">
679
691
 
@@ -777,8 +789,12 @@
777
789
 
778
790
  <xsl:template match="mathml:math" priority="2">
779
791
  <fo:inline font-family="Cambria Math">
792
+ <xsl:variable name="mathml">
793
+ <xsl:apply-templates select="." mode="mathml"/>
794
+ </xsl:variable>
780
795
  <fo:instream-foreign-object fox:alt-text="Math">
781
- <xsl:copy-of select="."/>
796
+ <!-- <xsl:copy-of select="."/> -->
797
+ <xsl:copy-of select="xalan:nodeset($mathml)"/>
782
798
  </fo:instream-foreign-object>
783
799
  </fo:inline>
784
800
  </xsl:template>
@@ -811,9 +827,9 @@
811
827
 
812
828
  <xsl:template match="m3d:formula/m3d:stem">
813
829
  <fo:block margin-top="14pt" margin-bottom="14pt">
814
- <fo:table table-layout="fixed" width="170mm">
815
- <fo:table-column column-width="165mm"/>
816
- <fo:table-column column-width="5mm"/>
830
+ <fo:table table-layout="fixed" width="100%"> <!-- 170mm -->
831
+ <fo:table-column column-width="95%"/> <!-- 165mm -->
832
+ <fo:table-column column-width="5%"/> <!-- 5mm -->
817
833
  <fo:table-body>
818
834
  <fo:table-row>
819
835
  <fo:table-cell display-align="center">
@@ -853,6 +869,12 @@
853
869
 
854
870
  </title-edition>
855
871
 
872
+ <title-edition lang="fr">
873
+
874
+ <xsl:text>Édition </xsl:text>
875
+
876
+ </title-edition>
877
+
856
878
 
857
879
  <title-toc lang="en">
858
880
 
@@ -861,7 +883,12 @@
861
883
 
862
884
 
863
885
  </title-toc>
864
- <title-toc lang="fr">Sommaire</title-toc>
886
+ <title-toc lang="fr">
887
+
888
+ <xsl:text>Sommaire</xsl:text>
889
+
890
+
891
+ </title-toc>
865
892
 
866
893
  <title-toc lang="zh">Contents</title-toc>
867
894
 
@@ -895,7 +922,12 @@
895
922
 
896
923
 
897
924
 
898
- <title-source lang="en">SOURCE</title-source>
925
+ <title-source lang="en">
926
+
927
+ <xsl:text>SOURCE</xsl:text>
928
+
929
+
930
+ </title-source>
899
931
 
900
932
  <title-keywords lang="en">Keywords</title-keywords>
901
933
 
@@ -938,12 +970,25 @@
938
970
  <title-warning lang="zh">警告</title-warning>
939
971
 
940
972
  <title-amendment lang="en">AMENDMENT</title-amendment>
973
+
974
+ <title-continued lang="en">(continued)</title-continued>
975
+ <title-continued lang="fr">(continué)</title-continued>
976
+
941
977
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
942
978
  <xsl:param name="name"/>
943
- <xsl:variable name="lang">
944
- <xsl:call-template name="getLang"/>
979
+ <xsl:param name="lang"/>
980
+ <xsl:variable name="lang_">
981
+ <xsl:choose>
982
+ <xsl:when test="$lang != ''">
983
+ <xsl:value-of select="$lang"/>
984
+ </xsl:when>
985
+ <xsl:otherwise>
986
+ <xsl:call-template name="getLang"/>
987
+ </xsl:otherwise>
988
+ </xsl:choose>
945
989
  </xsl:variable>
946
- <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/>
990
+ <xsl:variable name="language" select="normalize-space($lang_)"/>
991
+ <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $language]"/>
947
992
  <xsl:choose>
948
993
  <xsl:when test="normalize-space($title_) != ''">
949
994
  <xsl:value-of select="$title_"/>
@@ -952,12 +997,15 @@
952
997
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
953
998
  </xsl:otherwise>
954
999
  </xsl:choose>
955
- </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">
1000
+ </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">
1001
+
1002
+ </xsl:attribute-set><xsl:attribute-set name="link-style">
956
1003
 
957
1004
  <xsl:attribute name="color">blue</xsl:attribute>
958
1005
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
959
1006
 
960
1007
 
1008
+
961
1009
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
962
1010
  <xsl:attribute name="white-space">pre</xsl:attribute>
963
1011
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -972,6 +1020,7 @@
972
1020
 
973
1021
 
974
1022
 
1023
+
975
1024
  </xsl:attribute-set><xsl:attribute-set name="permission-style">
976
1025
 
977
1026
  </xsl:attribute-set><xsl:attribute-set name="permission-name-style">
@@ -1020,6 +1069,7 @@
1020
1069
 
1021
1070
 
1022
1071
 
1072
+
1023
1073
  </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1024
1074
 
1025
1075
 
@@ -1041,6 +1091,7 @@
1041
1091
 
1042
1092
 
1043
1093
 
1094
+
1044
1095
 
1045
1096
 
1046
1097
 
@@ -1087,6 +1138,7 @@
1087
1138
 
1088
1139
 
1089
1140
 
1141
+
1090
1142
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1091
1143
 
1092
1144
  <xsl:attribute name="font-size">12pt</xsl:attribute>
@@ -1106,11 +1158,13 @@
1106
1158
 
1107
1159
  </xsl:attribute-set><xsl:attribute-set name="xref-style">
1108
1160
 
1109
-
1161
+
1162
+
1110
1163
  </xsl:attribute-set><xsl:attribute-set name="eref-style">
1111
1164
 
1112
1165
 
1113
1166
 
1167
+
1114
1168
  </xsl:attribute-set><xsl:attribute-set name="note-style">
1115
1169
 
1116
1170
 
@@ -1131,8 +1185,7 @@
1131
1185
 
1132
1186
 
1133
1187
 
1134
-
1135
- </xsl:attribute-set><xsl:attribute-set name="note-name-style">
1188
+ </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">
1136
1189
 
1137
1190
 
1138
1191
 
@@ -1144,7 +1197,9 @@
1144
1197
  <xsl:attribute name="padding-right">5mm</xsl:attribute>
1145
1198
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1146
1199
 
1147
-
1200
+
1201
+
1202
+
1148
1203
 
1149
1204
  </xsl:attribute-set><xsl:attribute-set name="note-p-style">
1150
1205
 
@@ -1169,6 +1224,8 @@
1169
1224
 
1170
1225
 
1171
1226
 
1227
+ </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1228
+
1172
1229
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1173
1230
 
1174
1231
 
@@ -1195,6 +1252,7 @@
1195
1252
  </xsl:attribute-set><xsl:attribute-set name="origin-style">
1196
1253
 
1197
1254
 
1255
+
1198
1256
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1199
1257
 
1200
1258
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
@@ -1206,6 +1264,7 @@
1206
1264
 
1207
1265
 
1208
1266
 
1267
+
1209
1268
 
1210
1269
  <xsl:attribute name="text-align">center</xsl:attribute>
1211
1270
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
@@ -1244,14 +1303,16 @@
1244
1303
  </xsl:attribute-set><xsl:attribute-set name="tt-style">
1245
1304
 
1246
1305
 
1247
- <xsl:attribute name="font-family">Courier</xsl:attribute>
1248
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1306
+ <xsl:attribute name="font-family">Courier</xsl:attribute>
1307
+
1249
1308
 
1250
1309
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
1251
1310
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1252
1311
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1253
1312
  <xsl:attribute name="text-align">center</xsl:attribute>
1254
1313
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1314
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1315
+
1255
1316
  </xsl:attribute-set><xsl:attribute-set name="domain-style">
1256
1317
 
1257
1318
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
@@ -1319,6 +1380,10 @@
1319
1380
 
1320
1381
 
1321
1382
 
1383
+
1384
+
1385
+ <!-- $namespace = 'iso' or -->
1386
+
1322
1387
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1323
1388
 
1324
1389
 
@@ -1354,6 +1419,7 @@
1354
1419
  <xsl:with-param name="table" select="$simple-table"/>
1355
1420
  </xsl:call-template>
1356
1421
  </xsl:variable>
1422
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1357
1423
 
1358
1424
  <!-- <xsl:variable name="colwidths2">
1359
1425
  <xsl:call-template name="calculate-column-widths">
@@ -1375,6 +1441,12 @@
1375
1441
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1376
1442
 
1377
1443
 
1444
+
1445
+
1446
+
1447
+
1448
+
1449
+
1378
1450
 
1379
1451
 
1380
1452
 
@@ -1382,18 +1454,36 @@
1382
1454
 
1383
1455
 
1384
1456
 
1385
- <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">
1386
-
1387
-
1388
-
1457
+ <xsl:variable name="table_attributes">
1458
+ <attribute name="table-layout">fixed</attribute>
1459
+ <attribute name="width">100%</attribute>
1460
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1461
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1389
1462
 
1390
1463
 
1391
1464
 
1392
1465
 
1466
+
1467
+
1468
+
1393
1469
 
1470
+
1394
1471
 
1472
+ </xsl:variable>
1473
+
1474
+
1475
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
1395
1476
 
1477
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1478
+ <xsl:attribute name="{@name}">
1479
+ <xsl:value-of select="."/>
1480
+ </xsl:attribute>
1481
+ </xsl:for-each>
1396
1482
 
1483
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1484
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1485
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1486
+ </xsl:if>
1397
1487
 
1398
1488
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
1399
1489
  <xsl:choose>
@@ -1417,6 +1507,33 @@
1417
1507
 
1418
1508
  </fo:table>
1419
1509
 
1510
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1511
+ <xsl:call-template name="insertTableFooterInSeparateTable">
1512
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
1513
+ <xsl:with-param name="colwidths" select="$colwidths"/>
1514
+ </xsl:call-template>
1515
+ </xsl:for-each>
1516
+
1517
+ <!-- insert footer as table -->
1518
+ <!-- <fo:table>
1519
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1520
+ <xsl:attribute name="{@name}">
1521
+ <xsl:value-of select="."/>
1522
+ </xsl:attribute>
1523
+ </xsl:for-each>
1524
+
1525
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1526
+ <xsl:choose>
1527
+ <xsl:when test=". = 1 or . = 0">
1528
+ <fo:table-column column-width="proportional-column-width(2)"/>
1529
+ </xsl:when>
1530
+ <xsl:otherwise>
1531
+ <fo:table-column column-width="proportional-column-width({.})"/>
1532
+ </xsl:otherwise>
1533
+ </xsl:choose>
1534
+ </xsl:for-each>
1535
+ </fo:table>-->
1536
+
1420
1537
 
1421
1538
 
1422
1539
 
@@ -1425,8 +1542,9 @@
1425
1542
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1426
1543
  <xsl:if test="normalize-space() != ''">
1427
1544
  <fo:block xsl:use-attribute-sets="table-name-style">
1428
- <xsl:apply-templates/>
1429
- </fo:block>
1545
+
1546
+ <xsl:apply-templates/>
1547
+ </fo:block>
1430
1548
  </xsl:if>
1431
1549
  </xsl:template><xsl:template name="calculate-columns-numbers">
1432
1550
  <xsl:param name="table-row"/>
@@ -1480,6 +1598,13 @@
1480
1598
  <xsl:for-each select="xalan:nodeset($table)//tr">
1481
1599
  <xsl:variable name="td_text">
1482
1600
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
1601
+
1602
+ <!-- <xsl:if test="$namespace = 'bipm'">
1603
+ <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
1604
+ <word><xsl:value-of select="normalize-space(.)"/></word>
1605
+ </xsl:for-each>
1606
+ </xsl:if> -->
1607
+
1483
1608
  </xsl:variable>
1484
1609
  <xsl:variable name="words">
1485
1610
  <xsl:variable name="string_with_added_zerospaces">
@@ -1539,13 +1664,31 @@
1539
1664
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
1540
1665
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
1541
1666
  <xsl:value-of select="@target"/>
1667
+ </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
1668
+ <xsl:variable name="math_text" select="normalize-space(.)"/>
1669
+ <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
1542
1670
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1543
1671
  <xsl:param name="cols-count"/>
1544
1672
  <!-- font-weight="bold" -->
1545
- <fo:table-header>
1673
+ <fo:table-header>
1546
1674
 
1547
1675
  <xsl:apply-templates/>
1548
1676
  </fo:table-header>
1677
+ </xsl:template><xsl:template name="table-header-title">
1678
+ <xsl:param name="cols-count"/>
1679
+ <!-- row for title -->
1680
+ <fo:table-row>
1681
+ <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">
1682
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
1683
+ <xsl:for-each select="ancestor::*[local-name()='table'][1]">
1684
+ <xsl:call-template name="fn_name_display"/>
1685
+ </xsl:for-each>
1686
+ <fo:block text-align="right" font-style="italic">
1687
+ <xsl:text> </xsl:text>
1688
+ <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
1689
+ </fo:block>
1690
+ </fo:table-cell>
1691
+ </fo:table-row>
1549
1692
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
1550
1693
  <fo:table-body>
1551
1694
  <xsl:apply-templates/>
@@ -1553,6 +1696,13 @@
1553
1696
  </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
1554
1697
  <xsl:apply-templates/>
1555
1698
  </xsl:template><xsl:template name="insertTableFooter">
1699
+ <xsl:param name="cols-count"/>
1700
+ <xsl:if test="../*[local-name()='tfoot']">
1701
+ <fo:table-footer>
1702
+ <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
1703
+ </fo:table-footer>
1704
+ </xsl:if>
1705
+ </xsl:template><xsl:template name="insertTableFooter2">
1556
1706
  <xsl:param name="cols-count"/>
1557
1707
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1558
1708
  <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
@@ -1574,11 +1724,29 @@
1574
1724
  <!-- fn will be processed inside 'note' processing -->
1575
1725
 
1576
1726
 
1727
+
1728
+
1729
+
1730
+
1577
1731
  <!-- except gb -->
1578
1732
 
1579
1733
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1580
1734
 
1581
1735
 
1736
+ <!-- show Note under table in preface (ex. abstract) sections -->
1737
+ <!-- empty, because notes show at page side in main sections -->
1738
+ <!-- <xsl:if test="$namespace = 'bipm'">
1739
+ <xsl:choose>
1740
+ <xsl:when test="ancestor::*[local-name()='preface']">
1741
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1742
+ </xsl:when>
1743
+ <xsl:otherwise>
1744
+ <fo:block/>
1745
+ </xsl:otherwise>
1746
+ </xsl:choose>
1747
+ </xsl:if> -->
1748
+
1749
+
1582
1750
  <!-- horizontal row separator -->
1583
1751
 
1584
1752
 
@@ -1592,6 +1760,88 @@
1592
1760
  </fo:table-footer>
1593
1761
 
1594
1762
  </xsl:if>
1763
+ </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
1764
+ <xsl:param name="table_attributes"/>
1765
+ <xsl:param name="colwidths"/>
1766
+
1767
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1768
+
1769
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1770
+
1771
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
1772
+
1773
+ <fo:table keep-with-previous="always">
1774
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1775
+ <xsl:choose>
1776
+ <xsl:when test="@name = 'border-top'">
1777
+ <xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
1778
+ </xsl:when>
1779
+ <xsl:when test="@name = 'border'">
1780
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
1781
+ <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
1782
+ </xsl:when>
1783
+ <xsl:otherwise>
1784
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
1785
+ </xsl:otherwise>
1786
+ </xsl:choose>
1787
+ </xsl:for-each>
1788
+
1789
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1790
+ <xsl:choose>
1791
+ <xsl:when test=". = 1 or . = 0">
1792
+ <fo:table-column column-width="proportional-column-width(2)"/>
1793
+ </xsl:when>
1794
+ <xsl:otherwise>
1795
+ <fo:table-column column-width="proportional-column-width({.})"/>
1796
+ </xsl:otherwise>
1797
+ </xsl:choose>
1798
+ </xsl:for-each>
1799
+
1800
+ <fo:table-body>
1801
+ <fo:table-row>
1802
+ <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
1803
+
1804
+
1805
+
1806
+ <!-- fn will be processed inside 'note' processing -->
1807
+
1808
+
1809
+
1810
+
1811
+
1812
+
1813
+
1814
+ <!-- except gb -->
1815
+
1816
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1817
+
1818
+
1819
+ <!-- <xsl:if test="$namespace = 'bipm'">
1820
+ <xsl:choose>
1821
+ <xsl:when test="ancestor::*[local-name()='preface']">
1822
+ show Note under table in preface (ex. abstract) sections
1823
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1824
+ </xsl:when>
1825
+ <xsl:otherwise>
1826
+ empty, because notes show at page side in main sections
1827
+ <fo:block/>
1828
+ </xsl:otherwise>
1829
+ </xsl:choose>
1830
+ </xsl:if> -->
1831
+
1832
+
1833
+ <!-- horizontal row separator -->
1834
+
1835
+
1836
+ <!-- fn processing -->
1837
+ <xsl:call-template name="fn_display"/>
1838
+
1839
+ </fo:table-cell>
1840
+ </fo:table-row>
1841
+ </fo:table-body>
1842
+
1843
+ </fo:table>
1844
+ </xsl:if>
1595
1845
  </xsl:template><xsl:template match="*[local-name()='tbody']">
1596
1846
 
1597
1847
  <xsl:variable name="cols-count">
@@ -1609,6 +1859,8 @@
1609
1859
  </xsl:choose>
1610
1860
  </xsl:variable>
1611
1861
 
1862
+
1863
+
1612
1864
  <xsl:apply-templates select="../*[local-name()='thead']" mode="process">
1613
1865
  <xsl:with-param name="cols-count" select="$cols-count"/>
1614
1866
  </xsl:apply-templates>
@@ -1618,6 +1870,8 @@
1618
1870
  </xsl:call-template>
1619
1871
 
1620
1872
  <fo:table-body>
1873
+
1874
+
1621
1875
  <xsl:apply-templates/>
1622
1876
  <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> -->
1623
1877
 
@@ -1641,6 +1895,11 @@
1641
1895
  </xsl:if>
1642
1896
 
1643
1897
 
1898
+
1899
+ <!-- <xsl:if test="$namespace = 'bipm'">
1900
+ <xsl:attribute name="height">8mm</xsl:attribute>
1901
+ </xsl:if> -->
1902
+
1644
1903
  <xsl:apply-templates/>
1645
1904
  </fo:table-row>
1646
1905
  </xsl:template><xsl:template match="*[local-name()='th']">
@@ -1662,6 +1921,8 @@
1662
1921
 
1663
1922
 
1664
1923
 
1924
+
1925
+
1665
1926
  <xsl:if test="@colspan">
1666
1927
  <xsl:attribute name="number-columns-spanned">
1667
1928
  <xsl:value-of select="@colspan"/>
@@ -1672,10 +1933,22 @@
1672
1933
  <xsl:value-of select="@rowspan"/>
1673
1934
  </xsl:attribute>
1674
1935
  </xsl:if>
1936
+ <xsl:call-template name="display-align"/>
1675
1937
  <fo:block>
1676
1938
  <xsl:apply-templates/>
1677
1939
  </fo:block>
1678
1940
  </fo:table-cell>
1941
+ </xsl:template><xsl:template name="display-align">
1942
+ <xsl:if test="@valign">
1943
+ <xsl:attribute name="display-align">
1944
+ <xsl:choose>
1945
+ <xsl:when test="@valign = 'top'">before</xsl:when>
1946
+ <xsl:when test="@valign = 'middle'">center</xsl:when>
1947
+ <xsl:when test="@valign = 'bottom'">after</xsl:when>
1948
+ <xsl:otherwise>before</xsl:otherwise>
1949
+ </xsl:choose>
1950
+ </xsl:attribute>
1951
+ </xsl:if>
1679
1952
  </xsl:template><xsl:template match="*[local-name()='td']">
1680
1953
  <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
1681
1954
  <xsl:attribute name="text-align">
@@ -1689,7 +1962,9 @@
1689
1962
 
1690
1963
 
1691
1964
 
1692
-
1965
+
1966
+
1967
+
1693
1968
 
1694
1969
 
1695
1970
 
@@ -1705,8 +1980,8 @@
1705
1980
  <xsl:value-of select="@rowspan"/>
1706
1981
  </xsl:attribute>
1707
1982
  </xsl:if>
1708
- <fo:block>
1709
-
1983
+ <xsl:call-template name="display-align"/>
1984
+ <fo:block>
1710
1985
  <xsl:apply-templates/>
1711
1986
  </fo:block>
1712
1987
  </fo:table-cell>
@@ -1718,14 +1993,17 @@
1718
1993
 
1719
1994
 
1720
1995
 
1996
+
1997
+
1721
1998
  <fo:inline padding-right="2mm">
1722
1999
 
1723
2000
 
1724
2001
 
1725
-
2002
+
1726
2003
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
1727
2004
 
1728
2005
  </fo:inline>
2006
+
1729
2007
  <xsl:apply-templates mode="process"/>
1730
2008
  </fo:block>
1731
2009
 
@@ -1749,6 +2027,7 @@
1749
2027
 
1750
2028
 
1751
2029
 
2030
+
1752
2031
  <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
1753
2032
 
1754
2033
  <xsl:attribute name="vertical-align">super</xsl:attribute>
@@ -1758,12 +2037,15 @@
1758
2037
 
1759
2038
 
1760
2039
 
2040
+
1761
2041
  <xsl:value-of select="@reference"/>
1762
2042
 
2043
+
1763
2044
  </fo:inline>
1764
2045
  <fo:inline>
1765
2046
 
1766
- <xsl:apply-templates/>
2047
+ <!-- <xsl:apply-templates /> -->
2048
+ <xsl:copy-of select="./node()"/>
1767
2049
  </fo:inline>
1768
2050
  </fo:block>
1769
2051
  </xsl:if>
@@ -1800,7 +2082,20 @@
1800
2082
  <xsl:variable name="following_dl_colwidths">
1801
2083
  <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
1802
2084
  <xsl:variable name="html-table">
1803
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2085
+ <xsl:variable name="doc_ns">
2086
+
2087
+ </xsl:variable>
2088
+ <xsl:variable name="ns">
2089
+ <xsl:choose>
2090
+ <xsl:when test="normalize-space($doc_ns) != ''">
2091
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2092
+ </xsl:when>
2093
+ <xsl:otherwise>
2094
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2095
+ </xsl:otherwise>
2096
+ </xsl:choose>
2097
+ </xsl:variable>
2098
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
1804
2099
  <xsl:element name="{$ns}:table">
1805
2100
  <xsl:for-each select="*[local-name() = 'dl'][1]">
1806
2101
  <tbody>
@@ -1865,7 +2160,8 @@
1865
2160
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
1866
2161
  </xsl:if>
1867
2162
 
1868
- <xsl:apply-templates/>
2163
+ <!-- <xsl:apply-templates /> -->
2164
+ <xsl:copy-of select="./node()"/>
1869
2165
  </fo:block>
1870
2166
  </fo:table-cell>
1871
2167
  </fo:table-row>
@@ -1883,9 +2179,13 @@
1883
2179
 
1884
2180
 
1885
2181
 
2182
+
2183
+
1886
2184
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
1887
2185
 
2186
+
1888
2187
  <xsl:value-of select="@reference"/>
2188
+
1889
2189
  </fo:basic-link>
1890
2190
  </fo:inline>
1891
2191
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -1893,115 +2193,142 @@
1893
2193
  <xsl:apply-templates/>
1894
2194
  </fo:inline>
1895
2195
  </xsl:template><xsl:template match="*[local-name()='dl']">
1896
- <xsl:variable name="parent" select="local-name(..)"/>
1897
-
1898
- <xsl:variable name="key_iso">
1899
- <!-- and (not(../@class) or ../@class !='pseudocode') -->
1900
- </xsl:variable>
1901
-
1902
- <xsl:choose>
1903
- <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
1904
-
1905
-
1906
- <fo:block margin-bottom="12pt" text-align="left">
1907
-
1908
- <xsl:variable name="title-where">
1909
- <xsl:call-template name="getTitle">
1910
- <xsl:with-param name="name" select="'title-where'"/>
1911
- </xsl:call-template>
1912
- </xsl:variable>
1913
- <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
1914
- <xsl:apply-templates select="*[local-name()='dt']/*"/>
1915
- <xsl:text/>
1916
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
1917
- </fo:block>
1918
-
1919
- </xsl:when>
1920
- <xsl:when test="$parent = 'formula'"> <!-- a few components -->
1921
- <fo:block margin-bottom="12pt" text-align="left">
1922
-
1923
-
1924
-
1925
-
1926
- <xsl:variable name="title-where">
1927
- <xsl:call-template name="getTitle">
1928
- <xsl:with-param name="name" select="'title-where'"/>
1929
- </xsl:call-template>
1930
- </xsl:variable>
1931
- <xsl:value-of select="$title-where"/>
1932
- </fo:block>
1933
- </xsl:when>
1934
- <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
1935
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
1936
-
1937
-
1938
-
1939
- <xsl:variable name="title-key">
1940
- <xsl:call-template name="getTitle">
1941
- <xsl:with-param name="name" select="'title-key'"/>
1942
- </xsl:call-template>
1943
- </xsl:variable>
1944
- <xsl:value-of select="$title-key"/>
1945
- </fo:block>
1946
- </xsl:when>
1947
- </xsl:choose>
1948
-
1949
- <!-- a few components -->
1950
- <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
1951
- <fo:block>
1952
-
2196
+ <fo:block-container margin-left="0mm">
2197
+ <xsl:if test="parent::*[local-name() = 'note']">
2198
+ <xsl:attribute name="margin-left">
2199
+ <xsl:choose>
2200
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
2201
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
2202
+ </xsl:choose>
2203
+ </xsl:attribute>
1953
2204
 
2205
+ </xsl:if>
2206
+ <fo:block-container margin-left="0mm">
2207
+
2208
+ <xsl:variable name="parent" select="local-name(..)"/>
1954
2209
 
2210
+ <xsl:variable name="key_iso">
2211
+ <!-- and (not(../@class) or ../@class !='pseudocode') -->
2212
+ </xsl:variable>
1955
2213
 
1956
- <fo:block>
1957
-
1958
-
1959
-
1960
-
1961
- <fo:table width="95%" table-layout="fixed">
2214
+ <xsl:choose>
2215
+ <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
1962
2216
 
1963
- <xsl:choose>
1964
- <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
1965
- <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
1966
- </xsl:when>
1967
- <xsl:when test="normalize-space($key_iso) = 'true'">
1968
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2217
+
2218
+ <fo:block margin-bottom="12pt" text-align="left">
1969
2219
 
1970
- </xsl:when>
1971
- </xsl:choose>
1972
- <!-- create virtual html table for dl/[dt and dd] -->
1973
- <xsl:variable name="html-table">
1974
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
1975
- <xsl:element name="{$ns}:table">
1976
- <tbody>
1977
- <xsl:apply-templates mode="dl"/>
1978
- </tbody>
1979
- </xsl:element>
1980
- </xsl:variable>
1981
- <!-- html-table<xsl:copy-of select="$html-table"/> -->
1982
- <xsl:variable name="colwidths">
1983
- <xsl:call-template name="calculate-column-widths">
1984
- <xsl:with-param name="cols-count" select="2"/>
1985
- <xsl:with-param name="table" select="$html-table"/>
1986
- </xsl:call-template>
1987
- </xsl:variable>
1988
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
1989
- <xsl:variable name="maxlength_dt">
1990
- <xsl:call-template name="getMaxLength_dt"/>
1991
- </xsl:variable>
1992
- <xsl:call-template name="setColumnWidth_dl">
1993
- <xsl:with-param name="colwidths" select="$colwidths"/>
1994
- <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
1995
- </xsl:call-template>
1996
- <fo:table-body>
1997
- <xsl:apply-templates>
1998
- <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
1999
- </xsl:apply-templates>
2000
- </fo:table-body>
2001
- </fo:table>
2002
- </fo:block>
2003
- </fo:block>
2004
- </xsl:if>
2220
+ <xsl:variable name="title-where">
2221
+ <xsl:call-template name="getTitle">
2222
+ <xsl:with-param name="name" select="'title-where'"/>
2223
+ </xsl:call-template>
2224
+ </xsl:variable>
2225
+ <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2226
+ <xsl:apply-templates select="*[local-name()='dt']/*"/>
2227
+ <xsl:text/>
2228
+ <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
2229
+ </fo:block>
2230
+
2231
+ </xsl:when>
2232
+ <xsl:when test="$parent = 'formula'"> <!-- a few components -->
2233
+ <fo:block margin-bottom="12pt" text-align="left">
2234
+
2235
+
2236
+
2237
+
2238
+ <xsl:variable name="title-where">
2239
+ <xsl:call-template name="getTitle">
2240
+ <xsl:with-param name="name" select="'title-where'"/>
2241
+ </xsl:call-template>
2242
+ </xsl:variable>
2243
+ <xsl:value-of select="$title-where"/>
2244
+ </fo:block>
2245
+ </xsl:when>
2246
+ <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
2247
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
2248
+
2249
+
2250
+
2251
+ <xsl:variable name="title-key">
2252
+ <xsl:call-template name="getTitle">
2253
+ <xsl:with-param name="name" select="'title-key'"/>
2254
+ </xsl:call-template>
2255
+ </xsl:variable>
2256
+ <xsl:value-of select="$title-key"/>
2257
+ </fo:block>
2258
+ </xsl:when>
2259
+ </xsl:choose>
2260
+
2261
+ <!-- a few components -->
2262
+ <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
2263
+ <fo:block>
2264
+
2265
+
2266
+
2267
+
2268
+ <fo:block>
2269
+
2270
+
2271
+
2272
+
2273
+ <fo:table width="95%" table-layout="fixed">
2274
+
2275
+ <xsl:choose>
2276
+ <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
2277
+ <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
2278
+ </xsl:when>
2279
+ <xsl:when test="normalize-space($key_iso) = 'true'">
2280
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2281
+
2282
+ </xsl:when>
2283
+ </xsl:choose>
2284
+ <!-- create virtual html table for dl/[dt and dd] -->
2285
+ <xsl:variable name="html-table">
2286
+ <xsl:variable name="doc_ns">
2287
+
2288
+ </xsl:variable>
2289
+ <xsl:variable name="ns">
2290
+ <xsl:choose>
2291
+ <xsl:when test="normalize-space($doc_ns) != ''">
2292
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2293
+ </xsl:when>
2294
+ <xsl:otherwise>
2295
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2296
+ </xsl:otherwise>
2297
+ </xsl:choose>
2298
+ </xsl:variable>
2299
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2300
+ <xsl:element name="{$ns}:table">
2301
+ <tbody>
2302
+ <xsl:apply-templates mode="dl"/>
2303
+ </tbody>
2304
+ </xsl:element>
2305
+ </xsl:variable>
2306
+ <!-- html-table<xsl:copy-of select="$html-table"/> -->
2307
+ <xsl:variable name="colwidths">
2308
+ <xsl:call-template name="calculate-column-widths">
2309
+ <xsl:with-param name="cols-count" select="2"/>
2310
+ <xsl:with-param name="table" select="$html-table"/>
2311
+ </xsl:call-template>
2312
+ </xsl:variable>
2313
+ <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2314
+ <xsl:variable name="maxlength_dt">
2315
+ <xsl:call-template name="getMaxLength_dt"/>
2316
+ </xsl:variable>
2317
+ <xsl:call-template name="setColumnWidth_dl">
2318
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2319
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2320
+ </xsl:call-template>
2321
+ <fo:table-body>
2322
+ <xsl:apply-templates>
2323
+ <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
2324
+ </xsl:apply-templates>
2325
+ </fo:table-body>
2326
+ </fo:table>
2327
+ </fo:block>
2328
+ </fo:block>
2329
+ </xsl:if>
2330
+ </fo:block-container>
2331
+ </fo:block-container>
2005
2332
  </xsl:template><xsl:template name="setColumnWidth_dl">
2006
2333
  <xsl:param name="colwidths"/>
2007
2334
  <xsl:param name="maxlength_dt"/>
@@ -2098,6 +2425,7 @@
2098
2425
  <xsl:param name="key_iso"/>
2099
2426
 
2100
2427
  <fo:table-row>
2428
+
2101
2429
  <fo:table-cell>
2102
2430
 
2103
2431
  <fo:block margin-top="6pt">
@@ -2112,6 +2440,7 @@
2112
2440
 
2113
2441
 
2114
2442
 
2443
+
2115
2444
  <xsl:apply-templates/>
2116
2445
  <!-- <xsl:if test="$namespace = 'gb'">
2117
2446
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -2123,14 +2452,36 @@
2123
2452
  <fo:table-cell>
2124
2453
  <fo:block>
2125
2454
 
2126
-
2455
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2456
+ <xsl:if test="local-name(*[1]) != 'stem'">
2457
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2458
+ </xsl:if>
2459
+ </xsl:if> -->
2127
2460
 
2128
2461
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2129
2462
 
2130
2463
  </fo:block>
2131
2464
  </fo:table-cell>
2132
2465
  </fo:table-row>
2133
-
2466
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2467
+ <xsl:if test="local-name(*[1]) = 'stem'">
2468
+ <fo:table-row>
2469
+ <fo:table-cell>
2470
+ <fo:block margin-top="6pt">
2471
+ <xsl:if test="normalize-space($key_iso) = 'true'">
2472
+ <xsl:attribute name="margin-top">0</xsl:attribute>
2473
+ </xsl:if>
2474
+ <xsl:text>&#xA0;</xsl:text>
2475
+ </fo:block>
2476
+ </fo:table-cell>
2477
+ <fo:table-cell>
2478
+ <fo:block>
2479
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2480
+ </fo:block>
2481
+ </fo:table-cell>
2482
+ </fo:table-row>
2483
+ </xsl:if>
2484
+ </xsl:if> -->
2134
2485
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
2135
2486
  <xsl:apply-templates/>
2136
2487
  </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
@@ -2155,6 +2506,36 @@
2155
2506
  </fo:inline>
2156
2507
  </xsl:template><xsl:template match="*[local-name()='tt']">
2157
2508
  <fo:inline xsl:use-attribute-sets="tt-style">
2509
+ <xsl:variable name="_font-size">
2510
+
2511
+
2512
+
2513
+
2514
+
2515
+
2516
+
2517
+
2518
+ <xsl:choose>
2519
+ <xsl:when test="not(ancestor::*[local-name()='note'])">10</xsl:when>
2520
+ <xsl:otherwise>11</xsl:otherwise>
2521
+ </xsl:choose>
2522
+
2523
+
2524
+
2525
+
2526
+
2527
+
2528
+
2529
+ </xsl:variable>
2530
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
2531
+ <xsl:if test="$font-size != ''">
2532
+ <xsl:attribute name="font-size">
2533
+ <xsl:choose>
2534
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
2535
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
2536
+ </xsl:choose>
2537
+ </xsl:attribute>
2538
+ </xsl:if>
2158
2539
  <xsl:apply-templates/>
2159
2540
  </fo:inline>
2160
2541
  </xsl:template><xsl:template match="*[local-name()='del']">
@@ -2480,11 +2861,24 @@
2480
2861
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
2481
2862
  <xsl:value-of select="substring($str, 2)"/>
2482
2863
  </xsl:template><xsl:template match="mathml:math">
2483
- <fo:inline font-family="STIX2Math">
2484
- <fo:instream-foreign-object fox:alt-text="Math">
2485
- <xsl:copy-of select="."/>
2486
- </fo:instream-foreign-object>
2864
+ <fo:inline font-family="STIX Two Math"> <!-- -->
2865
+ <xsl:variable name="mathml">
2866
+ <xsl:apply-templates select="." mode="mathml"/>
2867
+ </xsl:variable>
2868
+ <fo:instream-foreign-object fox:alt-text="Math">
2869
+ <!-- <xsl:copy-of select="."/> -->
2870
+ <xsl:copy-of select="xalan:nodeset($mathml)"/>
2871
+ </fo:instream-foreign-object>
2487
2872
  </fo:inline>
2873
+ </xsl:template><xsl:template match="@*|node()" mode="mathml">
2874
+ <xsl:copy>
2875
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
2876
+ </xsl:copy>
2877
+ </xsl:template><xsl:template match="mathml:mtext" mode="mathml">
2878
+ <xsl:copy>
2879
+ <!-- replace start and end spaces to non-break space -->
2880
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
2881
+ </xsl:copy>
2488
2882
  </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
2489
2883
  <xsl:variable name="target">
2490
2884
  <xsl:choose>
@@ -2561,13 +2955,26 @@
2561
2955
  <xsl:apply-templates/>
2562
2956
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
2563
2957
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
2564
-
2958
+
2565
2959
  <xsl:apply-templates/>
2566
2960
  </fo:basic-link>
2567
2961
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
2568
- <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
2569
- <xsl:apply-templates/>
2570
- </fo:block>
2962
+ <fo:block-container margin-left="0mm">
2963
+ <xsl:if test="parent::*[local-name() = 'note']">
2964
+ <xsl:attribute name="margin-left">
2965
+ <xsl:choose>
2966
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
2967
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
2968
+ </xsl:choose>
2969
+ </xsl:attribute>
2970
+
2971
+ </xsl:if>
2972
+ <fo:block-container margin-left="0mm">
2973
+ <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
2974
+ <xsl:apply-templates/>
2975
+ </fo:block>
2976
+ </fo:block-container>
2977
+ </fo:block-container>
2571
2978
  </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'dt']/*[local-name() = 'stem']">
2572
2979
  <fo:inline>
2573
2980
  <xsl:apply-templates/>
@@ -2601,6 +3008,8 @@
2601
3008
 
2602
3009
 
2603
3010
 
3011
+
3012
+
2604
3013
  <fo:inline xsl:use-attribute-sets="note-name-style">
2605
3014
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2606
3015
  </fo:inline>
@@ -2627,7 +3036,9 @@
2627
3036
  </xsl:choose>
2628
3037
  </xsl:template><xsl:template match="*[local-name() = 'termnote']">
2629
3038
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
2630
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3039
+ <fo:inline xsl:use-attribute-sets="termnote-name-style">
3040
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3041
+ </fo:inline>
2631
3042
  <xsl:apply-templates/>
2632
3043
  </fo:block>
2633
3044
  </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">
@@ -2728,15 +3139,109 @@
2728
3139
 
2729
3140
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
2730
3141
  </fo:block>
2731
- </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">
3142
+ </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">
2732
3143
  <xsl:apply-templates mode="contents"/>
2733
3144
  <xsl:text> </xsl:text>
2734
- </xsl:template><xsl:template match="text()" mode="contents">
3145
+ </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">
3146
+ <xsl:apply-templates mode="bookmarks"/>
3147
+ <xsl:text> </xsl:text>
3148
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
2735
3149
  <xsl:value-of select="."/>
2736
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
3150
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
3151
+ <xsl:value-of select="."/>
3152
+ </xsl:template><xsl:template match="node()" mode="contents">
3153
+ <xsl:apply-templates mode="contents"/>
3154
+ </xsl:template><xsl:template match="node()" mode="bookmarks">
3155
+ <xsl:apply-templates mode="bookmarks"/>
3156
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3157
+ <xsl:apply-templates select="."/>
3158
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3159
+ <xsl:apply-templates mode="bookmarks"/>
3160
+ </xsl:template><xsl:template name="addBookmarks">
3161
+ <xsl:param name="contents"/>
3162
+ <xsl:if test="xalan:nodeset($contents)//item">
3163
+ <fo:bookmark-tree>
3164
+ <xsl:choose>
3165
+ <xsl:when test="xalan:nodeset($contents)/doc">
3166
+ <xsl:choose>
3167
+ <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
3168
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3169
+ <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
3170
+ <fo:bookmark-title>
3171
+ <xsl:variable name="bookmark-title_">
3172
+ <xsl:call-template name="getLangVersion">
3173
+ <xsl:with-param name="lang" select="@lang"/>
3174
+ </xsl:call-template>
3175
+ </xsl:variable>
3176
+ <xsl:choose>
3177
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
3178
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
3179
+ </xsl:when>
3180
+ <xsl:otherwise>
3181
+ <xsl:choose>
3182
+ <xsl:when test="@lang = 'en'">English</xsl:when>
3183
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
3184
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3185
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3186
+ </xsl:choose>
3187
+ </xsl:otherwise>
3188
+ </xsl:choose>
3189
+ </fo:bookmark-title>
3190
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3191
+ </fo:bookmark>
3192
+
3193
+ </xsl:for-each>
3194
+ </xsl:when>
3195
+ <xsl:otherwise>
3196
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3197
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3198
+ </xsl:for-each>
3199
+ </xsl:otherwise>
3200
+ </xsl:choose>
3201
+ </xsl:when>
3202
+ <xsl:otherwise>
3203
+ <xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
3204
+ </xsl:otherwise>
3205
+ </xsl:choose>
3206
+
3207
+
3208
+
3209
+
3210
+
3211
+
3212
+
3213
+
3214
+ </fo:bookmark-tree>
3215
+ </xsl:if>
3216
+ </xsl:template><xsl:template name="getLangVersion">
3217
+ <xsl:param name="lang"/>
3218
+ <xsl:choose>
3219
+ <xsl:when test="$lang = 'en'">
3220
+
3221
+
3222
+ </xsl:when>
3223
+ <xsl:when test="$lang = 'fr'">
3224
+
3225
+
3226
+ </xsl:when>
3227
+ <xsl:when test="$lang = 'de'">Deutsche</xsl:when>
3228
+ <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
3229
+ </xsl:choose>
3230
+ </xsl:template><xsl:template match="item" mode="bookmark">
3231
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
3232
+ <fo:bookmark-title>
3233
+ <xsl:if test="@section != ''">
3234
+ <xsl:value-of select="@section"/>
3235
+ <xsl:text> </xsl:text>
3236
+ </xsl:if>
3237
+ <xsl:value-of select="normalize-space(title)"/>
3238
+ </fo:bookmark-title>
3239
+ <xsl:apply-templates mode="bookmark"/>
3240
+ </fo:bookmark>
3241
+ </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">
2737
3242
  <xsl:if test="normalize-space() != ''">
2738
3243
  <fo:block xsl:use-attribute-sets="figure-name-style">
2739
-
3244
+
2740
3245
  <xsl:apply-templates/>
2741
3246
  </fo:block>
2742
3247
  </xsl:if>
@@ -2791,7 +3296,7 @@
2791
3296
  <xsl:apply-templates/>
2792
3297
  </xsl:otherwise>
2793
3298
  </xsl:choose>
2794
- </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">
3299
+ </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">
2795
3300
  <xsl:text> </xsl:text>
2796
3301
  </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
2797
3302
  <xsl:copy>
@@ -2800,21 +3305,61 @@
2800
3305
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
2801
3306
  <xsl:text> </xsl:text>
2802
3307
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
2803
- <fo:block xsl:use-attribute-sets="sourcecode-style">
2804
- <xsl:apply-templates/>
2805
- </fo:block>
2806
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
2807
- </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()">
3308
+
3309
+ <fo:block-container margin-left="0mm">
3310
+ <xsl:if test="parent::*[local-name() = 'note']">
3311
+ <xsl:attribute name="margin-left">
3312
+ <xsl:choose>
3313
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3314
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3315
+ </xsl:choose>
3316
+ </xsl:attribute>
3317
+
3318
+ </xsl:if>
3319
+ <fo:block-container margin-left="0mm">
3320
+
3321
+ <fo:block xsl:use-attribute-sets="sourcecode-style">
3322
+ <xsl:variable name="_font-size">
3323
+
3324
+
3325
+
3326
+
3327
+
3328
+
3329
+
3330
+
3331
+
3332
+
3333
+
3334
+
3335
+
3336
+
3337
+ </xsl:variable>
3338
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
3339
+ <xsl:if test="$font-size != ''">
3340
+ <xsl:attribute name="font-size">
3341
+ <xsl:choose>
3342
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3343
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3344
+ </xsl:choose>
3345
+ </xsl:attribute>
3346
+ </xsl:if>
3347
+ <xsl:apply-templates/>
3348
+ </fo:block>
3349
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3350
+
3351
+ </fo:block-container>
3352
+ </fo:block-container>
3353
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
2808
3354
  <xsl:variable name="text">
2809
3355
  <xsl:call-template name="add-zero-spaces-equal"/>
2810
3356
  </xsl:variable>
2811
- <xsl:call-template name="add-zero-spaces">
3357
+ <xsl:call-template name="add-zero-spaces-java">
2812
3358
  <xsl:with-param name="text" select="$text"/>
2813
3359
  </xsl:call-template>
2814
3360
  </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
2815
3361
  <xsl:if test="normalize-space() != ''">
2816
- <fo:block xsl:use-attribute-sets="sourcecode-name-style">
2817
-
3362
+ <fo:block xsl:use-attribute-sets="sourcecode-name-style">
2818
3363
  <xsl:apply-templates/>
2819
3364
  </fo:block>
2820
3365
  </xsl:if>
@@ -2884,22 +3429,30 @@
2884
3429
  </fo:block>
2885
3430
  </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
2886
3431
  <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
3432
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3433
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
3434
+ </xsl:if>
2887
3435
  <fo:block-container margin-left="0mm" margin-right="0mm">
2888
- <fo:table id="{@id}" table-layout="fixed" width="100%" border="0pt solid black">
3436
+ <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
3437
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3438
+ <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
3439
+ </xsl:if>
2889
3440
  <xsl:variable name="simple-table">
2890
3441
  <xsl:call-template name="getSimpleTable"/>
2891
3442
  </xsl:variable>
2892
3443
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
2893
3444
  <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
2894
- <fo:table-column column-width="35mm"/>
2895
- <fo:table-column column-width="115mm"/>
3445
+ <!-- <fo:table-column column-width="35mm"/>
3446
+ <fo:table-column column-width="115mm"/> -->
3447
+ <fo:table-column column-width="30%"/>
3448
+ <fo:table-column column-width="70%"/>
2896
3449
  </xsl:if>
2897
3450
  <xsl:apply-templates mode="requirement"/>
2898
3451
  </fo:table>
2899
3452
  <!-- fn processing -->
2900
3453
  <xsl:if test=".//*[local-name() = 'fn']">
2901
3454
  <xsl:for-each select="*[local-name() = 'tbody']">
2902
- <fo:block font-size="90%" border-bottom="1.pt solid black">
3455
+ <fo:block font-size="90%" border-bottom="1pt solid black">
2903
3456
  <xsl:call-template name="fn_display"/>
2904
3457
  </fo:block>
2905
3458
  </xsl:for-each>
@@ -2915,17 +3468,27 @@
2915
3468
  <xsl:apply-templates mode="requirement"/>
2916
3469
  </fo:table-body>
2917
3470
  </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
2918
- <fo:table-row>
3471
+ <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
3472
+ <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
3473
+ <!-- <xsl:attribute name="border">1pt solid black</xsl:attribute> -->
3474
+ <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
3475
+ </xsl:if>
3476
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
3477
+ <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
3478
+ </xsl:if>
3479
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
3480
+ <xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
3481
+ </xsl:if>
2919
3482
  <xsl:apply-templates mode="requirement"/>
2920
3483
  </fo:table-row>
2921
3484
  </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
2922
- <fo:table-cell text-align="{@align}">
3485
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
2923
3486
  <xsl:attribute name="text-align">
2924
3487
  <xsl:choose>
2925
3488
  <xsl:when test="@align">
2926
3489
  <xsl:value-of select="@align"/>
2927
3490
  </xsl:when>
2928
- <xsl:otherwise>center</xsl:otherwise>
3491
+ <xsl:otherwise>left</xsl:otherwise>
2929
3492
  </xsl:choose>
2930
3493
  </xsl:attribute>
2931
3494
  <xsl:if test="@colspan">
@@ -2938,22 +3501,27 @@
2938
3501
  <xsl:value-of select="@rowspan"/>
2939
3502
  </xsl:attribute>
2940
3503
  </xsl:if>
3504
+ <xsl:call-template name="display-align"/>
2941
3505
 
2942
- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3506
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
2943
3507
  <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2944
3508
  <xsl:attribute name="background-color">rgb(165, 165, 165)</xsl:attribute>
2945
3509
  </xsl:if>
2946
3510
  <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommendtest'">
2947
3511
  <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2948
3512
  <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
2949
- </xsl:if>
3513
+ </xsl:if> -->
2950
3514
 
2951
3515
  <fo:block>
2952
3516
  <xsl:apply-templates/>
2953
3517
  </fo:block>
2954
3518
  </fo:table-cell>
2955
3519
  </xsl:template><xsl:template match="*[local-name()='td']" mode="requirement">
2956
- <fo:table-cell text-align="{@align}">
3520
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
3521
+ <xsl:if test="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3522
+ <xsl:attribute name="padding">0mm</xsl:attribute>
3523
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
3524
+ </xsl:if>
2957
3525
  <xsl:attribute name="text-align">
2958
3526
  <xsl:choose>
2959
3527
  <xsl:when test="@align">
@@ -2962,6 +3530,9 @@
2962
3530
  <xsl:otherwise>left</xsl:otherwise>
2963
3531
  </xsl:choose>
2964
3532
  </xsl:attribute>
3533
+ <xsl:if test="following-sibling::*[local-name()='td'] and not(preceding-sibling::*[local-name()='td'])">
3534
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3535
+ </xsl:if>
2965
3536
  <xsl:if test="@colspan">
2966
3537
  <xsl:attribute name="number-columns-spanned">
2967
3538
  <xsl:value-of select="@colspan"/>
@@ -2972,25 +3543,27 @@
2972
3543
  <xsl:value-of select="@rowspan"/>
2973
3544
  </xsl:attribute>
2974
3545
  </xsl:if>
3546
+ <xsl:call-template name="display-align"/>
2975
3547
 
2976
- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3548
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
2977
3549
  <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
2978
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
2979
- <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])"> <!-- 2nd line and below -->
3550
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3551
+ <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])">
2980
3552
  <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
2981
3553
  </xsl:if>
2982
- </xsl:if>
3554
+ </xsl:if> -->
3555
+ <!-- 2nd line and below -->
2983
3556
 
2984
3557
  <fo:block>
2985
3558
  <xsl:apply-templates/>
2986
3559
  </fo:block>
2987
3560
  </fo:table-cell>
2988
3561
  </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
2989
- <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="4pt">
3562
+ <fo:block font-size="11pt" color="rgb(237, 193, 35)"> <!-- font-weight="bold" margin-bottom="4pt" text-align="center" -->
2990
3563
  <xsl:apply-templates/>
2991
3564
  </fo:block>
2992
- </xsl:template><xsl:template match="*[local-name() = 'p'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
2993
- <fo:block margin-bottom="10pt">
3565
+ </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
3566
+ <fo:block> <!-- margin-bottom="10pt" -->
2994
3567
  <xsl:apply-templates/>
2995
3568
  </fo:block>
2996
3569
  </xsl:template><xsl:template match="*[local-name() = 'termexample']">
@@ -3012,12 +3585,13 @@
3012
3585
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3013
3586
 
3014
3587
  <xsl:variable name="element">
3015
-
3588
+
3016
3589
  inline
3590
+ <xsl:if test=".//*[local-name() = 'table']">block</xsl:if>
3017
3591
  </xsl:variable>
3018
3592
 
3019
3593
  <xsl:choose>
3020
- <xsl:when test="normalize-space($element) = 'block'">
3594
+ <xsl:when test="contains(normalize-space($element), 'block')">
3021
3595
  <fo:block xsl:use-attribute-sets="example-body-style">
3022
3596
  <xsl:apply-templates/>
3023
3597
  </fo:block>
@@ -3054,25 +3628,44 @@
3054
3628
  </xsl:otherwise>
3055
3629
  </xsl:choose>
3056
3630
 
3057
- </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3058
- <fo:block xsl:use-attribute-sets="example-p-style">
3631
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3632
+
3633
+ <xsl:variable name="element">
3634
+ block
3059
3635
 
3060
- <xsl:apply-templates/>
3061
- </fo:block>
3636
+ </xsl:variable>
3637
+ <xsl:choose>
3638
+ <xsl:when test="normalize-space($element) = 'block'">
3639
+ <fo:block xsl:use-attribute-sets="example-p-style">
3640
+
3641
+ <xsl:apply-templates/>
3642
+ </fo:block>
3643
+ </xsl:when>
3644
+ <xsl:otherwise>
3645
+ <fo:inline xsl:use-attribute-sets="example-p-style">
3646
+ <xsl:apply-templates/>
3647
+ </fo:inline>
3648
+ </xsl:otherwise>
3649
+ </xsl:choose>
3062
3650
  </xsl:template><xsl:template match="*[local-name() = 'termsource']">
3063
3651
  <fo:block xsl:use-attribute-sets="termsource-style">
3064
3652
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
3065
3653
  <xsl:variable name="termsource_text">
3066
3654
  <xsl:apply-templates/>
3067
3655
  </xsl:variable>
3656
+
3068
3657
  <xsl:choose>
3069
3658
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
3070
3659
  <xsl:apply-templates/>
3071
3660
  </xsl:when>
3072
- <xsl:otherwise>
3073
- <xsl:text>[</xsl:text>
3074
- <xsl:apply-templates/>
3075
- <xsl:text>]</xsl:text>
3661
+ <xsl:otherwise>
3662
+
3663
+ <xsl:text>[</xsl:text>
3664
+
3665
+ <xsl:apply-templates/>
3666
+
3667
+ <xsl:text>]</xsl:text>
3668
+
3076
3669
  </xsl:otherwise>
3077
3670
  </xsl:choose>
3078
3671
  </fo:block>
@@ -3093,18 +3686,29 @@
3093
3686
  <xsl:if test="normalize-space() != ''">
3094
3687
  <xsl:value-of select="."/>
3095
3688
  </xsl:if>
3096
- </xsl:template><xsl:template match="*[local-name() = 'quote']">
3689
+ </xsl:template><xsl:template match="*[local-name() = 'quote']">
3690
+ <fo:block-container margin-left="0mm">
3691
+ <xsl:if test="parent::*[local-name() = 'note']">
3692
+ <xsl:if test="not(ancestor::*[local-name() = 'table'])">
3693
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
3694
+ </xsl:if>
3695
+ </xsl:if>
3696
+
3697
+ <fo:block-container margin-left="0mm">
3097
3698
 
3098
- <fo:block xsl:use-attribute-sets="quote-style">
3099
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3100
- </fo:block>
3101
- <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3102
- <fo:block xsl:use-attribute-sets="quote-source-style">
3103
- <!-- — ISO, ISO 7301:2011, Clause 1 -->
3104
- <xsl:apply-templates select="*[local-name() = 'author']"/>
3105
- <xsl:apply-templates select="*[local-name() = 'source']"/>
3106
- </fo:block>
3107
- </xsl:if>
3699
+ <fo:block xsl:use-attribute-sets="quote-style">
3700
+ <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3701
+ </fo:block>
3702
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3703
+ <fo:block xsl:use-attribute-sets="quote-source-style">
3704
+ <!-- — ISO, ISO 7301:2011, Clause 1 -->
3705
+ <xsl:apply-templates select="*[local-name() = 'author']"/>
3706
+ <xsl:apply-templates select="*[local-name() = 'source']"/>
3707
+ </fo:block>
3708
+ </xsl:if>
3709
+
3710
+ </fo:block-container>
3711
+ </fo:block-container>
3108
3712
  </xsl:template><xsl:template match="*[local-name() = 'source']">
3109
3713
  <xsl:if test="../*[local-name() = 'author']">
3110
3714
  <xsl:text>, </xsl:text>
@@ -3132,6 +3736,7 @@
3132
3736
  <xsl:if test="@type = 'inline'">
3133
3737
 
3134
3738
 
3739
+
3135
3740
  </xsl:if>
3136
3741
 
3137
3742
 
@@ -3172,6 +3777,7 @@
3172
3777
 
3173
3778
 
3174
3779
 
3780
+
3175
3781
  </xsl:variable>
3176
3782
 
3177
3783
  <xsl:variable name="padding-right">
@@ -3269,6 +3875,7 @@
3269
3875
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
3270
3876
  <fo:block>
3271
3877
  <xsl:call-template name="setId"/>
3878
+
3272
3879
  <xsl:apply-templates/>
3273
3880
  </fo:block>
3274
3881
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
@@ -3293,6 +3900,31 @@
3293
3900
  </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
3294
3901
  <!-- 0xA0 to space replacement -->
3295
3902
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
3903
+ </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
3904
+ <xsl:choose>
3905
+ <xsl:when test="parent::*[local-name() = 'note']">
3906
+ <fo:block-container>
3907
+ <xsl:attribute name="margin-left">
3908
+ <xsl:choose>
3909
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3910
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3911
+ </xsl:choose>
3912
+ </xsl:attribute>
3913
+
3914
+
3915
+ <fo:block-container margin-left="0mm">
3916
+ <fo:block>
3917
+ <xsl:apply-templates select="." mode="ul_ol"/>
3918
+ </fo:block>
3919
+ </fo:block-container>
3920
+ </fo:block-container>
3921
+ </xsl:when>
3922
+ <xsl:otherwise>
3923
+ <fo:block>
3924
+ <xsl:apply-templates select="." mode="ul_ol"/>
3925
+ </fo:block>
3926
+ </xsl:otherwise>
3927
+ </xsl:choose>
3296
3928
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
3297
3929
  <!-- <row>
3298
3930
  <date>05-07-2013</date>
@@ -3324,6 +3956,65 @@
3324
3956
  <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
3325
3957
  <fo:block><xsl:apply-templates/></fo:block>
3326
3958
  </fo:table-cell>
3959
+ </xsl:template><xsl:template name="processBibitem">
3960
+
3961
+
3962
+
3963
+
3964
+ </xsl:template><xsl:template name="processBibitemDocId">
3965
+ <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')]"/>
3966
+ <xsl:choose>
3967
+ <xsl:when test="normalize-space($_doc_ident) != ''">
3968
+ <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"/>
3969
+ <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
3970
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
3971
+ </xsl:if>
3972
+ <xsl:value-of select="$_doc_ident"/>
3973
+ </xsl:when>
3974
+ <xsl:otherwise>
3975
+ <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
3976
+ <xsl:if test="$type != ''">
3977
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
3978
+ </xsl:if>
3979
+ <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
3980
+ </xsl:otherwise>
3981
+ </xsl:choose>
3982
+ </xsl:template><xsl:template name="processPersonalAuthor">
3983
+ <xsl:choose>
3984
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
3985
+ <author>
3986
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
3987
+ </author>
3988
+ </xsl:when>
3989
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
3990
+ <author>
3991
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
3992
+ <xsl:text> </xsl:text>
3993
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
3994
+ </author>
3995
+ </xsl:when>
3996
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']">
3997
+ <author>
3998
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
3999
+ <xsl:text> </xsl:text>
4000
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
4001
+ </author>
4002
+ </xsl:when>
4003
+ <xsl:otherwise>
4004
+ <xsl:apply-templates/>
4005
+ </xsl:otherwise>
4006
+ </xsl:choose>
4007
+ </xsl:template><xsl:template name="renderDate">
4008
+ <xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
4009
+ <xsl:value-of select="*[local-name() = 'on']"/>
4010
+ </xsl:if>
4011
+ <xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
4012
+ <xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
4013
+ </xsl:if>
4014
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
4015
+ <xsl:value-of select="translate(.,'. ','')"/>
4016
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
4017
+ <xsl:value-of select="substring(.,1,1)"/>
3327
4018
  </xsl:template><xsl:template name="convertDate">
3328
4019
  <xsl:param name="date"/>
3329
4020
  <xsl:param name="format" select="'short'"/>
@@ -3404,6 +4095,7 @@
3404
4095
 
3405
4096
 
3406
4097
 
4098
+
3407
4099
  <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title']"/>
3408
4100
 
3409
4101
 
@@ -3422,6 +4114,7 @@
3422
4114
  <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'organization']/*[local-name() = 'name']"/>
3423
4115
 
3424
4116
 
4117
+
3425
4118
  </dc:creator>
3426
4119
  <dc:description>
3427
4120
  <xsl:variable name="abstract">
@@ -3429,6 +4122,7 @@
3429
4122
 
3430
4123
 
3431
4124
 
4125
+
3432
4126
  </xsl:variable>
3433
4127
  <xsl:value-of select="normalize-space($abstract)"/>
3434
4128
  </dc:description>
@@ -3529,6 +4223,7 @@
3529
4223
 
3530
4224
 
3531
4225
 
4226
+
3532
4227
  </xsl:variable>
3533
4228
  <xsl:if test="$documentNS != $XSLNS">
3534
4229
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -3554,4 +4249,21 @@
3554
4249
  </xsl:otherwise>
3555
4250
  </xsl:choose>
3556
4251
  </xsl:attribute>
4252
+ </xsl:template><xsl:template name="add-letter-spacing">
4253
+ <xsl:param name="text"/>
4254
+ <xsl:param name="letter-spacing" select="'0.15'"/>
4255
+ <xsl:if test="string-length($text) &gt; 0">
4256
+ <xsl:variable name="char" select="substring($text, 1, 1)"/>
4257
+ <fo:inline padding-right="{$letter-spacing}mm">
4258
+ <xsl:if test="$char = '®'">
4259
+ <xsl:attribute name="font-size">58%</xsl:attribute>
4260
+ <xsl:attribute name="baseline-shift">30%</xsl:attribute>
4261
+ </xsl:if>
4262
+ <xsl:value-of select="$char"/>
4263
+ </fo:inline>
4264
+ <xsl:call-template name="add-letter-spacing">
4265
+ <xsl:with-param name="text" select="substring($text, 2)"/>
4266
+ <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4267
+ </xsl:call-template>
4268
+ </xsl:if>
3557
4269
  </xsl:template></xsl:stylesheet>