metanorma-un 0.5.1 → 0.5.6

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
 
@@ -920,6 +924,9 @@ h2 p {
920
924
  padding: 0 2em 0 3em;
921
925
  text-align: center; }
922
926
 
927
+ .title-footnote {
928
+ text-align: left; }
929
+
923
930
  .info-section {
924
931
  padding: 0 2em; }
925
932
 
@@ -653,6 +653,10 @@ h2 p {
653
653
  text-align: center;
654
654
  }
655
655
 
656
+ .title-footnote {
657
+ text-align: left;
658
+ }
659
+
656
660
  .info-section {
657
661
  padding: 0 2em;
658
662
  }
@@ -679,7 +679,7 @@ div.WordSection2 {
679
679
  div.WordSection3 {
680
680
  page: WordSection3; }
681
681
 
682
- table.MsoISOTable {
682
+ table.MsoISOTable, table.MsoISOTableBig {
683
683
  mso-style-name: "Table ISO";
684
684
  mso-tstyle-rowband-size: 0;
685
685
  mso-tstyle-colband-size: 0;
@@ -701,15 +701,15 @@ table.MsoISOTable {
701
701
  font-size: 10.0pt;
702
702
  font-family: {{bodyfont}}; }
703
703
 
704
- table.MsoISOTable th {
704
+ table.MsoISOTable th, table.MsoISOTableBig th {
705
705
  border: solid windowtext 1pt;
706
706
  mso-border-alt: solid windowtext 1pt;
707
707
  padding: 0cm 2.85pt 0cm 2.85pt; }
708
708
 
709
- table.MsoISOTable p {
709
+ table.MsoISOTable p, table.MsoISOTableBig p {
710
710
  font-size: 10.0pt; }
711
711
 
712
- table.MsoISOTable td {
712
+ table.MsoISOTable td, table.MsoISOTableBig td {
713
713
  border: solid windowtext 1pt;
714
714
  mso-border-alt: solid windowtext 1pt;
715
715
  padding: 0cm 2.85pt 0cm 2.85pt; }
@@ -799,8 +799,20 @@ div.example p.MsoListParagraph {
799
799
  font-size: 10.0pt; }
800
800
 
801
801
  div.Note p.MsoListParagraph {
802
+ font-size: 10.0pt;
803
+ margin-left: 1.0cm; }
804
+
805
+ div.Note span.stem {
802
806
  font-size: 10.0pt; }
803
807
 
808
+ div.Note p.Sourcecode, div.Note pre.Sourcecode {
809
+ font-size: 8.0pt;
810
+ margin-left: 1.0cm; }
811
+
812
+ div.Note table.dl {
813
+ font-size: 10.0pt;
814
+ margin-left: 1.0cm; }
815
+
804
816
  span.note_label, span.example_label, td.example_label, td.note_label {
805
817
  font-size: 10.0pt;
806
818
  font-family: {{bodyfont}}; }
@@ -662,7 +662,7 @@ div.WordSection2
662
662
  }
663
663
  div.WordSection3
664
664
  {page:WordSection3;}
665
- table.MsoISOTable
665
+ table.MsoISOTable, table.MsoISOTableBig
666
666
  {mso-style-name:"Table ISO";
667
667
  mso-tstyle-rowband-size:0;
668
668
  mso-tstyle-colband-size:0;
@@ -683,13 +683,13 @@ table.MsoISOTable
683
683
  margin-bottom:12pt;
684
684
  font-size:10.0pt;
685
685
  font-family:$bodyfont;}
686
- table.MsoISOTable th
686
+ table.MsoISOTable th, table.MsoISOTableBig th
687
687
  {border:solid windowtext 1pt;
688
688
  mso-border-alt:solid windowtext 1pt;
689
689
  padding:0cm 2.85pt 0cm 2.85pt;}
690
- table.MsoISOTable p
690
+ table.MsoISOTable p, table.MsoISOTableBig p
691
691
  {font-size:10.0pt; }
692
- table.MsoISOTable td
692
+ table.MsoISOTable td, table.MsoISOTableBig td
693
693
  {border:solid windowtext 1pt;
694
694
  mso-border-alt:solid windowtext 1pt;
695
695
  padding:0cm 2.85pt 0cm 2.85pt;}
@@ -778,6 +778,20 @@ div.example p.MsoListParagraph {
778
778
 
779
779
  div.Note p.MsoListParagraph {
780
780
  font-size: 10.0pt;
781
+ margin-left: 1.0cm;
782
+ }
783
+
784
+ div.Note span.stem {
785
+ font-size: 10.0pt; }
786
+
787
+ div.Note p.Sourcecode, div.Note pre.Sourcecode {
788
+ font-size: 8.0pt;
789
+ margin-left: 1.0cm;
790
+ }
791
+
792
+ div.Note table.dl {
793
+ font-size: 10.0pt;
794
+ margin-left: 1.0cm;
781
795
  }
782
796
 
783
797
  span.note_label, span.example_label, td.example_label, td.note_label
@@ -9227,7 +9227,15 @@ style='font-family:"Times New Roman",serif'></span></p>
9227
9227
 
9228
9228
  </div>
9229
9229
 
9230
- <p class="MsoNormal" style='margin-left:70.9pt'><b style='mso-bidi-font-weight:normal'><span lang="EN-AU" style='font-size:16.0pt;mso-bidi-font-size:12.0pt;font-family:"Times New Roman",serif'>{{ doctitle }}</span></b></p>
9230
+ {% assign fn_refs = "" | split: ',' %}
9231
+ {% assign txt = "" %}
9232
+ {% for item in title_footnote %}
9233
+ {% assign txt = txt | append: "*" %}
9234
+ {% assign txtarr = txt | split: "," %}
9235
+ {% assign fn_refs = fn_refs | concat: txtarr %}
9236
+ {% endfor %}
9237
+
9238
+ <p class="MsoNormal" style='margin-left:70.9pt'><b style='mso-bidi-font-weight:normal'><span lang="EN-AU" style='font-size:16.0pt;mso-bidi-font-size:12.0pt;font-family:"Times New Roman",serif'>{{ doctitle }}{% if fn_refs.size > 0 %}<sup>{{ fn_refs | join: "," }}</sup>{% endif %}</span></b></p>
9231
9239
 
9232
9240
  <p class="MsoNormal" style='margin-left:70.9pt'><b style='mso-bidi-font-weight:normal'><span lang="EN-AU" style='font-family:"Times New Roman",serif'>{{ docsubtitle }}</span></b></p>
9233
9241
 
@@ -9292,3 +9300,11 @@ BADzAAAAsQUAAAAA
9292
9300
  </v:textbox>
9293
9301
  <w:wrap type="square"/>
9294
9302
  </v:shape></p>
9303
+
9304
+ {% if fn_refs.size > 0 %}
9305
+ <div class="title-footnote">
9306
+ {% for item in title_footnote %}
9307
+ <p><sup>{{fn_refs[forloop.index0]}}</sup> {{ item }}</p>
9308
+ {% endfor %}
9309
+ </div>
9310
+ {% endif %}
@@ -14,14 +14,30 @@ style='font-family:"Times New Roman",serif'><span style='mso-tab-count:2'> </spa
14
14
  lang=EN-AU style='font-size:10.0pt;mso-bidi-font-size:12.0pt;font-family:"Times New Roman",serif'>{{ doclanguage | join: ", " }} only<o:p></o:p></span></p>
15
15
  {% endif %}
16
16
 
17
+ {% assign fn_refs = "" | split: ',' %}
18
+ {% assign txt = "" %}
19
+ {% for item in title_footnote %}
20
+ {% assign txt = txt | append: "*" %}
21
+ {% assign txtarr = txt | split: "," %}
22
+ {% assign fn_refs = fn_refs | concat: txtarr %}
23
+ {% endfor %}
24
+
17
25
  <p class="MsoNormal" align="center" style='text-align:center;line-height:18.0pt;margin-bottom:0.0pt'><b
18
- style='mso-bidi-font-weight:normal'><span lang="EN-GB" style='font-size:24.0pt'>{{ doctitle }}</span>
26
+ style='mso-bidi-font-weight:normal'><span lang="EN-GB" style='font-size:24.0pt'>{{ doctitle }}{% if fn_refs.size > 0 %}<sup>{{ fn_refs | join: "," }}</sup>{% endif %}</span>
19
27
  </b><br/><span lang="EN-GB" style='font-size:16.0pt'>{{ docsubtitle }}</span></p>
20
28
 
21
29
  <p class="MsoNormal" align="right" style='text-align:right'><b style='mso-bidi-font-weight:
22
30
  normal'><span lang="EN-GB" style='font-size:14.0pt;mso-no-proof:yes'>{{ doctype }} No. {{ docnumber }} {{ draftinfo }}</span></b><b
23
31
  <p class="MsoNormal" style='margin-top:100.0pt'><span lang="EN-GB"><o:p>&nbsp;</o:p></span></p>
24
32
 
33
+ {% if fn_refs.size > 0 %}
34
+ <div class="title-footnote">
35
+ {% for item in title_footnote %}
36
+ <p><sup>{{fn_refs[forloop.index0]}}</sup> {{ item }}</p>
37
+ {% endfor %}
38
+ </div>
39
+ {% endif %}
40
+
25
41
  <p class="MsoNormal" align="center" style='text-align:center'><span lang="EN-GB" style='mso-no-proof:yes'>United Nations</span><br/>
26
42
  <span lang="EN-GB"><span style='mso-no-proof:yes'>New York and Geneva, {{ docyear }}</span></p>
27
43
 
@@ -65,6 +65,7 @@ module IsoDoc
65
65
  def make_body3(body, docxml)
66
66
  body.div **{ class: "main-section" } do |div3|
67
67
  boilerplate docxml, div3
68
+ preface_block docxml, div3
68
69
  abstract docxml, div3
69
70
  foreword docxml, div3
70
71
  introduction docxml, div3
@@ -16,10 +16,10 @@ module IsoDoc
16
16
  def pdf_stylesheet(docxml)
17
17
  case doctype = docxml&.at(ns("//bibdata/ext/doctype"))&.text
18
18
  when "plenary", "agenda", "budgetary"
19
- "unece.plenary.xsl"
19
+ "un.plenary.xsl"
20
20
  else
21
21
  docxml&.at(ns("//bibdata/ext/session/*")) ?
22
- "un.plenary-attachment.xsl" : "unece.recommendation.xsl"
22
+ "un.plenary-attachment.xsl" : "un.recommendation.xsl"
23
23
  end
24
24
  end
25
25
  end
@@ -11,6 +11,7 @@ module IsoDoc
11
11
 
12
12
  def note1(f)
13
13
  return if f.parent.name == "bibitem"
14
+ return if f["type"] == "title-footnote"
14
15
  n = @xrefs.get[f["id"]]
15
16
  lbl = case f["type"]
16
17
  when "source" then "Source"
@@ -16,6 +16,14 @@
16
16
 
17
17
  <xsl:variable name="contents">
18
18
  <contents>
19
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
20
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
21
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name() != 'abstract' and local-name() != 'foreword' and local-name() != 'introduction' and local-name() != 'acknowledgements']" mode="contents"/>
22
+ <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='acknowledgements']" mode="contents"/>
23
+
24
+ <xsl:apply-templates select="/un:un-standard/un:sections/*" mode="contents"/>
25
+ <xsl:apply-templates select="/un:un-standard/un:annex" mode="contents"/>
26
+ <xsl:apply-templates select="/un:un-standard/un:bibliography/un:references" mode="contents"/>
19
27
  </contents>
20
28
  </xsl:variable>
21
29
 
@@ -29,7 +37,7 @@
29
37
 
30
38
  <xsl:template match="/">
31
39
  <xsl:call-template name="namespaceCheck"/>
32
- <fo:root font-family="Times New Roman, STIX2Math, HanSans" font-size="10pt" xml:lang="{$lang}">
40
+ <fo:root font-family="Times New Roman, STIX Two Math, HanSans" font-size="10pt" xml:lang="{$lang}">
33
41
  <fo:layout-master-set>
34
42
  <!-- Cover page -->
35
43
  <fo:simple-page-master master-name="cover-page" page-width="{$pageWidth}" page-height="{$pageHeight}">
@@ -66,6 +74,10 @@
66
74
 
67
75
  <xsl:call-template name="addPDFUAmeta"/>
68
76
 
77
+ <xsl:call-template name="addBookmarks">
78
+ <xsl:with-param name="contents" select="$contents"/>
79
+ </xsl:call-template>
80
+
69
81
  <!-- Cover Page -->
70
82
  <fo:page-sequence master-reference="cover-page" force-page-count="no-force">
71
83
  <fo:flow flow-name="xsl-region-body">
@@ -164,7 +176,7 @@
164
176
 
165
177
  <xsl:apply-templates select="/un:un-standard/un:preface/un:abstract"/>
166
178
 
167
- <xsl:variable name="charsToRemove" select="concat($upper, $lower, '.()~!@#$%^*-+')"/>
179
+ <xsl:variable name="charsToRemove" select="concat($upper, $lower, '.()~!@#$%^*-+:')"/>
168
180
  <xsl:variable name="code" select="translate(/un:un-standard/un:bibdata/un:docidentifier, $charsToRemove,'')"/>
169
181
 
170
182
  <fo:block-container absolute-position="fixed" left="20mm" top="258mm" width="30mm" text-align="center">
@@ -173,20 +185,22 @@
173
185
  </fo:block>
174
186
 
175
187
  <fo:block padding-top="1mm">
176
- <fo:instream-foreign-object fox:alt-text="Barcode">
177
- <barcode:barcode message="{$code}">
178
- <barcode:code39>
179
- <barcode:height>8.5mm</barcode:height>
180
- <barcode:module-width>0.24mm</barcode:module-width>
181
- <barcode:human-readable>
182
- <barcode:placement>none</barcode:placement>
183
- <!--<barcode:pattern>* _ _ _ _ _ _ _ _ _ *</barcode:pattern>
184
- <barcode:font-name>Arial</barcode:font-name>
185
- <barcode:font-size>9.7pt</barcode:font-size> -->
186
- </barcode:human-readable>
187
- </barcode:code39>
188
- </barcode:barcode>
189
- </fo:instream-foreign-object>
188
+ <xsl:if test="normalize-space($code) != ''">
189
+ <fo:instream-foreign-object fox:alt-text="Barcode">
190
+ <barcode:barcode message="{$code}">
191
+ <barcode:code39>
192
+ <barcode:height>8.5mm</barcode:height>
193
+ <barcode:module-width>0.24mm</barcode:module-width>
194
+ <barcode:human-readable>
195
+ <barcode:placement>none</barcode:placement>
196
+ <!--<barcode:pattern>* _ _ _ _ _ _ _ _ _ *</barcode:pattern>
197
+ <barcode:font-name>Arial</barcode:font-name>
198
+ <barcode:font-size>9.7pt</barcode:font-size> -->
199
+ </barcode:human-readable>
200
+ </barcode:code39>
201
+ </barcode:barcode>
202
+ </fo:instream-foreign-object>
203
+ </xsl:if>
190
204
  </fo:block>
191
205
  <fo:block padding-top="-0.8mm" text-align="left" font-family="Arial" font-size="8pt" letter-spacing="1.8mm">
192
206
  <xsl:value-of select="concat('*', $code, '*')"/>
@@ -200,14 +214,16 @@
200
214
  </fo:block-container>
201
215
  <fo:block-container absolute-position="fixed" left="170mm" top="253mm">
202
216
  <fo:block>
203
- <fo:instream-foreign-object fox:alt-text="Barcode">
204
- <barcode:barcode message="{concat('http://undocs.org/', /un:un-standard/un:bibdata/un:ext/un:session/un:id)}">
205
- <barcode:qr>
206
- <barcode:module-width>0.55mm</barcode:module-width>
207
- <barcode:ec-level>M</barcode:ec-level>
208
- </barcode:qr>
209
- </barcode:barcode>
210
- </fo:instream-foreign-object>
217
+ <xsl:if test="normalize-space(/un:un-standard/un:bibdata/un:ext/un:session/un:id) != ''">
218
+ <fo:instream-foreign-object fox:alt-text="Barcode">
219
+ <barcode:barcode message="{concat('http://undocs.org/', /un:un-standard/un:bibdata/un:ext/un:session/un:id)}">
220
+ <barcode:qr>
221
+ <barcode:module-width>0.55mm</barcode:module-width>
222
+ <barcode:ec-level>M</barcode:ec-level>
223
+ </barcode:qr>
224
+ </barcode:barcode>
225
+ </fo:instream-foreign-object>
226
+ </xsl:if>
211
227
  </fo:block>
212
228
  </fo:block-container>
213
229
 
@@ -262,6 +278,65 @@
262
278
  </xsl:template>
263
279
 
264
280
 
281
+
282
+ <!-- ============================= -->
283
+ <!-- CONTENTS -->
284
+ <!-- ============================= -->
285
+ <xsl:template match="node()" mode="contents">
286
+ <xsl:apply-templates mode="contents"/>
287
+ </xsl:template>
288
+
289
+ <!-- element with title -->
290
+ <xsl:template match="*[un:title]" mode="contents">
291
+ <xsl:variable name="level">
292
+ <xsl:call-template name="getLevel">
293
+ <xsl:with-param name="depth" select="un:title/@depth"/>
294
+ </xsl:call-template>
295
+ </xsl:variable>
296
+
297
+ <xsl:variable name="display">
298
+ <xsl:choose>
299
+ <xsl:when test="$level &gt; 3">false</xsl:when>
300
+ <xsl:otherwise>true</xsl:otherwise>
301
+ </xsl:choose>
302
+ </xsl:variable>
303
+
304
+ <xsl:variable name="skip">
305
+ <xsl:choose>
306
+ <xsl:when test="ancestor-or-self::un:bibitem">true</xsl:when>
307
+ <xsl:when test="ancestor-or-self::un:term">true</xsl:when>
308
+ <xsl:when test="@inline-header = 'true'">true</xsl:when>
309
+ <xsl:otherwise>false</xsl:otherwise>
310
+ </xsl:choose>
311
+ </xsl:variable>
312
+
313
+ <xsl:if test="$skip = 'false'">
314
+
315
+ <xsl:variable name="section">
316
+ <xsl:call-template name="getSection"/>
317
+ </xsl:variable>
318
+
319
+ <xsl:variable name="title">
320
+ <xsl:call-template name="getName"/>
321
+ </xsl:variable>
322
+
323
+ <xsl:variable name="type">
324
+ <xsl:value-of select="local-name()"/>
325
+ </xsl:variable>
326
+
327
+ <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" display="{$display}">
328
+ <title>
329
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
330
+ </title>
331
+ <xsl:apply-templates mode="contents"/>
332
+ </item>
333
+ </xsl:if>
334
+
335
+ </xsl:template>
336
+ <xsl:template match="un:references[not(@normative='true')]/un:bibitem" mode="contents"/>
337
+ <!-- ============================= -->
338
+ <!-- ============================= -->
339
+
265
340
 
266
341
  <!-- ============================= -->
267
342
  <!-- PARAGRAPHS -->
@@ -465,7 +540,7 @@
465
540
  </fo:block>
466
541
  </xsl:template>
467
542
 
468
- <xsl:template match="un:ul | un:ol">
543
+ <xsl:template match="un:ul | un:ol" mode="ul_ol">
469
544
  <fo:block-container margin-left="8mm" text-indent="0mm">
470
545
  <fo:list-block provisional-distance-between-starts="4mm" margin-left="-8mm">
471
546
  <xsl:apply-templates/>
@@ -475,13 +550,18 @@
475
550
  </xsl:template>
476
551
 
477
552
  <xsl:template match="un:ul//un:note | un:ol//un:note" priority="2"/>
478
- <xsl:template match="un:ul//un:note/un:p | un:ol//un:note/un:p" mode="process">
479
- <fo:block font-size="11pt" margin-top="4pt">
553
+ <xsl:template match="un:ul//un:note/un:name | un:ol//un:note/un:name" mode="process" priority="2"/>
554
+ <xsl:template match="un:ul//un:note/un:p | un:ol//un:note/un:p" mode="process" priority="2">
555
+ <fo:block margin-top="4pt">
480
556
  <xsl:apply-templates select="../un:name" mode="presentation"/>
481
557
  <xsl:apply-templates/>
482
558
  </fo:block>
483
559
  </xsl:template>
484
560
 
561
+ <xsl:template match="un:ul//un:note/* | un:ol//un:note/*" mode="process">
562
+ <xsl:apply-templates select="."/>
563
+ </xsl:template>
564
+
485
565
  <xsl:template match="un:li">
486
566
  <xsl:variable name="level">
487
567
  <xsl:call-template name="getLevel"/>
@@ -829,31 +909,45 @@
829
909
  <xsl:template match="un:docidentifier"/>
830
910
 
831
911
 
832
- <xsl:template match="un:formula" name="formula-un" priority="2">
833
- <fo:block id="{@id}" margin-top="6pt">
834
- <fo:table table-layout="fixed" width="100%">
835
- <fo:table-column column-width="95%"/>
836
- <fo:table-column column-width="5%"/>
837
- <fo:table-body>
838
- <fo:table-row>
839
- <fo:table-cell>
840
- <fo:block text-align="center">
841
- <xsl:if test="ancestor::un:annex">
842
- <xsl:attribute name="text-align">left</xsl:attribute>
843
- <xsl:attribute name="margin-left">7mm</xsl:attribute>
844
- </xsl:if>
845
- <xsl:apply-templates/>
846
- </fo:block>
847
- </fo:table-cell>
848
- <fo:table-cell> <!-- display-align="center" -->
849
- <fo:block text-align="right">
850
- <xsl:apply-templates select="un:name" mode="presentation"/>
851
- </fo:block>
852
- </fo:table-cell>
853
- </fo:table-row>
854
- </fo:table-body>
855
- </fo:table>
856
- </fo:block>
912
+ <xsl:template match="un:formula" name="formula-un" priority="2">
913
+ <fo:block-container margin-left="0mm">
914
+ <xsl:if test="parent::*[local-name() = 'note']">
915
+ <xsl:attribute name="margin-left">
916
+ <xsl:choose>
917
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
918
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
919
+ </xsl:choose>
920
+ </xsl:attribute>
921
+ </xsl:if>
922
+ <fo:block-container margin-left="0mm">
923
+
924
+ <fo:block id="{@id}" margin-top="6pt">
925
+ <fo:table table-layout="fixed" width="100%">
926
+ <fo:table-column column-width="95%"/>
927
+ <fo:table-column column-width="5%"/>
928
+ <fo:table-body>
929
+ <fo:table-row>
930
+ <fo:table-cell>
931
+ <fo:block text-align="center">
932
+ <xsl:if test="ancestor::un:annex">
933
+ <xsl:attribute name="text-align">left</xsl:attribute>
934
+ <xsl:attribute name="margin-left">7mm</xsl:attribute>
935
+ </xsl:if>
936
+ <xsl:apply-templates/>
937
+ </fo:block>
938
+ </fo:table-cell>
939
+ <fo:table-cell> <!-- display-align="center" -->
940
+ <fo:block text-align="right">
941
+ <xsl:apply-templates select="un:name" mode="presentation"/>
942
+ </fo:block>
943
+ </fo:table-cell>
944
+ </fo:table-row>
945
+ </fo:table-body>
946
+ </fo:table>
947
+ </fo:block>
948
+
949
+ </fo:block-container>
950
+ </fo:block-container>
857
951
  </xsl:template>
858
952
 
859
953
 
@@ -873,9 +967,23 @@
873
967
  </xsl:template>
874
968
 
875
969
  <xsl:template match="un:dl" priority="2">
876
- <fo:block line-height="122%" margin-bottom="6pt" text-indent="0mm" text-align="justify">
877
- <xsl:apply-templates/>
878
- </fo:block>
970
+ <fo:block-container margin-left="0mm">
971
+ <xsl:if test="parent::*[local-name() = 'note']">
972
+ <xsl:attribute name="margin-left">
973
+ <xsl:choose>
974
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
975
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
976
+ </xsl:choose>
977
+ </xsl:attribute>
978
+ </xsl:if>
979
+ <fo:block-container margin-left="0mm">
980
+
981
+ <fo:block line-height="122%" margin-bottom="6pt" text-indent="0mm" text-align="justify">
982
+ <xsl:apply-templates/>
983
+ </fo:block>
984
+
985
+ </fo:block-container>
986
+ </fo:block-container>
879
987
  </xsl:template>
880
988
 
881
989
  <xsl:template match="un:dt" priority="2">
@@ -1071,13 +1179,22 @@
1071
1179
 
1072
1180
  </title-edition>
1073
1181
 
1182
+ <title-edition lang="fr">
1183
+
1184
+ <xsl:text>Édition </xsl:text>
1185
+
1186
+ </title-edition>
1187
+
1074
1188
 
1075
1189
  <title-toc lang="en">
1076
1190
 
1077
1191
 
1078
1192
 
1079
1193
  </title-toc>
1080
- <title-toc lang="fr">Sommaire</title-toc>
1194
+ <title-toc lang="fr">
1195
+
1196
+
1197
+ </title-toc>
1081
1198
 
1082
1199
  <title-toc lang="zh">Contents</title-toc>
1083
1200
 
@@ -1111,7 +1228,12 @@
1111
1228
 
1112
1229
 
1113
1230
 
1114
- <title-source lang="en">SOURCE</title-source>
1231
+ <title-source lang="en">
1232
+
1233
+ <xsl:text>SOURCE</xsl:text>
1234
+
1235
+
1236
+ </title-source>
1115
1237
 
1116
1238
  <title-keywords lang="en">Keywords</title-keywords>
1117
1239
 
@@ -1154,12 +1276,25 @@
1154
1276
  <title-warning lang="zh">警告</title-warning>
1155
1277
 
1156
1278
  <title-amendment lang="en">AMENDMENT</title-amendment>
1279
+
1280
+ <title-continued lang="en">(continued)</title-continued>
1281
+ <title-continued lang="fr">(continué)</title-continued>
1282
+
1157
1283
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
1158
1284
  <xsl:param name="name"/>
1159
- <xsl:variable name="lang">
1160
- <xsl:call-template name="getLang"/>
1285
+ <xsl:param name="lang"/>
1286
+ <xsl:variable name="lang_">
1287
+ <xsl:choose>
1288
+ <xsl:when test="$lang != ''">
1289
+ <xsl:value-of select="$lang"/>
1290
+ </xsl:when>
1291
+ <xsl:otherwise>
1292
+ <xsl:call-template name="getLang"/>
1293
+ </xsl:otherwise>
1294
+ </xsl:choose>
1161
1295
  </xsl:variable>
1162
- <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/>
1296
+ <xsl:variable name="language" select="normalize-space($lang_)"/>
1297
+ <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $language]"/>
1163
1298
  <xsl:choose>
1164
1299
  <xsl:when test="normalize-space($title_) != ''">
1165
1300
  <xsl:value-of select="$title_"/>
@@ -1168,7 +1303,10 @@
1168
1303
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
1169
1304
  </xsl:otherwise>
1170
1305
  </xsl:choose>
1171
- </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">
1306
+ </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">
1307
+
1308
+ </xsl:attribute-set><xsl:attribute-set name="link-style">
1309
+
1172
1310
 
1173
1311
 
1174
1312
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
@@ -1179,14 +1317,14 @@
1179
1317
 
1180
1318
 
1181
1319
 
1182
- <xsl:attribute name="font-family">Courier</xsl:attribute>
1183
- <xsl:attribute name="font-size">10pt</xsl:attribute>
1320
+ <xsl:attribute name="font-family">Courier</xsl:attribute>
1184
1321
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
1185
1322
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1186
1323
 
1187
1324
 
1188
1325
 
1189
1326
 
1327
+
1190
1328
  </xsl:attribute-set><xsl:attribute-set name="permission-style">
1191
1329
 
1192
1330
  </xsl:attribute-set><xsl:attribute-set name="permission-name-style">
@@ -1228,6 +1366,7 @@
1228
1366
 
1229
1367
 
1230
1368
 
1369
+
1231
1370
  </xsl:attribute-set><xsl:attribute-set name="example-body-style">
1232
1371
 
1233
1372
 
@@ -1247,6 +1386,7 @@
1247
1386
 
1248
1387
 
1249
1388
 
1389
+
1250
1390
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1251
1391
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1252
1392
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -1299,6 +1439,7 @@
1299
1439
 
1300
1440
 
1301
1441
 
1442
+
1302
1443
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
1303
1444
 
1304
1445
 
@@ -1309,11 +1450,13 @@
1309
1450
 
1310
1451
  </xsl:attribute-set><xsl:attribute-set name="xref-style">
1311
1452
 
1312
-
1453
+
1454
+
1313
1455
  </xsl:attribute-set><xsl:attribute-set name="eref-style">
1314
1456
 
1315
1457
 
1316
1458
 
1459
+
1317
1460
  <xsl:attribute name="color">blue</xsl:attribute>
1318
1461
 
1319
1462
  </xsl:attribute-set><xsl:attribute-set name="note-style">
@@ -1327,14 +1470,15 @@
1327
1470
 
1328
1471
 
1329
1472
 
1473
+
1330
1474
 
1331
1475
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1332
1476
 
1333
1477
 
1334
1478
 
1479
+ </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">
1335
1480
 
1336
1481
 
1337
- </xsl:attribute-set><xsl:attribute-set name="note-name-style">
1338
1482
 
1339
1483
 
1340
1484
 
@@ -1343,10 +1487,10 @@
1343
1487
 
1344
1488
 
1345
1489
 
1346
-
1347
1490
 
1348
1491
  <xsl:attribute name="padding-right">4mm</xsl:attribute>
1349
1492
 
1493
+
1350
1494
  </xsl:attribute-set><xsl:attribute-set name="note-p-style">
1351
1495
 
1352
1496
 
@@ -1372,6 +1516,8 @@
1372
1516
  <xsl:attribute name="margin-top">4pt</xsl:attribute>
1373
1517
 
1374
1518
 
1519
+ </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
1520
+
1375
1521
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
1376
1522
 
1377
1523
 
@@ -1392,6 +1538,7 @@
1392
1538
  </xsl:attribute-set><xsl:attribute-set name="origin-style">
1393
1539
 
1394
1540
 
1541
+
1395
1542
  </xsl:attribute-set><xsl:attribute-set name="term-style">
1396
1543
 
1397
1544
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
@@ -1408,6 +1555,7 @@
1408
1555
 
1409
1556
 
1410
1557
 
1558
+
1411
1559
  <xsl:attribute name="text-align">center</xsl:attribute>
1412
1560
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
1413
1561
  <xsl:attribute name="keep-with-previous">always</xsl:attribute>
@@ -1444,11 +1592,14 @@
1444
1592
  </xsl:attribute-set><xsl:attribute-set name="tt-style">
1445
1593
 
1446
1594
 
1595
+
1447
1596
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-name-style">
1448
1597
  <xsl:attribute name="font-size">11pt</xsl:attribute>
1449
1598
  <xsl:attribute name="font-weight">bold</xsl:attribute>
1450
1599
  <xsl:attribute name="text-align">center</xsl:attribute>
1451
1600
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
1601
+ <xsl:attribute name="keep-with-previous">always</xsl:attribute>
1602
+
1452
1603
  </xsl:attribute-set><xsl:attribute-set name="domain-style">
1453
1604
 
1454
1605
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
@@ -1512,6 +1663,10 @@
1512
1663
 
1513
1664
 
1514
1665
 
1666
+
1667
+
1668
+ <!-- $namespace = 'iso' or -->
1669
+
1515
1670
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1516
1671
 
1517
1672
 
@@ -1547,6 +1702,7 @@
1547
1702
  <xsl:with-param name="table" select="$simple-table"/>
1548
1703
  </xsl:call-template>
1549
1704
  </xsl:variable>
1705
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
1550
1706
 
1551
1707
  <!-- <xsl:variable name="colwidths2">
1552
1708
  <xsl:call-template name="calculate-column-widths">
@@ -1568,30 +1724,54 @@
1568
1724
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
1569
1725
 
1570
1726
 
1571
-
1727
+
1728
+
1572
1729
 
1573
1730
  <xsl:attribute name="margin-bottom">18pt</xsl:attribute>
1731
+ <xsl:attribute name="font-size">8pt</xsl:attribute>
1732
+
1574
1733
 
1575
1734
 
1735
+
1576
1736
 
1577
1737
 
1578
1738
 
1579
1739
 
1580
- <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">
1581
-
1582
-
1583
-
1740
+
1741
+
1742
+
1743
+ <xsl:variable name="table_attributes">
1744
+ <attribute name="table-layout">fixed</attribute>
1745
+ <attribute name="width">100%</attribute>
1746
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
1747
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
1584
1748
 
1585
1749
 
1586
1750
 
1587
1751
 
1752
+
1753
+
1588
1754
 
1589
- <xsl:attribute name="border-top">0.5pt solid black</xsl:attribute>
1590
- <xsl:attribute name="font-size">8pt</xsl:attribute>
1755
+ <attribute name="border-top">0.5pt solid black</attribute>
1756
+
1591
1757
 
1758
+
1592
1759
 
1760
+ </xsl:variable>
1761
+
1762
+
1763
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
1593
1764
 
1765
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
1766
+ <xsl:attribute name="{@name}">
1767
+ <xsl:value-of select="."/>
1768
+ </xsl:attribute>
1769
+ </xsl:for-each>
1594
1770
 
1771
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
1772
+ <xsl:if test="$isNoteOrFnExist = 'true'">
1773
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
1774
+ </xsl:if>
1595
1775
 
1596
1776
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
1597
1777
  <xsl:choose>
@@ -1615,6 +1795,33 @@
1615
1795
 
1616
1796
  </fo:table>
1617
1797
 
1798
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
1799
+ <xsl:call-template name="insertTableFooterInSeparateTable">
1800
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
1801
+ <xsl:with-param name="colwidths" select="$colwidths"/>
1802
+ </xsl:call-template>
1803
+ </xsl:for-each>
1804
+
1805
+ <!-- insert footer as table -->
1806
+ <!-- <fo:table>
1807
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
1808
+ <xsl:attribute name="{@name}">
1809
+ <xsl:value-of select="."/>
1810
+ </xsl:attribute>
1811
+ </xsl:for-each>
1812
+
1813
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
1814
+ <xsl:choose>
1815
+ <xsl:when test=". = 1 or . = 0">
1816
+ <fo:table-column column-width="proportional-column-width(2)"/>
1817
+ </xsl:when>
1818
+ <xsl:otherwise>
1819
+ <fo:table-column column-width="proportional-column-width({.})"/>
1820
+ </xsl:otherwise>
1821
+ </xsl:choose>
1822
+ </xsl:for-each>
1823
+ </fo:table>-->
1824
+
1618
1825
 
1619
1826
 
1620
1827
 
@@ -1623,8 +1830,9 @@
1623
1830
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
1624
1831
  <xsl:if test="normalize-space() != ''">
1625
1832
  <fo:block xsl:use-attribute-sets="table-name-style">
1626
- <xsl:apply-templates/>
1627
- </fo:block>
1833
+
1834
+ <xsl:apply-templates/>
1835
+ </fo:block>
1628
1836
  </xsl:if>
1629
1837
  </xsl:template><xsl:template name="calculate-columns-numbers">
1630
1838
  <xsl:param name="table-row"/>
@@ -1678,6 +1886,13 @@
1678
1886
  <xsl:for-each select="xalan:nodeset($table)//tr">
1679
1887
  <xsl:variable name="td_text">
1680
1888
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
1889
+
1890
+ <!-- <xsl:if test="$namespace = 'bipm'">
1891
+ <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
1892
+ <word><xsl:value-of select="normalize-space(.)"/></word>
1893
+ </xsl:for-each>
1894
+ </xsl:if> -->
1895
+
1681
1896
  </xsl:variable>
1682
1897
  <xsl:variable name="words">
1683
1898
  <xsl:variable name="string_with_added_zerospaces">
@@ -1737,13 +1952,31 @@
1737
1952
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
1738
1953
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
1739
1954
  <xsl:value-of select="@target"/>
1955
+ </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
1956
+ <xsl:variable name="math_text" select="normalize-space(.)"/>
1957
+ <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
1740
1958
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
1741
1959
  <xsl:param name="cols-count"/>
1742
1960
  <!-- font-weight="bold" -->
1743
- <fo:table-header>
1961
+ <fo:table-header>
1744
1962
 
1745
1963
  <xsl:apply-templates/>
1746
1964
  </fo:table-header>
1965
+ </xsl:template><xsl:template name="table-header-title">
1966
+ <xsl:param name="cols-count"/>
1967
+ <!-- row for title -->
1968
+ <fo:table-row>
1969
+ <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">
1970
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
1971
+ <xsl:for-each select="ancestor::*[local-name()='table'][1]">
1972
+ <xsl:call-template name="fn_name_display"/>
1973
+ </xsl:for-each>
1974
+ <fo:block text-align="right" font-style="italic">
1975
+ <xsl:text> </xsl:text>
1976
+ <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
1977
+ </fo:block>
1978
+ </fo:table-cell>
1979
+ </fo:table-row>
1747
1980
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
1748
1981
  <fo:table-body>
1749
1982
  <xsl:apply-templates/>
@@ -1751,6 +1984,13 @@
1751
1984
  </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
1752
1985
  <xsl:apply-templates/>
1753
1986
  </xsl:template><xsl:template name="insertTableFooter">
1987
+ <xsl:param name="cols-count"/>
1988
+ <xsl:if test="../*[local-name()='tfoot']">
1989
+ <fo:table-footer>
1990
+ <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
1991
+ </fo:table-footer>
1992
+ </xsl:if>
1993
+ </xsl:template><xsl:template name="insertTableFooter2">
1754
1994
  <xsl:param name="cols-count"/>
1755
1995
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
1756
1996
  <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
@@ -1772,11 +2012,29 @@
1772
2012
  <!-- fn will be processed inside 'note' processing -->
1773
2013
 
1774
2014
 
2015
+
2016
+
2017
+
2018
+
1775
2019
  <!-- except gb -->
1776
2020
 
1777
2021
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
1778
2022
 
1779
2023
 
2024
+ <!-- show Note under table in preface (ex. abstract) sections -->
2025
+ <!-- empty, because notes show at page side in main sections -->
2026
+ <!-- <xsl:if test="$namespace = 'bipm'">
2027
+ <xsl:choose>
2028
+ <xsl:when test="ancestor::*[local-name()='preface']">
2029
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2030
+ </xsl:when>
2031
+ <xsl:otherwise>
2032
+ <fo:block/>
2033
+ </xsl:otherwise>
2034
+ </xsl:choose>
2035
+ </xsl:if> -->
2036
+
2037
+
1780
2038
  <!-- horizontal row separator -->
1781
2039
 
1782
2040
 
@@ -1790,6 +2048,88 @@
1790
2048
  </fo:table-footer>
1791
2049
 
1792
2050
  </xsl:if>
2051
+ </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
2052
+ <xsl:param name="table_attributes"/>
2053
+ <xsl:param name="colwidths"/>
2054
+
2055
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
2056
+
2057
+ <xsl:if test="$isNoteOrFnExist = 'true'">
2058
+
2059
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
2060
+
2061
+ <fo:table keep-with-previous="always">
2062
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
2063
+ <xsl:choose>
2064
+ <xsl:when test="@name = 'border-top'">
2065
+ <xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
2066
+ </xsl:when>
2067
+ <xsl:when test="@name = 'border'">
2068
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
2069
+ <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
2070
+ </xsl:when>
2071
+ <xsl:otherwise>
2072
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
2073
+ </xsl:otherwise>
2074
+ </xsl:choose>
2075
+ </xsl:for-each>
2076
+
2077
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2078
+ <xsl:choose>
2079
+ <xsl:when test=". = 1 or . = 0">
2080
+ <fo:table-column column-width="proportional-column-width(2)"/>
2081
+ </xsl:when>
2082
+ <xsl:otherwise>
2083
+ <fo:table-column column-width="proportional-column-width({.})"/>
2084
+ </xsl:otherwise>
2085
+ </xsl:choose>
2086
+ </xsl:for-each>
2087
+
2088
+ <fo:table-body>
2089
+ <fo:table-row>
2090
+ <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
2091
+
2092
+
2093
+
2094
+ <!-- fn will be processed inside 'note' processing -->
2095
+
2096
+
2097
+
2098
+
2099
+
2100
+
2101
+
2102
+ <!-- except gb -->
2103
+
2104
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2105
+
2106
+
2107
+ <!-- <xsl:if test="$namespace = 'bipm'">
2108
+ <xsl:choose>
2109
+ <xsl:when test="ancestor::*[local-name()='preface']">
2110
+ show Note under table in preface (ex. abstract) sections
2111
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2112
+ </xsl:when>
2113
+ <xsl:otherwise>
2114
+ empty, because notes show at page side in main sections
2115
+ <fo:block/>
2116
+ </xsl:otherwise>
2117
+ </xsl:choose>
2118
+ </xsl:if> -->
2119
+
2120
+
2121
+ <!-- horizontal row separator -->
2122
+
2123
+
2124
+ <!-- fn processing -->
2125
+ <xsl:call-template name="fn_display"/>
2126
+
2127
+ </fo:table-cell>
2128
+ </fo:table-row>
2129
+ </fo:table-body>
2130
+
2131
+ </fo:table>
2132
+ </xsl:if>
1793
2133
  </xsl:template><xsl:template match="*[local-name()='tbody']">
1794
2134
 
1795
2135
  <xsl:variable name="cols-count">
@@ -1807,6 +2147,8 @@
1807
2147
  </xsl:choose>
1808
2148
  </xsl:variable>
1809
2149
 
2150
+
2151
+
1810
2152
  <xsl:apply-templates select="../*[local-name()='thead']" mode="process">
1811
2153
  <xsl:with-param name="cols-count" select="$cols-count"/>
1812
2154
  </xsl:apply-templates>
@@ -1816,6 +2158,8 @@
1816
2158
  </xsl:call-template>
1817
2159
 
1818
2160
  <fo:table-body>
2161
+
2162
+
1819
2163
  <xsl:apply-templates/>
1820
2164
  <!-- <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/> -->
1821
2165
 
@@ -1843,6 +2187,11 @@
1843
2187
  <xsl:attribute name="min-height">8mm</xsl:attribute>
1844
2188
  </xsl:if>
1845
2189
 
2190
+
2191
+ <!-- <xsl:if test="$namespace = 'bipm'">
2192
+ <xsl:attribute name="height">8mm</xsl:attribute>
2193
+ </xsl:if> -->
2194
+
1846
2195
  <xsl:apply-templates/>
1847
2196
  </fo:table-row>
1848
2197
  </xsl:template><xsl:template match="*[local-name()='th']">
@@ -1863,6 +2212,7 @@
1863
2212
 
1864
2213
 
1865
2214
 
2215
+
1866
2216
  <xsl:attribute name="display-align">center</xsl:attribute>
1867
2217
  <xsl:attribute name="font-style">italic</xsl:attribute>
1868
2218
  <xsl:attribute name="font-weight">normal</xsl:attribute>
@@ -1874,6 +2224,7 @@
1874
2224
  <xsl:attribute name="text-indent">0mm</xsl:attribute>
1875
2225
 
1876
2226
 
2227
+
1877
2228
  <xsl:if test="@colspan">
1878
2229
  <xsl:attribute name="number-columns-spanned">
1879
2230
  <xsl:value-of select="@colspan"/>
@@ -1884,10 +2235,22 @@
1884
2235
  <xsl:value-of select="@rowspan"/>
1885
2236
  </xsl:attribute>
1886
2237
  </xsl:if>
2238
+ <xsl:call-template name="display-align"/>
1887
2239
  <fo:block>
1888
2240
  <xsl:apply-templates/>
1889
2241
  </fo:block>
1890
2242
  </fo:table-cell>
2243
+ </xsl:template><xsl:template name="display-align">
2244
+ <xsl:if test="@valign">
2245
+ <xsl:attribute name="display-align">
2246
+ <xsl:choose>
2247
+ <xsl:when test="@valign = 'top'">before</xsl:when>
2248
+ <xsl:when test="@valign = 'middle'">center</xsl:when>
2249
+ <xsl:when test="@valign = 'bottom'">after</xsl:when>
2250
+ <xsl:otherwise>before</xsl:otherwise>
2251
+ </xsl:choose>
2252
+ </xsl:attribute>
2253
+ </xsl:if>
1891
2254
  </xsl:template><xsl:template match="*[local-name()='td']">
1892
2255
  <fo:table-cell text-align="{@align}" display-align="center" border="solid black 1pt" padding-left="1mm">
1893
2256
  <xsl:attribute name="text-align">
@@ -1901,7 +2264,8 @@
1901
2264
 
1902
2265
 
1903
2266
 
1904
-
2267
+
2268
+
1905
2269
 
1906
2270
 
1907
2271
 
@@ -1915,6 +2279,7 @@
1915
2279
  <xsl:attribute name="text-indent">0mm</xsl:attribute>
1916
2280
 
1917
2281
 
2282
+
1918
2283
  <xsl:if test="@colspan">
1919
2284
  <xsl:attribute name="number-columns-spanned">
1920
2285
  <xsl:value-of select="@colspan"/>
@@ -1925,8 +2290,8 @@
1925
2290
  <xsl:value-of select="@rowspan"/>
1926
2291
  </xsl:attribute>
1927
2292
  </xsl:if>
1928
- <fo:block>
1929
-
2293
+ <xsl:call-template name="display-align"/>
2294
+ <fo:block>
1930
2295
  <xsl:apply-templates/>
1931
2296
  </fo:block>
1932
2297
  </fo:table-cell>
@@ -1938,6 +2303,8 @@
1938
2303
 
1939
2304
 
1940
2305
 
2306
+
2307
+
1941
2308
  <fo:inline padding-right="2mm">
1942
2309
 
1943
2310
 
@@ -1952,10 +2319,11 @@
1952
2319
  </fo:inline> -->
1953
2320
  </xsl:if>
1954
2321
 
1955
-
2322
+
1956
2323
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
1957
2324
 
1958
2325
  </fo:inline>
2326
+
1959
2327
  <xsl:apply-templates mode="process"/>
1960
2328
  </fo:block>
1961
2329
 
@@ -1979,6 +2347,7 @@
1979
2347
 
1980
2348
 
1981
2349
 
2350
+
1982
2351
  <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
1983
2352
 
1984
2353
  <xsl:attribute name="vertical-align">super</xsl:attribute>
@@ -1988,12 +2357,15 @@
1988
2357
 
1989
2358
 
1990
2359
 
2360
+
1991
2361
  <xsl:value-of select="@reference"/>
1992
2362
 
2363
+
1993
2364
  </fo:inline>
1994
2365
  <fo:inline>
1995
2366
 
1996
- <xsl:apply-templates/>
2367
+ <!-- <xsl:apply-templates /> -->
2368
+ <xsl:copy-of select="./node()"/>
1997
2369
  </fo:inline>
1998
2370
  </fo:block>
1999
2371
  </xsl:if>
@@ -2030,7 +2402,20 @@
2030
2402
  <xsl:variable name="following_dl_colwidths">
2031
2403
  <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
2032
2404
  <xsl:variable name="html-table">
2033
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2405
+ <xsl:variable name="doc_ns">
2406
+
2407
+ </xsl:variable>
2408
+ <xsl:variable name="ns">
2409
+ <xsl:choose>
2410
+ <xsl:when test="normalize-space($doc_ns) != ''">
2411
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2412
+ </xsl:when>
2413
+ <xsl:otherwise>
2414
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2415
+ </xsl:otherwise>
2416
+ </xsl:choose>
2417
+ </xsl:variable>
2418
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2034
2419
  <xsl:element name="{$ns}:table">
2035
2420
  <xsl:for-each select="*[local-name() = 'dl'][1]">
2036
2421
  <tbody>
@@ -2095,7 +2480,8 @@
2095
2480
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
2096
2481
  </xsl:if>
2097
2482
 
2098
- <xsl:apply-templates/>
2483
+ <!-- <xsl:apply-templates /> -->
2484
+ <xsl:copy-of select="./node()"/>
2099
2485
  </fo:block>
2100
2486
  </fo:table-cell>
2101
2487
  </fo:table-row>
@@ -2113,9 +2499,13 @@
2113
2499
 
2114
2500
 
2115
2501
 
2502
+
2503
+
2116
2504
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
2117
2505
 
2506
+
2118
2507
  <xsl:value-of select="@reference"/>
2508
+
2119
2509
  </fo:basic-link>
2120
2510
  </fo:inline>
2121
2511
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -2123,115 +2513,142 @@
2123
2513
  <xsl:apply-templates/>
2124
2514
  </fo:inline>
2125
2515
  </xsl:template><xsl:template match="*[local-name()='dl']">
2126
- <xsl:variable name="parent" select="local-name(..)"/>
2127
-
2128
- <xsl:variable name="key_iso">
2129
- <!-- and (not(../@class) or ../@class !='pseudocode') -->
2130
- </xsl:variable>
2131
-
2132
- <xsl:choose>
2133
- <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
2134
-
2135
-
2136
- <fo:block margin-bottom="12pt" text-align="left">
2137
-
2138
- <xsl:variable name="title-where">
2139
- <xsl:call-template name="getTitle">
2140
- <xsl:with-param name="name" select="'title-where'"/>
2141
- </xsl:call-template>
2142
- </xsl:variable>
2143
- <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2144
- <xsl:apply-templates select="*[local-name()='dt']/*"/>
2145
- <xsl:text/>
2146
- <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
2147
- </fo:block>
2148
-
2149
- </xsl:when>
2150
- <xsl:when test="$parent = 'formula'"> <!-- a few components -->
2151
- <fo:block margin-bottom="12pt" text-align="left">
2152
-
2153
-
2154
-
2155
-
2156
- <xsl:variable name="title-where">
2157
- <xsl:call-template name="getTitle">
2158
- <xsl:with-param name="name" select="'title-where'"/>
2159
- </xsl:call-template>
2160
- </xsl:variable>
2161
- <xsl:value-of select="$title-where"/>
2162
- </fo:block>
2163
- </xsl:when>
2164
- <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
2165
- <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
2166
-
2167
-
2168
-
2169
- <xsl:variable name="title-key">
2170
- <xsl:call-template name="getTitle">
2171
- <xsl:with-param name="name" select="'title-key'"/>
2172
- </xsl:call-template>
2173
- </xsl:variable>
2174
- <xsl:value-of select="$title-key"/>
2175
- </fo:block>
2176
- </xsl:when>
2177
- </xsl:choose>
2178
-
2179
- <!-- a few components -->
2180
- <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
2181
- <fo:block>
2516
+ <fo:block-container margin-left="0mm">
2517
+ <xsl:if test="parent::*[local-name() = 'note']">
2518
+ <xsl:attribute name="margin-left">
2519
+ <xsl:choose>
2520
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
2521
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
2522
+ </xsl:choose>
2523
+ </xsl:attribute>
2182
2524
 
2525
+ </xsl:if>
2526
+ <fo:block-container margin-left="0mm">
2527
+
2528
+ <xsl:variable name="parent" select="local-name(..)"/>
2183
2529
 
2530
+ <xsl:variable name="key_iso">
2531
+ <!-- and (not(../@class) or ../@class !='pseudocode') -->
2532
+ </xsl:variable>
2184
2533
 
2534
+ <xsl:choose>
2535
+ <xsl:when test="$parent = 'formula' and count(*[local-name()='dt']) = 1"> <!-- only one component -->
2536
+
2537
+
2538
+ <fo:block margin-bottom="12pt" text-align="left">
2539
+
2540
+ <xsl:variable name="title-where">
2541
+ <xsl:call-template name="getTitle">
2542
+ <xsl:with-param name="name" select="'title-where'"/>
2543
+ </xsl:call-template>
2544
+ </xsl:variable>
2545
+ <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
2546
+ <xsl:apply-templates select="*[local-name()='dt']/*"/>
2547
+ <xsl:text/>
2548
+ <xsl:apply-templates select="*[local-name()='dd']/*" mode="inline"/>
2549
+ </fo:block>
2550
+
2551
+ </xsl:when>
2552
+ <xsl:when test="$parent = 'formula'"> <!-- a few components -->
2553
+ <fo:block margin-bottom="12pt" text-align="left">
2554
+
2555
+
2556
+
2557
+
2558
+ <xsl:variable name="title-where">
2559
+ <xsl:call-template name="getTitle">
2560
+ <xsl:with-param name="name" select="'title-where'"/>
2561
+ </xsl:call-template>
2562
+ </xsl:variable>
2563
+ <xsl:value-of select="$title-where"/>
2564
+ </fo:block>
2565
+ </xsl:when>
2566
+ <xsl:when test="$parent = 'figure' and (not(../@class) or ../@class !='pseudocode')">
2567
+ <fo:block font-weight="bold" text-align="left" margin-bottom="12pt" keep-with-next="always">
2568
+
2569
+
2570
+
2571
+ <xsl:variable name="title-key">
2572
+ <xsl:call-template name="getTitle">
2573
+ <xsl:with-param name="name" select="'title-key'"/>
2574
+ </xsl:call-template>
2575
+ </xsl:variable>
2576
+ <xsl:value-of select="$title-key"/>
2577
+ </fo:block>
2578
+ </xsl:when>
2579
+ </xsl:choose>
2185
2580
 
2186
- <fo:block>
2187
-
2188
-
2189
-
2190
-
2191
- <fo:table width="95%" table-layout="fixed">
2581
+ <!-- a few components -->
2582
+ <xsl:if test="not($parent = 'formula' and count(*[local-name()='dt']) = 1)">
2583
+ <fo:block>
2192
2584
 
2193
- <xsl:choose>
2194
- <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
2195
- <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
2196
- </xsl:when>
2197
- <xsl:when test="normalize-space($key_iso) = 'true'">
2198
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2585
+
2586
+
2587
+
2588
+ <fo:block>
2589
+
2590
+
2591
+
2592
+
2593
+ <fo:table width="95%" table-layout="fixed">
2199
2594
 
2200
- </xsl:when>
2201
- </xsl:choose>
2202
- <!-- create virtual html table for dl/[dt and dd] -->
2203
- <xsl:variable name="html-table">
2204
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
2205
- <xsl:element name="{$ns}:table">
2206
- <tbody>
2207
- <xsl:apply-templates mode="dl"/>
2208
- </tbody>
2209
- </xsl:element>
2210
- </xsl:variable>
2211
- <!-- html-table<xsl:copy-of select="$html-table"/> -->
2212
- <xsl:variable name="colwidths">
2213
- <xsl:call-template name="calculate-column-widths">
2214
- <xsl:with-param name="cols-count" select="2"/>
2215
- <xsl:with-param name="table" select="$html-table"/>
2216
- </xsl:call-template>
2217
- </xsl:variable>
2218
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2219
- <xsl:variable name="maxlength_dt">
2220
- <xsl:call-template name="getMaxLength_dt"/>
2221
- </xsl:variable>
2222
- <xsl:call-template name="setColumnWidth_dl">
2223
- <xsl:with-param name="colwidths" select="$colwidths"/>
2224
- <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2225
- </xsl:call-template>
2226
- <fo:table-body>
2227
- <xsl:apply-templates>
2228
- <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
2229
- </xsl:apply-templates>
2230
- </fo:table-body>
2231
- </fo:table>
2232
- </fo:block>
2233
- </fo:block>
2234
- </xsl:if>
2595
+ <xsl:choose>
2596
+ <xsl:when test="normalize-space($key_iso) = 'true' and $parent = 'formula'">
2597
+ <!-- <xsl:attribute name="font-size">11pt</xsl:attribute> -->
2598
+ </xsl:when>
2599
+ <xsl:when test="normalize-space($key_iso) = 'true'">
2600
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2601
+
2602
+ </xsl:when>
2603
+ </xsl:choose>
2604
+ <!-- create virtual html table for dl/[dt and dd] -->
2605
+ <xsl:variable name="html-table">
2606
+ <xsl:variable name="doc_ns">
2607
+
2608
+ </xsl:variable>
2609
+ <xsl:variable name="ns">
2610
+ <xsl:choose>
2611
+ <xsl:when test="normalize-space($doc_ns) != ''">
2612
+ <xsl:value-of select="normalize-space($doc_ns)"/>
2613
+ </xsl:when>
2614
+ <xsl:otherwise>
2615
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
2616
+ </xsl:otherwise>
2617
+ </xsl:choose>
2618
+ </xsl:variable>
2619
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
2620
+ <xsl:element name="{$ns}:table">
2621
+ <tbody>
2622
+ <xsl:apply-templates mode="dl"/>
2623
+ </tbody>
2624
+ </xsl:element>
2625
+ </xsl:variable>
2626
+ <!-- html-table<xsl:copy-of select="$html-table"/> -->
2627
+ <xsl:variable name="colwidths">
2628
+ <xsl:call-template name="calculate-column-widths">
2629
+ <xsl:with-param name="cols-count" select="2"/>
2630
+ <xsl:with-param name="table" select="$html-table"/>
2631
+ </xsl:call-template>
2632
+ </xsl:variable>
2633
+ <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
2634
+ <xsl:variable name="maxlength_dt">
2635
+ <xsl:call-template name="getMaxLength_dt"/>
2636
+ </xsl:variable>
2637
+ <xsl:call-template name="setColumnWidth_dl">
2638
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2639
+ <xsl:with-param name="maxlength_dt" select="$maxlength_dt"/>
2640
+ </xsl:call-template>
2641
+ <fo:table-body>
2642
+ <xsl:apply-templates>
2643
+ <xsl:with-param name="key_iso" select="normalize-space($key_iso)"/>
2644
+ </xsl:apply-templates>
2645
+ </fo:table-body>
2646
+ </fo:table>
2647
+ </fo:block>
2648
+ </fo:block>
2649
+ </xsl:if>
2650
+ </fo:block-container>
2651
+ </fo:block-container>
2235
2652
  </xsl:template><xsl:template name="setColumnWidth_dl">
2236
2653
  <xsl:param name="colwidths"/>
2237
2654
  <xsl:param name="maxlength_dt"/>
@@ -2328,6 +2745,7 @@
2328
2745
  <xsl:param name="key_iso"/>
2329
2746
 
2330
2747
  <fo:table-row>
2748
+
2331
2749
  <fo:table-cell>
2332
2750
 
2333
2751
  <fo:block margin-top="6pt">
@@ -2342,6 +2760,7 @@
2342
2760
 
2343
2761
 
2344
2762
 
2763
+
2345
2764
  <xsl:apply-templates/>
2346
2765
  <!-- <xsl:if test="$namespace = 'gb'">
2347
2766
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -2353,14 +2772,36 @@
2353
2772
  <fo:table-cell>
2354
2773
  <fo:block>
2355
2774
 
2356
-
2775
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2776
+ <xsl:if test="local-name(*[1]) != 'stem'">
2777
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2778
+ </xsl:if>
2779
+ </xsl:if> -->
2357
2780
 
2358
2781
  <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2359
2782
 
2360
2783
  </fo:block>
2361
2784
  </fo:table-cell>
2362
2785
  </fo:table-row>
2363
-
2786
+ <!-- <xsl:if test="$namespace = 'nist-cswp' or $namespace = 'nist-sp'">
2787
+ <xsl:if test="local-name(*[1]) = 'stem'">
2788
+ <fo:table-row>
2789
+ <fo:table-cell>
2790
+ <fo:block margin-top="6pt">
2791
+ <xsl:if test="normalize-space($key_iso) = 'true'">
2792
+ <xsl:attribute name="margin-top">0</xsl:attribute>
2793
+ </xsl:if>
2794
+ <xsl:text>&#xA0;</xsl:text>
2795
+ </fo:block>
2796
+ </fo:table-cell>
2797
+ <fo:table-cell>
2798
+ <fo:block>
2799
+ <xsl:apply-templates select="following-sibling::*[local-name()='dd'][1]" mode="process"/>
2800
+ </fo:block>
2801
+ </fo:table-cell>
2802
+ </fo:table-row>
2803
+ </xsl:if>
2804
+ </xsl:if> -->
2364
2805
  </xsl:template><xsl:template match="*[local-name()='dd']" mode="dl"/><xsl:template match="*[local-name()='dd']" mode="dl_process">
2365
2806
  <xsl:apply-templates/>
2366
2807
  </xsl:template><xsl:template match="*[local-name()='dd']"/><xsl:template match="*[local-name()='dd']" mode="process">
@@ -2385,6 +2826,31 @@
2385
2826
  </fo:inline>
2386
2827
  </xsl:template><xsl:template match="*[local-name()='tt']">
2387
2828
  <fo:inline xsl:use-attribute-sets="tt-style">
2829
+ <xsl:variable name="_font-size">
2830
+
2831
+
2832
+
2833
+
2834
+
2835
+
2836
+
2837
+
2838
+
2839
+
2840
+
2841
+
2842
+
2843
+
2844
+ </xsl:variable>
2845
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
2846
+ <xsl:if test="$font-size != ''">
2847
+ <xsl:attribute name="font-size">
2848
+ <xsl:choose>
2849
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
2850
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
2851
+ </xsl:choose>
2852
+ </xsl:attribute>
2853
+ </xsl:if>
2388
2854
  <xsl:apply-templates/>
2389
2855
  </fo:inline>
2390
2856
  </xsl:template><xsl:template match="*[local-name()='del']">
@@ -2710,11 +3176,24 @@
2710
3176
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
2711
3177
  <xsl:value-of select="substring($str, 2)"/>
2712
3178
  </xsl:template><xsl:template match="mathml:math">
2713
- <fo:inline font-family="STIX2Math">
2714
- <fo:instream-foreign-object fox:alt-text="Math">
2715
- <xsl:copy-of select="."/>
2716
- </fo:instream-foreign-object>
3179
+ <fo:inline font-family="STIX Two Math"> <!-- -->
3180
+ <xsl:variable name="mathml">
3181
+ <xsl:apply-templates select="." mode="mathml"/>
3182
+ </xsl:variable>
3183
+ <fo:instream-foreign-object fox:alt-text="Math">
3184
+ <!-- <xsl:copy-of select="."/> -->
3185
+ <xsl:copy-of select="xalan:nodeset($mathml)"/>
3186
+ </fo:instream-foreign-object>
2717
3187
  </fo:inline>
3188
+ </xsl:template><xsl:template match="@*|node()" mode="mathml">
3189
+ <xsl:copy>
3190
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
3191
+ </xsl:copy>
3192
+ </xsl:template><xsl:template match="mathml:mtext" mode="mathml">
3193
+ <xsl:copy>
3194
+ <!-- replace start and end spaces to non-break space -->
3195
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
3196
+ </xsl:copy>
2718
3197
  </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
2719
3198
  <xsl:variable name="target">
2720
3199
  <xsl:choose>
@@ -2791,13 +3270,26 @@
2791
3270
  <xsl:apply-templates/>
2792
3271
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
2793
3272
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
2794
-
3273
+
2795
3274
  <xsl:apply-templates/>
2796
3275
  </fo:basic-link>
2797
3276
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
2798
- <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
2799
- <xsl:apply-templates/>
2800
- </fo:block>
3277
+ <fo:block-container margin-left="0mm">
3278
+ <xsl:if test="parent::*[local-name() = 'note']">
3279
+ <xsl:attribute name="margin-left">
3280
+ <xsl:choose>
3281
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3282
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3283
+ </xsl:choose>
3284
+ </xsl:attribute>
3285
+
3286
+ </xsl:if>
3287
+ <fo:block-container margin-left="0mm">
3288
+ <fo:block id="{@id}" xsl:use-attribute-sets="formula-style">
3289
+ <xsl:apply-templates/>
3290
+ </fo:block>
3291
+ </fo:block-container>
3292
+ </fo:block-container>
2801
3293
  </xsl:template><xsl:template match="*[local-name() = 'formula']/*[local-name() = 'dt']/*[local-name() = 'stem']">
2802
3294
  <fo:inline>
2803
3295
  <xsl:apply-templates/>
@@ -2840,6 +3332,8 @@
2840
3332
 
2841
3333
 
2842
3334
 
3335
+
3336
+
2843
3337
  <fo:inline xsl:use-attribute-sets="note-name-style">
2844
3338
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
2845
3339
  </fo:inline>
@@ -2866,7 +3360,9 @@
2866
3360
  </xsl:choose>
2867
3361
  </xsl:template><xsl:template match="*[local-name() = 'termnote']">
2868
3362
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
2869
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3363
+ <fo:inline xsl:use-attribute-sets="termnote-name-style">
3364
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3365
+ </fo:inline>
2870
3366
  <xsl:apply-templates/>
2871
3367
  </fo:block>
2872
3368
  </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">
@@ -2965,15 +3461,109 @@
2965
3461
 
2966
3462
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
2967
3463
  </fo:block>
2968
- </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">
3464
+ </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">
2969
3465
  <xsl:apply-templates mode="contents"/>
2970
3466
  <xsl:text> </xsl:text>
2971
- </xsl:template><xsl:template match="text()" mode="contents">
3467
+ </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">
3468
+ <xsl:apply-templates mode="bookmarks"/>
3469
+ <xsl:text> </xsl:text>
3470
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
3471
+ <xsl:value-of select="."/>
3472
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
2972
3473
  <xsl:value-of select="."/>
2973
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
3474
+ </xsl:template><xsl:template match="node()" mode="contents">
3475
+ <xsl:apply-templates mode="contents"/>
3476
+ </xsl:template><xsl:template match="node()" mode="bookmarks">
3477
+ <xsl:apply-templates mode="bookmarks"/>
3478
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
3479
+ <xsl:apply-templates select="."/>
3480
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
3481
+ <xsl:apply-templates mode="bookmarks"/>
3482
+ </xsl:template><xsl:template name="addBookmarks">
3483
+ <xsl:param name="contents"/>
3484
+ <xsl:if test="xalan:nodeset($contents)//item">
3485
+ <fo:bookmark-tree>
3486
+ <xsl:choose>
3487
+ <xsl:when test="xalan:nodeset($contents)/doc">
3488
+ <xsl:choose>
3489
+ <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
3490
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3491
+ <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
3492
+ <fo:bookmark-title>
3493
+ <xsl:variable name="bookmark-title_">
3494
+ <xsl:call-template name="getLangVersion">
3495
+ <xsl:with-param name="lang" select="@lang"/>
3496
+ </xsl:call-template>
3497
+ </xsl:variable>
3498
+ <xsl:choose>
3499
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
3500
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
3501
+ </xsl:when>
3502
+ <xsl:otherwise>
3503
+ <xsl:choose>
3504
+ <xsl:when test="@lang = 'en'">English</xsl:when>
3505
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
3506
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
3507
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
3508
+ </xsl:choose>
3509
+ </xsl:otherwise>
3510
+ </xsl:choose>
3511
+ </fo:bookmark-title>
3512
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3513
+ </fo:bookmark>
3514
+
3515
+ </xsl:for-each>
3516
+ </xsl:when>
3517
+ <xsl:otherwise>
3518
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
3519
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
3520
+ </xsl:for-each>
3521
+ </xsl:otherwise>
3522
+ </xsl:choose>
3523
+ </xsl:when>
3524
+ <xsl:otherwise>
3525
+ <xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
3526
+ </xsl:otherwise>
3527
+ </xsl:choose>
3528
+
3529
+
3530
+
3531
+
3532
+
3533
+
3534
+
3535
+
3536
+ </fo:bookmark-tree>
3537
+ </xsl:if>
3538
+ </xsl:template><xsl:template name="getLangVersion">
3539
+ <xsl:param name="lang"/>
3540
+ <xsl:choose>
3541
+ <xsl:when test="$lang = 'en'">
3542
+
3543
+
3544
+ </xsl:when>
3545
+ <xsl:when test="$lang = 'fr'">
3546
+
3547
+
3548
+ </xsl:when>
3549
+ <xsl:when test="$lang = 'de'">Deutsche</xsl:when>
3550
+ <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
3551
+ </xsl:choose>
3552
+ </xsl:template><xsl:template match="item" mode="bookmark">
3553
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
3554
+ <fo:bookmark-title>
3555
+ <xsl:if test="@section != ''">
3556
+ <xsl:value-of select="@section"/>
3557
+ <xsl:text> </xsl:text>
3558
+ </xsl:if>
3559
+ <xsl:value-of select="normalize-space(title)"/>
3560
+ </fo:bookmark-title>
3561
+ <xsl:apply-templates mode="bookmark"/>
3562
+ </fo:bookmark>
3563
+ </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">
2974
3564
  <xsl:if test="normalize-space() != ''">
2975
3565
  <fo:block xsl:use-attribute-sets="figure-name-style">
2976
-
3566
+
2977
3567
  <xsl:apply-templates/>
2978
3568
  </fo:block>
2979
3569
  </xsl:if>
@@ -3028,7 +3618,7 @@
3028
3618
  <xsl:apply-templates/>
3029
3619
  </xsl:otherwise>
3030
3620
  </xsl:choose>
3031
- </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">
3621
+ </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">
3032
3622
  <xsl:text> </xsl:text>
3033
3623
  </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
3034
3624
  <xsl:copy>
@@ -3037,21 +3627,61 @@
3037
3627
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
3038
3628
  <xsl:text> </xsl:text>
3039
3629
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
3040
- <fo:block xsl:use-attribute-sets="sourcecode-style">
3041
- <xsl:apply-templates/>
3042
- </fo:block>
3043
- <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3044
- </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()">
3630
+
3631
+ <fo:block-container margin-left="0mm">
3632
+ <xsl:if test="parent::*[local-name() = 'note']">
3633
+ <xsl:attribute name="margin-left">
3634
+ <xsl:choose>
3635
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
3636
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
3637
+ </xsl:choose>
3638
+ </xsl:attribute>
3639
+
3640
+ </xsl:if>
3641
+ <fo:block-container margin-left="0mm">
3642
+
3643
+ <fo:block xsl:use-attribute-sets="sourcecode-style">
3644
+ <xsl:variable name="_font-size">
3645
+
3646
+
3647
+
3648
+
3649
+
3650
+
3651
+
3652
+
3653
+
3654
+
3655
+
3656
+
3657
+
3658
+ 10
3659
+ </xsl:variable>
3660
+ <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
3661
+ <xsl:if test="$font-size != ''">
3662
+ <xsl:attribute name="font-size">
3663
+ <xsl:choose>
3664
+ <xsl:when test="ancestor::*[local-name()='note']"><xsl:value-of select="$font-size * 0.91"/>pt</xsl:when>
3665
+ <xsl:otherwise><xsl:value-of select="$font-size"/>pt</xsl:otherwise>
3666
+ </xsl:choose>
3667
+ </xsl:attribute>
3668
+ </xsl:if>
3669
+ <xsl:apply-templates/>
3670
+ </fo:block>
3671
+ <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3672
+
3673
+ </fo:block-container>
3674
+ </fo:block-container>
3675
+ </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
3045
3676
  <xsl:variable name="text">
3046
3677
  <xsl:call-template name="add-zero-spaces-equal"/>
3047
3678
  </xsl:variable>
3048
- <xsl:call-template name="add-zero-spaces">
3679
+ <xsl:call-template name="add-zero-spaces-java">
3049
3680
  <xsl:with-param name="text" select="$text"/>
3050
3681
  </xsl:call-template>
3051
3682
  </xsl:template><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'sourcecode']/*[local-name() = 'name']" mode="presentation">
3052
3683
  <xsl:if test="normalize-space() != ''">
3053
- <fo:block xsl:use-attribute-sets="sourcecode-name-style">
3054
-
3684
+ <fo:block xsl:use-attribute-sets="sourcecode-name-style">
3055
3685
  <xsl:apply-templates/>
3056
3686
  </fo:block>
3057
3687
  </xsl:if>
@@ -3121,22 +3751,30 @@
3121
3751
  </fo:block>
3122
3752
  </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3123
3753
  <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
3754
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3755
+ <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
3756
+ </xsl:if>
3124
3757
  <fo:block-container margin-left="0mm" margin-right="0mm">
3125
- <fo:table id="{@id}" table-layout="fixed" width="100%" border="0pt solid black">
3758
+ <fo:table id="{@id}" table-layout="fixed" width="100%"> <!-- border="1pt solid black" -->
3759
+ <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3760
+ <!-- <xsl:attribute name="border">0.5pt solid black</xsl:attribute> -->
3761
+ </xsl:if>
3126
3762
  <xsl:variable name="simple-table">
3127
3763
  <xsl:call-template name="getSimpleTable"/>
3128
3764
  </xsl:variable>
3129
3765
  <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
3130
3766
  <xsl:if test="$cols-count = 2 and not(ancestor::*[local-name()='table'])">
3131
- <fo:table-column column-width="35mm"/>
3132
- <fo:table-column column-width="115mm"/>
3767
+ <!-- <fo:table-column column-width="35mm"/>
3768
+ <fo:table-column column-width="115mm"/> -->
3769
+ <fo:table-column column-width="30%"/>
3770
+ <fo:table-column column-width="70%"/>
3133
3771
  </xsl:if>
3134
3772
  <xsl:apply-templates mode="requirement"/>
3135
3773
  </fo:table>
3136
3774
  <!-- fn processing -->
3137
3775
  <xsl:if test=".//*[local-name() = 'fn']">
3138
3776
  <xsl:for-each select="*[local-name() = 'tbody']">
3139
- <fo:block font-size="90%" border-bottom="1.pt solid black">
3777
+ <fo:block font-size="90%" border-bottom="1pt solid black">
3140
3778
  <xsl:call-template name="fn_display"/>
3141
3779
  </fo:block>
3142
3780
  </xsl:for-each>
@@ -3152,17 +3790,27 @@
3152
3790
  <xsl:apply-templates mode="requirement"/>
3153
3791
  </fo:table-body>
3154
3792
  </xsl:template><xsl:template match="*[local-name()='tr']" mode="requirement">
3155
- <fo:table-row>
3793
+ <fo:table-row height="7mm" border-bottom="0.5pt solid grey">
3794
+ <xsl:if test="parent::*[local-name()='thead']"> <!-- and not(ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']) -->
3795
+ <!-- <xsl:attribute name="border">1pt solid black</xsl:attribute> -->
3796
+ <xsl:attribute name="background-color">rgb(33, 55, 92)</xsl:attribute>
3797
+ </xsl:if>
3798
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Requirement ')">
3799
+ <xsl:attribute name="background-color">rgb(252, 246, 222)</xsl:attribute>
3800
+ </xsl:if>
3801
+ <xsl:if test="starts-with(*[local-name()='td'][1], 'Recommendation ')">
3802
+ <xsl:attribute name="background-color">rgb(233, 235, 239)</xsl:attribute>
3803
+ </xsl:if>
3156
3804
  <xsl:apply-templates mode="requirement"/>
3157
3805
  </fo:table-row>
3158
3806
  </xsl:template><xsl:template match="*[local-name()='th']" mode="requirement">
3159
- <fo:table-cell text-align="{@align}">
3807
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
3160
3808
  <xsl:attribute name="text-align">
3161
3809
  <xsl:choose>
3162
3810
  <xsl:when test="@align">
3163
3811
  <xsl:value-of select="@align"/>
3164
3812
  </xsl:when>
3165
- <xsl:otherwise>center</xsl:otherwise>
3813
+ <xsl:otherwise>left</xsl:otherwise>
3166
3814
  </xsl:choose>
3167
3815
  </xsl:attribute>
3168
3816
  <xsl:if test="@colspan">
@@ -3175,22 +3823,27 @@
3175
3823
  <xsl:value-of select="@rowspan"/>
3176
3824
  </xsl:attribute>
3177
3825
  </xsl:if>
3826
+ <xsl:call-template name="display-align"/>
3178
3827
 
3179
- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3828
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3180
3829
  <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3181
3830
  <xsl:attribute name="background-color">rgb(165, 165, 165)</xsl:attribute>
3182
3831
  </xsl:if>
3183
3832
  <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommendtest'">
3184
3833
  <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3185
3834
  <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
3186
- </xsl:if>
3835
+ </xsl:if> -->
3187
3836
 
3188
3837
  <fo:block>
3189
3838
  <xsl:apply-templates/>
3190
3839
  </fo:block>
3191
3840
  </fo:table-cell>
3192
3841
  </xsl:template><xsl:template match="*[local-name()='td']" mode="requirement">
3193
- <fo:table-cell text-align="{@align}">
3842
+ <fo:table-cell text-align="{@align}" display-align="center" padding="1mm" padding-left="2mm"> <!-- border="0.5pt solid black" -->
3843
+ <xsl:if test="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
3844
+ <xsl:attribute name="padding">0mm</xsl:attribute>
3845
+ <xsl:attribute name="padding-left">0mm</xsl:attribute>
3846
+ </xsl:if>
3194
3847
  <xsl:attribute name="text-align">
3195
3848
  <xsl:choose>
3196
3849
  <xsl:when test="@align">
@@ -3199,6 +3852,9 @@
3199
3852
  <xsl:otherwise>left</xsl:otherwise>
3200
3853
  </xsl:choose>
3201
3854
  </xsl:attribute>
3855
+ <xsl:if test="following-sibling::*[local-name()='td'] and not(preceding-sibling::*[local-name()='td'])">
3856
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
3857
+ </xsl:if>
3202
3858
  <xsl:if test="@colspan">
3203
3859
  <xsl:attribute name="number-columns-spanned">
3204
3860
  <xsl:value-of select="@colspan"/>
@@ -3209,25 +3865,27 @@
3209
3865
  <xsl:value-of select="@rowspan"/>
3210
3866
  </xsl:attribute>
3211
3867
  </xsl:if>
3868
+ <xsl:call-template name="display-align"/>
3212
3869
 
3213
- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3870
+ <!-- <xsl:if test="ancestor::*[local-name()='table']/@type = 'recommend'">
3214
3871
  <xsl:attribute name="padding-left">0.5mm</xsl:attribute>
3215
- <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3216
- <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])"> <!-- 2nd line and below -->
3872
+ <xsl:attribute name="padding-top">0.5mm</xsl:attribute>
3873
+ <xsl:if test="parent::*[local-name()='tr']/preceding-sibling::*[local-name()='tr'] and not(*[local-name()='table'])">
3217
3874
  <xsl:attribute name="background-color">rgb(201, 201, 201)</xsl:attribute>
3218
3875
  </xsl:if>
3219
- </xsl:if>
3876
+ </xsl:if> -->
3877
+ <!-- 2nd line and below -->
3220
3878
 
3221
3879
  <fo:block>
3222
3880
  <xsl:apply-templates/>
3223
3881
  </fo:block>
3224
3882
  </fo:table-cell>
3225
3883
  </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
3226
- <fo:block font-size="11pt" font-weight="bold" text-align="center" margin-bottom="4pt">
3884
+ <fo:block font-size="11pt" color="rgb(237, 193, 35)"> <!-- font-weight="bold" margin-bottom="4pt" text-align="center" -->
3227
3885
  <xsl:apply-templates/>
3228
3886
  </fo:block>
3229
- </xsl:template><xsl:template match="*[local-name() = 'p'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
3230
- <fo:block margin-bottom="10pt">
3887
+ </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
3888
+ <fo:block> <!-- margin-bottom="10pt" -->
3231
3889
  <xsl:apply-templates/>
3232
3890
  </fo:block>
3233
3891
  </xsl:template><xsl:template match="*[local-name() = 'termexample']">
@@ -3249,12 +3907,13 @@
3249
3907
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
3250
3908
 
3251
3909
  <xsl:variable name="element">
3252
- block
3910
+ block
3253
3911
 
3912
+ <xsl:if test=".//*[local-name() = 'table']">block</xsl:if>
3254
3913
  </xsl:variable>
3255
3914
 
3256
3915
  <xsl:choose>
3257
- <xsl:when test="normalize-space($element) = 'block'">
3916
+ <xsl:when test="contains(normalize-space($element), 'block')">
3258
3917
  <fo:block xsl:use-attribute-sets="example-body-style">
3259
3918
  <xsl:apply-templates/>
3260
3919
  </fo:block>
@@ -3291,30 +3950,49 @@
3291
3950
  </xsl:otherwise>
3292
3951
  </xsl:choose>
3293
3952
 
3294
- </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3295
- <fo:block xsl:use-attribute-sets="example-p-style">
3296
-
3297
- <xsl:variable name="num"><xsl:number/></xsl:variable>
3298
- <xsl:if test="$num = 1">
3299
- <xsl:attribute name="margin-left">5mm</xsl:attribute>
3300
- </xsl:if>
3953
+ </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
3954
+
3955
+ <xsl:variable name="element">
3956
+ block
3301
3957
 
3302
- <xsl:apply-templates/>
3303
- </fo:block>
3958
+ </xsl:variable>
3959
+ <xsl:choose>
3960
+ <xsl:when test="normalize-space($element) = 'block'">
3961
+ <fo:block xsl:use-attribute-sets="example-p-style">
3962
+
3963
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
3964
+ <xsl:if test="$num = 1">
3965
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
3966
+ </xsl:if>
3967
+
3968
+ <xsl:apply-templates/>
3969
+ </fo:block>
3970
+ </xsl:when>
3971
+ <xsl:otherwise>
3972
+ <fo:inline xsl:use-attribute-sets="example-p-style">
3973
+ <xsl:apply-templates/>
3974
+ </fo:inline>
3975
+ </xsl:otherwise>
3976
+ </xsl:choose>
3304
3977
  </xsl:template><xsl:template match="*[local-name() = 'termsource']">
3305
3978
  <fo:block xsl:use-attribute-sets="termsource-style">
3306
3979
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
3307
3980
  <xsl:variable name="termsource_text">
3308
3981
  <xsl:apply-templates/>
3309
3982
  </xsl:variable>
3983
+
3310
3984
  <xsl:choose>
3311
3985
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
3312
3986
  <xsl:apply-templates/>
3313
3987
  </xsl:when>
3314
- <xsl:otherwise>
3315
- <xsl:text>[</xsl:text>
3316
- <xsl:apply-templates/>
3317
- <xsl:text>]</xsl:text>
3988
+ <xsl:otherwise>
3989
+
3990
+ <xsl:text>[</xsl:text>
3991
+
3992
+ <xsl:apply-templates/>
3993
+
3994
+ <xsl:text>]</xsl:text>
3995
+
3318
3996
  </xsl:otherwise>
3319
3997
  </xsl:choose>
3320
3998
  </fo:block>
@@ -3335,18 +4013,29 @@
3335
4013
  <xsl:if test="normalize-space() != ''">
3336
4014
  <xsl:value-of select="."/>
3337
4015
  </xsl:if>
3338
- </xsl:template><xsl:template match="*[local-name() = 'quote']">
4016
+ </xsl:template><xsl:template match="*[local-name() = 'quote']">
4017
+ <fo:block-container margin-left="0mm">
4018
+ <xsl:if test="parent::*[local-name() = 'note']">
4019
+ <xsl:if test="not(ancestor::*[local-name() = 'table'])">
4020
+ <xsl:attribute name="margin-left">5mm</xsl:attribute>
4021
+ </xsl:if>
4022
+ </xsl:if>
4023
+
4024
+ <fo:block-container margin-left="0mm">
3339
4025
 
3340
- <fo:block xsl:use-attribute-sets="quote-style">
3341
- <xsl:apply-templates select=".//*[local-name() = 'p']"/>
3342
- </fo:block>
3343
- <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
3344
- <fo:block xsl:use-attribute-sets="quote-source-style">
3345
- <!-- — ISO, ISO 7301:2011, Clause 1 -->
3346
- <xsl:apply-templates select="*[local-name() = 'author']"/>
3347
- <xsl:apply-templates select="*[local-name() = 'source']"/>
3348
- </fo:block>
3349
- </xsl:if>
4026
+ <fo:block xsl:use-attribute-sets="quote-style">
4027
+ <xsl:apply-templates select=".//*[local-name() = 'p']"/>
4028
+ </fo:block>
4029
+ <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
4030
+ <fo:block xsl:use-attribute-sets="quote-source-style">
4031
+ <!-- — ISO, ISO 7301:2011, Clause 1 -->
4032
+ <xsl:apply-templates select="*[local-name() = 'author']"/>
4033
+ <xsl:apply-templates select="*[local-name() = 'source']"/>
4034
+ </fo:block>
4035
+ </xsl:if>
4036
+
4037
+ </fo:block-container>
4038
+ </fo:block-container>
3350
4039
  </xsl:template><xsl:template match="*[local-name() = 'source']">
3351
4040
  <xsl:if test="../*[local-name() = 'author']">
3352
4041
  <xsl:text>, </xsl:text>
@@ -3374,6 +4063,7 @@
3374
4063
  <xsl:if test="@type = 'inline'">
3375
4064
 
3376
4065
 
4066
+
3377
4067
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
3378
4068
 
3379
4069
  </xsl:if>
@@ -3405,6 +4095,7 @@
3405
4095
 
3406
4096
 
3407
4097
 
4098
+
3408
4099
  <xsl:choose>
3409
4100
  <xsl:when test="ancestor::un:sections and $depth = 1">12</xsl:when>
3410
4101
  <xsl:when test="ancestor::un:sections">8</xsl:when>
@@ -3508,6 +4199,7 @@
3508
4199
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
3509
4200
  <fo:block>
3510
4201
  <xsl:call-template name="setId"/>
4202
+
3511
4203
  <xsl:apply-templates/>
3512
4204
  </fo:block>
3513
4205
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
@@ -3537,6 +4229,31 @@
3537
4229
  </xsl:template><xsl:template match="*[local-name() = 'name']/text()">
3538
4230
  <!-- 0xA0 to space replacement -->
3539
4231
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
4232
+ </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
4233
+ <xsl:choose>
4234
+ <xsl:when test="parent::*[local-name() = 'note']">
4235
+ <fo:block-container>
4236
+ <xsl:attribute name="margin-left">
4237
+ <xsl:choose>
4238
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
4239
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
4240
+ </xsl:choose>
4241
+ </xsl:attribute>
4242
+
4243
+
4244
+ <fo:block-container margin-left="0mm">
4245
+ <fo:block>
4246
+ <xsl:apply-templates select="." mode="ul_ol"/>
4247
+ </fo:block>
4248
+ </fo:block-container>
4249
+ </fo:block-container>
4250
+ </xsl:when>
4251
+ <xsl:otherwise>
4252
+ <fo:block>
4253
+ <xsl:apply-templates select="." mode="ul_ol"/>
4254
+ </fo:block>
4255
+ </xsl:otherwise>
4256
+ </xsl:choose>
3540
4257
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
3541
4258
  <!-- <row>
3542
4259
  <date>05-07-2013</date>
@@ -3568,6 +4285,65 @@
3568
4285
  <fo:table-cell border="1pt solid black" padding-left="1mm" padding-top="0.5mm">
3569
4286
  <fo:block><xsl:apply-templates/></fo:block>
3570
4287
  </fo:table-cell>
4288
+ </xsl:template><xsl:template name="processBibitem">
4289
+
4290
+
4291
+
4292
+
4293
+ </xsl:template><xsl:template name="processBibitemDocId">
4294
+ <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')]"/>
4295
+ <xsl:choose>
4296
+ <xsl:when test="normalize-space($_doc_ident) != ''">
4297
+ <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"/>
4298
+ <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
4299
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
4300
+ </xsl:if>
4301
+ <xsl:value-of select="$_doc_ident"/>
4302
+ </xsl:when>
4303
+ <xsl:otherwise>
4304
+ <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
4305
+ <xsl:if test="$type != ''">
4306
+ <xsl:value-of select="$type"/><xsl:text> </xsl:text>
4307
+ </xsl:if>
4308
+ <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
4309
+ </xsl:otherwise>
4310
+ </xsl:choose>
4311
+ </xsl:template><xsl:template name="processPersonalAuthor">
4312
+ <xsl:choose>
4313
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'completename']">
4314
+ <author>
4315
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'completename']"/>
4316
+ </author>
4317
+ </xsl:when>
4318
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'initial']">
4319
+ <author>
4320
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
4321
+ <xsl:text> </xsl:text>
4322
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'initial']" mode="strip"/>
4323
+ </author>
4324
+ </xsl:when>
4325
+ <xsl:when test="*[local-name() = 'name']/*[local-name() = 'surname'] and *[local-name() = 'name']/*[local-name() = 'forename']">
4326
+ <author>
4327
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'surname']"/>
4328
+ <xsl:text> </xsl:text>
4329
+ <xsl:apply-templates select="*[local-name() = 'name']/*[local-name() = 'forename']" mode="strip"/>
4330
+ </author>
4331
+ </xsl:when>
4332
+ <xsl:otherwise>
4333
+ <xsl:apply-templates/>
4334
+ </xsl:otherwise>
4335
+ </xsl:choose>
4336
+ </xsl:template><xsl:template name="renderDate">
4337
+ <xsl:if test="normalize-space(*[local-name() = 'on']) != ''">
4338
+ <xsl:value-of select="*[local-name() = 'on']"/>
4339
+ </xsl:if>
4340
+ <xsl:if test="normalize-space(*[local-name() = 'from']) != ''">
4341
+ <xsl:value-of select="concat(*[local-name() = 'from'], '–', *[local-name() = 'to'])"/>
4342
+ </xsl:if>
4343
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'initial']/text()" mode="strip">
4344
+ <xsl:value-of select="translate(.,'. ','')"/>
4345
+ </xsl:template><xsl:template match="*[local-name() = 'name']/*[local-name() = 'forename']/text()" mode="strip">
4346
+ <xsl:value-of select="substring(.,1,1)"/>
3571
4347
  </xsl:template><xsl:template name="convertDate">
3572
4348
  <xsl:param name="date"/>
3573
4349
  <xsl:param name="format" select="'short'"/>
@@ -3650,6 +4426,7 @@
3650
4426
 
3651
4427
 
3652
4428
 
4429
+
3653
4430
 
3654
4431
  </xsl:variable>
3655
4432
  <xsl:choose>
@@ -3664,6 +4441,7 @@
3664
4441
  <dc:creator>
3665
4442
 
3666
4443
 
4444
+
3667
4445
  </dc:creator>
3668
4446
  <dc:description>
3669
4447
  <xsl:variable name="abstract">
@@ -3673,6 +4451,7 @@
3673
4451
  <xsl:copy-of select="/*/*[local-name() = 'preface']/*[local-name() = 'abstract']//text()"/>
3674
4452
 
3675
4453
 
4454
+
3676
4455
  </xsl:variable>
3677
4456
  <xsl:value-of select="normalize-space($abstract)"/>
3678
4457
  </dc:description>
@@ -3773,6 +4552,7 @@
3773
4552
 
3774
4553
 
3775
4554
 
4555
+
3776
4556
  </xsl:variable>
3777
4557
  <xsl:if test="$documentNS != $XSLNS">
3778
4558
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -3798,4 +4578,21 @@
3798
4578
  </xsl:otherwise>
3799
4579
  </xsl:choose>
3800
4580
  </xsl:attribute>
4581
+ </xsl:template><xsl:template name="add-letter-spacing">
4582
+ <xsl:param name="text"/>
4583
+ <xsl:param name="letter-spacing" select="'0.15'"/>
4584
+ <xsl:if test="string-length($text) &gt; 0">
4585
+ <xsl:variable name="char" select="substring($text, 1, 1)"/>
4586
+ <fo:inline padding-right="{$letter-spacing}mm">
4587
+ <xsl:if test="$char = '®'">
4588
+ <xsl:attribute name="font-size">58%</xsl:attribute>
4589
+ <xsl:attribute name="baseline-shift">30%</xsl:attribute>
4590
+ </xsl:if>
4591
+ <xsl:value-of select="$char"/>
4592
+ </fo:inline>
4593
+ <xsl:call-template name="add-letter-spacing">
4594
+ <xsl:with-param name="text" select="substring($text, 2)"/>
4595
+ <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
4596
+ </xsl:call-template>
4597
+ </xsl:if>
3801
4598
  </xsl:template></xsl:stylesheet>