metanorma-itu 1.2.15 → 1.3.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (40) hide show
  1. checksums.yaml +4 -4
  2. data/.gitignore +2 -0
  3. data/.rubocop.yml +7 -1
  4. data/lib/asciidoctor/itu/biblio.rng +5 -6
  5. data/lib/asciidoctor/itu/cleanup.rb +9 -6
  6. data/lib/asciidoctor/itu/converter.rb +31 -27
  7. data/lib/asciidoctor/itu/front.rb +35 -23
  8. data/lib/asciidoctor/itu/isodoc.rng +305 -4
  9. data/lib/asciidoctor/itu/itu.rng +0 -30
  10. data/lib/isodoc/itu/base_convert.rb +25 -37
  11. data/lib/isodoc/itu/html/_coverpage.css +7 -0
  12. data/lib/isodoc/itu/html/header.html +8 -8
  13. data/lib/isodoc/itu/html/htmlstyle.css +14 -7
  14. data/lib/isodoc/itu/html/htmlstyle.scss +0 -9
  15. data/lib/isodoc/itu/html/itu.css +0 -7
  16. data/lib/isodoc/itu/html/itu.scss +0 -7
  17. data/lib/isodoc/itu/html_convert.rb +0 -1
  18. data/lib/isodoc/itu/i18n-ar.yaml +87 -0
  19. data/lib/isodoc/itu/i18n-de.yaml +87 -0
  20. data/lib/isodoc/itu/i18n-en.yaml +1 -0
  21. data/lib/isodoc/itu/i18n-es.yaml +88 -0
  22. data/lib/isodoc/itu/i18n-fr.yaml +88 -0
  23. data/lib/isodoc/itu/i18n-ru.yaml +88 -0
  24. data/lib/isodoc/itu/i18n-zh-Hans.yaml +81 -0
  25. data/lib/isodoc/itu/i18n.rb +14 -4
  26. data/lib/isodoc/itu/itu.implementers-guide.xsl +776 -326
  27. data/lib/isodoc/itu/itu.in-force.xsl +776 -326
  28. data/lib/isodoc/itu/itu.recommendation-annex.xsl +776 -326
  29. data/lib/isodoc/itu/itu.recommendation-supplement.xsl +776 -326
  30. data/lib/isodoc/itu/itu.recommendation.xsl +776 -326
  31. data/lib/isodoc/itu/itu.resolution.xsl +776 -326
  32. data/lib/isodoc/itu/itu.technical-paper.xsl +776 -326
  33. data/lib/isodoc/itu/itu.technical-report.xsl +776 -326
  34. data/lib/isodoc/itu/metadata.rb +3 -3
  35. data/lib/isodoc/itu/presentation_xml_convert.rb +1 -1
  36. data/lib/isodoc/itu/xref.rb +1 -2
  37. data/lib/metanorma/itu/version.rb +1 -1
  38. data/metanorma-itu.gemspec +5 -5
  39. metadata +36 -31
  40. data/lib/asciidoctor/itu/macros.rb +0 -27
@@ -5,6 +5,7 @@
5
5
  <xsl:param name="svg_images"/>
6
6
  <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
7
7
  <xsl:variable name="images" select="document($svg_images)"/>
8
+ <xsl:param name="basepath"/>
8
9
 
9
10
 
10
11
 
@@ -117,10 +118,17 @@
117
118
 
118
119
  <xsl:template match="/">
119
120
  <xsl:call-template name="namespaceCheck"/>
120
- <fo:root font-family="Times New Roman, STIX Two Math" font-size="12pt" xml:lang="{$lang}">
121
+ <fo:root xsl:use-attribute-sets="root-style">
122
+ <xsl:if test="$lang != 'ar'">
123
+ <xsl:attribute name="xml:lang"><xsl:value-of select="$lang"/></xsl:attribute>
124
+ </xsl:if>
121
125
  <xsl:if test="$doctype = 'resolution'">
122
126
  <xsl:attribute name="font-size">11pt</xsl:attribute>
123
127
  </xsl:if>
128
+ <xsl:call-template name="setWritingMode"/>
129
+ <xsl:if test="$lang = 'ar'">
130
+ <xsl:attribute name="font-family">Traditional Arabic, Times New Roman, STIX Two Math</xsl:attribute>
131
+ </xsl:if>
124
132
  <fo:layout-master-set>
125
133
 
126
134
 
@@ -321,7 +329,7 @@
321
329
  </xsl:if>
322
330
 
323
331
  <!-- cover page -->
324
- <fo:page-sequence master-reference="cover-page">
332
+ <fo:page-sequence master-reference="cover-page" writing-mode="lr-tb">
325
333
  <xsl:if test="$doctype = 'resolution'">
326
334
  <xsl:attribute name="force-page-count">no-force</xsl:attribute>
327
335
  </xsl:if>
@@ -342,7 +350,7 @@
342
350
  </fo:block-container>
343
351
 
344
352
  <fo:block-container absolute-position="fixed" left="-7mm" top="0" font-size="0">
345
- <fo:block>
353
+ <fo:block text-align="left">
346
354
  <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Fond-Rec))}" width="43.6mm" content-height="299.2mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image Cover Page"/>
347
355
  </fo:block>
348
356
  </fo:block-container>
@@ -358,12 +366,15 @@
358
366
  <fo:block> </fo:block>
359
367
  </fo:table-cell>
360
368
  <fo:table-cell number-columns-spanned="3">
361
- <fo:block font-family="Arial" font-size="13pt" font-weight="bold" color="gray"> <!-- margin-top="16pt" letter-spacing="4pt", Helvetica for letter-spacing working -->
362
- <fo:block><xsl:value-of select="$linebreak"/></fo:block>
363
- <xsl:call-template name="addLetterSpacing">
364
- <xsl:with-param name="text" select="/itu:itu-standard/itu:bibdata/itu:contributor[itu:role/@type='author']/itu:organization/itu:name"/>
365
- </xsl:call-template>
366
- </fo:block>
369
+ <fo:block-container>
370
+ <xsl:call-template name="setWritingMode"/>
371
+ <fo:block font-family="Arial" font-size="13pt" font-weight="bold" color="gray"> <!-- margin-top="16pt" letter-spacing="4pt", Helvetica for letter-spacing working -->
372
+ <fo:block><xsl:value-of select="$linebreak"/></fo:block>
373
+ <xsl:call-template name="addLetterSpacing">
374
+ <xsl:with-param name="text" select="/itu:itu-standard/itu:bibdata/itu:contributor[itu:role/@type='author']/itu:organization/itu:name"/>
375
+ </xsl:call-template>
376
+ </fo:block>
377
+ </fo:block-container>
367
378
  </fo:table-cell>
368
379
  </fo:table-row>
369
380
  <fo:table-row>
@@ -371,48 +382,56 @@
371
382
  <fo:block> </fo:block>
372
383
  </fo:table-cell>
373
384
  <fo:table-cell padding-top="2mm" padding-bottom="-1mm">
374
- <fo:block font-family="Arial" font-size="36pt" font-weight="bold" margin-top="6pt" letter-spacing="2pt"> <!-- Helvetica for letter-spacing working -->
375
- <xsl:value-of select="substring-before(/itu:itu-standard/itu:bibdata/itu:docidentifier[@type = 'ITU'], ' ')"/>
376
- </fo:block>
385
+ <fo:block-container>
386
+ <xsl:call-template name="setWritingMode"/>
387
+ <fo:block font-family="Arial" font-size="36pt" font-weight="bold" margin-top="6pt" letter-spacing="2pt"> <!-- Helvetica for letter-spacing working -->
388
+ <fo:block>
389
+ <xsl:value-of select="substring-before(/itu:itu-standard/itu:bibdata/itu:docidentifier[@type = 'ITU'], ' ')"/>
390
+ </fo:block>
391
+ </fo:block>
392
+ </fo:block-container>
377
393
  </fo:table-cell>
378
394
  <fo:table-cell padding-top="1mm" number-columns-spanned="2" padding-bottom="-1mm">
379
- <fo:block font-size="30pt" font-weight="bold" text-align="right" margin-top="12pt" padding="0mm">
380
- <xsl:choose>
381
- <xsl:when test="$doctype = 'technical-report' or $doctype = 'technical-paper'">
382
- <xsl:value-of select="$doctypeTitle"/>
383
- </xsl:when>
384
- <xsl:when test="$doctype = 'implementers-guide'">
385
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:docidentifier[@type='ITU-Recommendation']"/>
386
- <xsl:text> </xsl:text>
387
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:doctype[@language = $lang]"/>
388
- </xsl:when>
389
- <xsl:when test="$doctype = 'resolution'"/>
390
- <xsl:when test="$doctype = 'recommendation-supplement'">
391
- <!-- Series L -->
392
- <xsl:variable name="title-series">
393
- <xsl:call-template name="getLocalizedString">
394
- <xsl:with-param name="key">series</xsl:with-param>
395
- </xsl:call-template>
396
- </xsl:variable>
397
- <xsl:call-template name="capitalize">
398
- <xsl:with-param name="str" select="$title-series"/>
399
- </xsl:call-template>
400
- <xsl:text> </xsl:text>
401
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:series[@type='main']/itu:title[@type='abbrev']"/>
402
- <!-- Ex. Supplement 37 -->
403
- <fo:block font-size="18pt">
404
- <xsl:call-template name="getLocalizedString">
405
- <xsl:with-param name="key">doctype_dict.recommendation-supplement</xsl:with-param>
395
+ <fo:block-container>
396
+ <xsl:call-template name="setWritingMode"/>
397
+ <fo:block font-size="30pt" font-weight="bold" text-align="right" margin-top="12pt" padding="0mm">
398
+ <xsl:choose>
399
+ <xsl:when test="$doctype = 'technical-report' or $doctype = 'technical-paper'">
400
+ <xsl:value-of select="$doctypeTitle"/>
401
+ </xsl:when>
402
+ <xsl:when test="$doctype = 'implementers-guide'">
403
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:docidentifier[@type='ITU-Recommendation']"/>
404
+ <xsl:text> </xsl:text>
405
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:doctype[@language = $lang]"/>
406
+ </xsl:when>
407
+ <xsl:when test="$doctype = 'resolution'"/>
408
+ <xsl:when test="$doctype = 'recommendation-supplement'">
409
+ <!-- Series L -->
410
+ <xsl:variable name="title-series">
411
+ <xsl:call-template name="getLocalizedString">
412
+ <xsl:with-param name="key">series</xsl:with-param>
413
+ </xsl:call-template>
414
+ </xsl:variable>
415
+ <xsl:call-template name="capitalize">
416
+ <xsl:with-param name="str" select="$title-series"/>
406
417
  </xsl:call-template>
407
418
  <xsl:text> </xsl:text>
408
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:docnumber"/>
409
- </fo:block>
410
- </xsl:when>
411
- <xsl:otherwise>
412
- <xsl:value-of select="substring-after(/itu:itu-standard/itu:bibdata/itu:docidentifier[@type = 'ITU'], ' ')"/>
413
- </xsl:otherwise>
414
- </xsl:choose>
415
- </fo:block>
419
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:series[@type='main']/itu:title[@type='abbrev']"/>
420
+ <!-- Ex. Supplement 37 -->
421
+ <fo:block font-size="18pt">
422
+ <xsl:call-template name="getLocalizedString">
423
+ <xsl:with-param name="key">doctype_dict.recommendation-supplement</xsl:with-param>
424
+ </xsl:call-template>
425
+ <xsl:text> </xsl:text>
426
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:docnumber"/>
427
+ </fo:block>
428
+ </xsl:when>
429
+ <xsl:otherwise>
430
+ <xsl:value-of select="substring-after(/itu:itu-standard/itu:bibdata/itu:docidentifier[@type = 'ITU'], ' ')"/>
431
+ </xsl:otherwise>
432
+ </xsl:choose>
433
+ </fo:block>
434
+ </fo:block-container>
416
435
  </fo:table-cell>
417
436
  </fo:table-row>
418
437
  <fo:table-row height="17.2mm">
@@ -420,36 +439,48 @@
420
439
  <fo:block> </fo:block>
421
440
  </fo:table-cell>
422
441
  <fo:table-cell font-size="10pt" number-columns-spanned="2" padding-top="1mm">
423
- <fo:block>
424
- <xsl:text>TELECOMMUNICATION</xsl:text>
425
- </fo:block>
426
- <fo:block>
427
- <xsl:text>STANDARDIZATION SECTOR</xsl:text>
428
- </fo:block>
429
- <fo:block>
430
- <xsl:text>OF ITU</xsl:text>
431
- </fo:block>
442
+ <fo:block-container>
443
+ <xsl:call-template name="setWritingMode"/>
444
+ <fo:block>
445
+ <xsl:text>TELECOMMUNICATION</xsl:text>
446
+ </fo:block>
447
+ <fo:block>
448
+ <xsl:text>STANDARDIZATION SECTOR</xsl:text>
449
+ </fo:block>
450
+ <fo:block>
451
+ <xsl:text>OF ITU</xsl:text>
452
+ </fo:block>
453
+ </fo:block-container>
432
454
  </fo:table-cell>
433
455
  <fo:table-cell text-align="right">
434
456
  <xsl:if test="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:annexid">
435
- <fo:block font-size="18pt" font-weight="bold">
436
- <xsl:variable name="title-annex">
437
- <xsl:call-template name="getTitle">
438
- <xsl:with-param name="name" select="'title-annex'"/>
439
- </xsl:call-template>
440
- </xsl:variable>
441
- <xsl:value-of select="$title-annex"/><xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:annexid"/>
442
- </fo:block>
457
+ <fo:block-container>
458
+ <xsl:call-template name="setWritingMode"/>
459
+ <fo:block font-size="18pt" font-weight="bold">
460
+ <xsl:variable name="title-annex">
461
+ <xsl:call-template name="getTitle">
462
+ <xsl:with-param name="name" select="'title-annex'"/>
463
+ </xsl:call-template>
464
+ </xsl:variable>
465
+ <xsl:value-of select="$title-annex"/><xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:annexid"/>
466
+ </fo:block>
467
+ </fo:block-container>
443
468
  </xsl:if>
444
469
  <xsl:if test="$isAmendment != ''">
445
- <fo:block font-size="18pt" font-weight="bold">
446
- <xsl:value-of select="$isAmendment"/>
447
- </fo:block>
470
+ <fo:block-container>
471
+ <xsl:call-template name="setWritingMode"/>
472
+ <fo:block font-size="18pt" font-weight="bold">
473
+ <xsl:value-of select="$isAmendment"/>
474
+ </fo:block>
475
+ </fo:block-container>
448
476
  </xsl:if>
449
477
  <xsl:if test="$isCorrigendum != ''">
450
- <fo:block font-size="18pt" font-weight="bold">
451
- <xsl:value-of select="$isCorrigendum"/>
452
- </fo:block>
478
+ <fo:block-container>
479
+ <xsl:call-template name="setWritingMode"/>
480
+ <fo:block font-size="18pt" font-weight="bold">
481
+ <xsl:value-of select="$isCorrigendum"/>
482
+ </fo:block>
483
+ </fo:block-container>
453
484
  </xsl:if>
454
485
  <fo:block font-size="14pt">
455
486
  <xsl:choose>
@@ -474,79 +505,81 @@
474
505
  <fo:block> </fo:block>
475
506
  </fo:table-cell>
476
507
  <fo:table-cell font-size="16pt" number-columns-spanned="3" border-bottom="0.5mm solid black" padding-right="2mm" display-align="after">
477
- <fo:block padding-bottom="7mm">
478
- <xsl:if test="$doctype = 'resolution'">
479
- <fo:block><xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:meeting"/></fo:block>
480
- <fo:block>
481
- <xsl:variable name="meeting-place" select="/itu:itu-standard/itu:bibdata/itu:ext/itu:meeting-place"/>
482
- <xsl:variable name="meeting-date_from" select="/itu:itu-standard/itu:bibdata/itu:ext/itu:meeting-date/itu:from"/>
483
- <xsl:variable name="meeting-date_from_year" select="substring($meeting-date_from, 1, 4)"/>
484
- <xsl:variable name="meeting-date_to" select="/itu:itu-standard/itu:bibdata/itu:ext/itu:meeting-date/itu:to"/>
485
- <xsl:variable name="meeting-date_to_year" select="substring($meeting-date_to, 1, 4)"/>
486
-
487
- <xsl:variable name="date_format">
488
- <xsl:choose>
489
- <xsl:when test="$meeting-date_from_year = $meeting-date_to_year">ddMM</xsl:when>
490
- <xsl:otherwise>ddMMyyyy</xsl:otherwise>
491
- </xsl:choose>
492
- </xsl:variable>
493
- <xsl:variable name="meeting-date_from_str">
494
- <xsl:call-template name="convertDateLocalized">
495
- <xsl:with-param name="date" select="$meeting-date_from"/>
496
- <xsl:with-param name="format" select="$date_format"/>
497
- </xsl:call-template>
498
- </xsl:variable>
508
+ <fo:block-container>
509
+ <xsl:call-template name="setWritingMode"/>
510
+ <fo:block padding-bottom="7mm">
511
+ <xsl:if test="$doctype = 'resolution'">
512
+ <fo:block><xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:meeting"/></fo:block>
513
+ <fo:block>
514
+ <xsl:variable name="meeting-place" select="/itu:itu-standard/itu:bibdata/itu:ext/itu:meeting-place"/>
515
+ <xsl:variable name="meeting-date_from" select="/itu:itu-standard/itu:bibdata/itu:ext/itu:meeting-date/itu:from"/>
516
+ <xsl:variable name="meeting-date_from_year" select="substring($meeting-date_from, 1, 4)"/>
517
+ <xsl:variable name="meeting-date_to" select="/itu:itu-standard/itu:bibdata/itu:ext/itu:meeting-date/itu:to"/>
518
+ <xsl:variable name="meeting-date_to_year" select="substring($meeting-date_to, 1, 4)"/>
519
+
520
+ <xsl:variable name="date_format">
521
+ <xsl:choose>
522
+ <xsl:when test="$meeting-date_from_year = $meeting-date_to_year">ddMM</xsl:when>
523
+ <xsl:otherwise>ddMMyyyy</xsl:otherwise>
524
+ </xsl:choose>
525
+ </xsl:variable>
526
+ <xsl:variable name="meeting-date_from_str">
527
+ <xsl:call-template name="convertDateLocalized">
528
+ <xsl:with-param name="date" select="$meeting-date_from"/>
529
+ <xsl:with-param name="format" select="$date_format"/>
530
+ </xsl:call-template>
531
+ </xsl:variable>
499
532
 
500
- <xsl:variable name="meeting-date_to_str">
501
- <xsl:call-template name="convertDateLocalized">
502
- <xsl:with-param name="date" select="$meeting-date_to"/>
503
- <xsl:with-param name="format" select="'ddMMyyyy'"/>
504
- </xsl:call-template>
505
- </xsl:variable>
506
-
507
- <xsl:value-of select="$meeting-place"/>
508
- <xsl:if test="$meeting-place != '' and (normalize-space($meeting-date_from_str) != '' or normalize-space($meeting-date_to_str != ''))">
509
- <xsl:text>, </xsl:text>
510
- <xsl:value-of select="$meeting-date_from_str"/>
511
- <xsl:if test="normalize-space($meeting-date_from_str) != '' and normalize-space($meeting-date_to_str) != ''">
512
- <xsl:text> – </xsl:text>
513
- </xsl:if>
514
- <xsl:value-of select="$meeting-date_to_str"/>
515
- </xsl:if>
516
- </fo:block>
517
- </xsl:if>
518
- <fo:block text-transform="uppercase">
519
- <xsl:variable name="series_title" select="normalize-space(/itu:itu-standard/itu:bibdata/itu:series[@type = 'main']/itu:title[@type = 'full'])"/>
520
- <xsl:if test="$series_title != ''">
521
- <xsl:variable name="title">
522
- <xsl:if test="$doctype != 'resolution'">
523
- <!-- <xsl:text>Series </xsl:text> -->
524
- <xsl:call-template name="getLocalizedString">
525
- <xsl:with-param name="key">series</xsl:with-param>
533
+ <xsl:variable name="meeting-date_to_str">
534
+ <xsl:call-template name="convertDateLocalized">
535
+ <xsl:with-param name="date" select="$meeting-date_to"/>
536
+ <xsl:with-param name="format" select="'ddMMyyyy'"/>
526
537
  </xsl:call-template>
527
- <xsl:text> </xsl:text>
538
+ </xsl:variable>
539
+
540
+ <xsl:value-of select="$meeting-place"/>
541
+ <xsl:if test="$meeting-place != '' and (normalize-space($meeting-date_from_str) != '' or normalize-space($meeting-date_to_str != ''))">
542
+ <xsl:text>, </xsl:text>
543
+ <xsl:value-of select="$meeting-date_from_str"/>
544
+ <xsl:if test="normalize-space($meeting-date_from_str) != '' and normalize-space($meeting-date_to_str) != ''">
545
+ <xsl:text> – </xsl:text>
546
+ </xsl:if>
547
+ <xsl:value-of select="$meeting-date_to_str"/>
528
548
  </xsl:if>
529
- <xsl:value-of select="$series_title"/>
530
- </xsl:variable>
531
- <xsl:value-of select="$title"/>
549
+ </fo:block>
532
550
  </xsl:if>
533
- </fo:block>
534
- <xsl:choose>
535
- <xsl:when test="$doctype = 'recommendation-supplement'"/>
536
- <xsl:otherwise>
537
- <xsl:if test="/itu:itu-standard/itu:bibdata/itu:series">
538
- <fo:block margin-top="6pt">
539
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:series[@type = 'secondary']"/>
540
- <xsl:if test="normalize-space(/itu:itu-standard/itu:bibdata/itu:series[@type = 'tertiary']) != ''">
541
- <xsl:text> — </xsl:text>
542
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:series[@type = 'tertiary']"/>
551
+ <fo:block text-transform="uppercase">
552
+ <xsl:variable name="series_title" select="normalize-space(/itu:itu-standard/itu:bibdata/itu:series[@type = 'main']/itu:title[@type = 'full'])"/>
553
+ <xsl:if test="$series_title != ''">
554
+ <xsl:variable name="title">
555
+ <xsl:if test="$doctype != 'resolution'">
556
+ <!-- <xsl:text>Series </xsl:text> -->
557
+ <xsl:call-template name="getLocalizedString">
558
+ <xsl:with-param name="key">series</xsl:with-param>
559
+ </xsl:call-template>
560
+ <xsl:text> </xsl:text>
543
561
  </xsl:if>
544
- </fo:block>
562
+ <xsl:value-of select="$series_title"/>
563
+ </xsl:variable>
564
+ <xsl:value-of select="$title"/>
545
565
  </xsl:if>
546
- </xsl:otherwise>
547
- </xsl:choose>
548
-
549
- </fo:block>
566
+ </fo:block>
567
+ <xsl:choose>
568
+ <xsl:when test="$doctype = 'recommendation-supplement'"/>
569
+ <xsl:otherwise>
570
+ <xsl:if test="/itu:itu-standard/itu:bibdata/itu:series">
571
+ <fo:block margin-top="6pt">
572
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:series[@type = 'secondary']"/>
573
+ <xsl:if test="normalize-space(/itu:itu-standard/itu:bibdata/itu:series[@type = 'tertiary']) != ''">
574
+ <xsl:text> — </xsl:text>
575
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:series[@type = 'tertiary']"/>
576
+ </xsl:if>
577
+ </fo:block>
578
+ </xsl:if>
579
+ </xsl:otherwise>
580
+ </xsl:choose>
581
+ </fo:block>
582
+ </fo:block-container>
550
583
  </fo:table-cell>
551
584
  </fo:table-row>
552
585
  <fo:table-row height="40mm">
@@ -554,49 +587,52 @@
554
587
  <fo:block> </fo:block>
555
588
  </fo:table-cell>
556
589
  <fo:table-cell font-size="18pt" number-columns-spanned="3">
557
- <fo:block padding-right="2mm" margin-top="6pt">
558
- <xsl:if test="not(/itu:itu-standard/itu:bibdata/itu:title[@type = 'annex' and @language = 'en']) and $isAmendment = '' and $isCorrigendum = ''">
559
- <xsl:attribute name="font-weight">bold</xsl:attribute>
560
- </xsl:if>
561
- <xsl:if test="($doctype = 'technical-report' or $doctype = 'technical-paper') and /itu:itu-standard/itu:bibdata/itu:docnumber">
562
- <fo:block font-weight="bold">
563
- <xsl:value-of select="$xSTR-ACRONYM"/>
564
- </fo:block>
565
- </xsl:if>
566
- <xsl:if test="$doctype = 'implementers-guide'">
567
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:doctype[@language = $lang]"/>
568
- <xsl:text> for </xsl:text>
569
- </xsl:if>
570
- <xsl:if test="$doctype = 'resolution'">
571
- <!-- Resolution 1 -->
572
- <xsl:value-of select="$doctypeTitle"/><xsl:text> </xsl:text><xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:docnumber"/>
573
- <xsl:text> – </xsl:text>
574
- </xsl:if>
575
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'main' and @language = 'en']"/>
576
- </fo:block>
577
- <xsl:for-each select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'annex' and @language = 'en']">
578
- <fo:block font-weight="bold">
579
- <xsl:value-of select="."/>
580
- </fo:block>
581
- </xsl:for-each>
582
- <xsl:if test="$isAmendment != ''">
583
- <fo:block padding-right="2mm" margin-top="6pt" font-weight="bold">
584
- <xsl:value-of select="$isAmendment"/>
585
- <xsl:if test="/itu:itu-standard/itu:bibdata/itu:title[@type = 'amendment']">
586
- <xsl:text>: </xsl:text>
587
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'amendment']"/>
590
+ <fo:block-container>
591
+ <xsl:call-template name="setWritingMode"/>
592
+ <fo:block padding-right="2mm" margin-top="6pt">
593
+ <xsl:if test="not(/itu:itu-standard/itu:bibdata/itu:title[@type = 'annex' and @language = 'en']) and $isAmendment = '' and $isCorrigendum = ''">
594
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
588
595
  </xsl:if>
589
- </fo:block>
590
- </xsl:if>
591
- <xsl:if test="$isCorrigendum != ''">
592
- <fo:block padding-right="2mm" margin-top="6pt" font-weight="bold">
593
- <xsl:value-of select="$isCorrigendum"/>
594
- <xsl:if test="/itu:itu-standard/itu:bibdata/itu:title[@type = 'corrigendum']">
595
- <xsl:text>: </xsl:text>
596
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'corrigendum']"/>
596
+ <xsl:if test="($doctype = 'technical-report' or $doctype = 'technical-paper') and /itu:itu-standard/itu:bibdata/itu:docnumber">
597
+ <fo:block font-weight="bold">
598
+ <xsl:value-of select="$xSTR-ACRONYM"/>
599
+ </fo:block>
600
+ </xsl:if>
601
+ <xsl:if test="$doctype = 'implementers-guide'">
602
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:doctype[@language = $lang]"/>
603
+ <xsl:text> for </xsl:text>
604
+ </xsl:if>
605
+ <xsl:if test="$doctype = 'resolution'">
606
+ <!-- Resolution 1 -->
607
+ <xsl:value-of select="$doctypeTitle"/><xsl:text> </xsl:text><xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:docnumber"/>
608
+ <xsl:text> – </xsl:text>
597
609
  </xsl:if>
610
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'main' and @language = 'en']"/>
598
611
  </fo:block>
599
- </xsl:if>
612
+ <xsl:for-each select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'annex' and @language = 'en']">
613
+ <fo:block font-weight="bold">
614
+ <xsl:value-of select="."/>
615
+ </fo:block>
616
+ </xsl:for-each>
617
+ <xsl:if test="$isAmendment != ''">
618
+ <fo:block padding-right="2mm" margin-top="6pt" font-weight="bold">
619
+ <xsl:value-of select="$isAmendment"/>
620
+ <xsl:if test="/itu:itu-standard/itu:bibdata/itu:title[@type = 'amendment']">
621
+ <xsl:text>: </xsl:text>
622
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'amendment']"/>
623
+ </xsl:if>
624
+ </fo:block>
625
+ </xsl:if>
626
+ <xsl:if test="$isCorrigendum != ''">
627
+ <fo:block padding-right="2mm" margin-top="6pt" font-weight="bold">
628
+ <xsl:value-of select="$isCorrigendum"/>
629
+ <xsl:if test="/itu:itu-standard/itu:bibdata/itu:title[@type = 'corrigendum']">
630
+ <xsl:text>: </xsl:text>
631
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'corrigendum']"/>
632
+ </xsl:if>
633
+ </fo:block>
634
+ </xsl:if>
635
+ </fo:block-container>
600
636
  </fo:table-cell>
601
637
  </fo:table-row>
602
638
  <fo:table-row height="40mm">
@@ -604,17 +640,20 @@
604
640
  <fo:block> </fo:block>
605
641
  </fo:table-cell>
606
642
  <fo:table-cell number-columns-spanned="3">
607
- <xsl:choose>
608
- <xsl:when test="/itu:itu-standard/itu:boilerplate/itu:legal-statement/itu:clause[@id='draft-warning']">
609
- <xsl:attribute name="border">0.7mm solid black</xsl:attribute>
610
- <fo:block padding-top="3mm" margin-left="1mm" margin-right="1mm">
611
- <xsl:apply-templates select="/itu:itu-standard/itu:boilerplate/itu:legal-statement/itu:clause[@id='draft-warning']" mode="caution"/>
612
- </fo:block>
613
- </xsl:when>
614
- <xsl:otherwise>
615
- <fo:block> </fo:block>
616
- </xsl:otherwise>
617
- </xsl:choose>
643
+ <fo:block-container>
644
+ <xsl:call-template name="setWritingMode"/>
645
+ <xsl:choose>
646
+ <xsl:when test="/itu:itu-standard/itu:boilerplate/itu:legal-statement/itu:clause[@id='draft-warning']">
647
+ <xsl:attribute name="border">0.7mm solid black</xsl:attribute>
648
+ <fo:block padding-top="3mm" margin-left="1mm" margin-right="1mm">
649
+ <xsl:apply-templates select="/itu:itu-standard/itu:boilerplate/itu:legal-statement/itu:clause[@id='draft-warning']" mode="caution"/>
650
+ </fo:block>
651
+ </xsl:when>
652
+ <xsl:otherwise>
653
+ <fo:block> </fo:block>
654
+ </xsl:otherwise>
655
+ </xsl:choose>
656
+ </fo:block-container>
618
657
  </fo:table-cell>
619
658
  </fo:table-row>
620
659
  <fo:table-row height="25mm">
@@ -622,55 +661,58 @@
622
661
  <fo:block> </fo:block>
623
662
  </fo:table-cell>
624
663
  <fo:table-cell number-columns-spanned="3">
625
- <fo:block font-size="16pt" margin-top="3pt">
626
- <xsl:if test="/itu:itu-standard/itu:boilerplate/itu:legal-statement/itu:clause[@id='draft-warning']">
627
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
628
- <xsl:if test="$doctype = 'recommendation-supplement'">
629
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
630
- </xsl:if>
631
- </xsl:if>
632
-
633
- <xsl:choose>
634
- <xsl:when test="$doctype = 'technical-report' or $doctype = 'technical-paper'">
635
- <xsl:if test="/itu:itu-standard/itu:bibdata/itu:status/itu:stage">
636
- <xsl:call-template name="capitalizeWords">
637
- <xsl:with-param name="str" select="/itu:itu-standard/itu:bibdata/itu:status/itu:stage"/>
638
- </xsl:call-template>
639
- <xsl:text> </xsl:text>
640
- </xsl:if>
641
- <xsl:value-of select="$doctypeTitle"/>
642
- <xsl:text>  </xsl:text>
643
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:docidentifier[@type='ITU']"/>
644
- </xsl:when>
645
- <xsl:when test="$doctype = 'implementers-guide'"/>
646
- <xsl:when test="$doctype = 'resolution'"/>
647
- <xsl:when test="$doctype = 'recommendation-supplement'">
648
- <xsl:if test="/itu:itu-standard/itu:bibdata/itu:status/itu:stage = 'draft'">Draft </xsl:if>
649
- <xsl:text>ITU-</xsl:text><xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:editorialgroup/itu:bureau"/><xsl:text> </xsl:text>
650
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:docidentifier[@type = 'ITU-Supplement']"/>
651
- </xsl:when>
652
- <xsl:otherwise>
653
- <xsl:value-of select="$doctypeTitle"/>
654
- <xsl:text>  </xsl:text>
655
- <xsl:if test="/itu:itu-standard/itu:bibdata/itu:contributor/itu:organization/itu:abbreviation">
656
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:contributor/itu:organization/itu:abbreviation"/>
657
- <xsl:text>-</xsl:text>
664
+ <fo:block-container>
665
+ <xsl:call-template name="setWritingMode"/>
666
+ <fo:block font-size="16pt" margin-top="3pt">
667
+ <xsl:if test="/itu:itu-standard/itu:boilerplate/itu:legal-statement/itu:clause[@id='draft-warning']">
668
+ <xsl:attribute name="margin-top">6pt</xsl:attribute>
669
+ <xsl:if test="$doctype = 'recommendation-supplement'">
670
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
658
671
  </xsl:if>
659
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:bureau"/>
660
- <xsl:text>  </xsl:text>
661
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:docnumber"/>
662
- </xsl:otherwise>
663
- </xsl:choose>
664
-
665
- <xsl:if test="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:annexid">
666
- <xsl:variable name="title-annex">
667
- <xsl:call-template name="getTitle">
668
- <xsl:with-param name="name" select="'title-annex'"/>
669
- </xsl:call-template>
670
- </xsl:variable>
671
- <xsl:text> — </xsl:text><xsl:value-of select="$title-annex"/><xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:annexid"/>
672
- </xsl:if>
673
- </fo:block>
672
+ </xsl:if>
673
+
674
+ <xsl:choose>
675
+ <xsl:when test="$doctype = 'technical-report' or $doctype = 'technical-paper'">
676
+ <xsl:if test="/itu:itu-standard/itu:bibdata/itu:status/itu:stage">
677
+ <xsl:call-template name="capitalizeWords">
678
+ <xsl:with-param name="str" select="/itu:itu-standard/itu:bibdata/itu:status/itu:stage"/>
679
+ </xsl:call-template>
680
+ <xsl:text> </xsl:text>
681
+ </xsl:if>
682
+ <xsl:value-of select="$doctypeTitle"/>
683
+ <xsl:text>  </xsl:text>
684
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:docidentifier[@type='ITU']"/>
685
+ </xsl:when>
686
+ <xsl:when test="$doctype = 'implementers-guide'"/>
687
+ <xsl:when test="$doctype = 'resolution'"/>
688
+ <xsl:when test="$doctype = 'recommendation-supplement'">
689
+ <xsl:if test="/itu:itu-standard/itu:bibdata/itu:status/itu:stage = 'draft'">Draft </xsl:if>
690
+ <xsl:text>ITU-</xsl:text><xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:editorialgroup/itu:bureau"/><xsl:text> </xsl:text>
691
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:docidentifier[@type = 'ITU-Supplement']"/>
692
+ </xsl:when>
693
+ <xsl:otherwise>
694
+ <xsl:value-of select="$doctypeTitle"/>
695
+ <xsl:text>  </xsl:text>
696
+ <xsl:if test="/itu:itu-standard/itu:bibdata/itu:contributor/itu:organization/itu:abbreviation">
697
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:contributor/itu:organization/itu:abbreviation"/>
698
+ <xsl:text>-</xsl:text>
699
+ </xsl:if>
700
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:bureau"/>
701
+ <xsl:text>  </xsl:text>
702
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:docnumber"/>
703
+ </xsl:otherwise>
704
+ </xsl:choose>
705
+
706
+ <xsl:if test="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:annexid">
707
+ <xsl:variable name="title-annex">
708
+ <xsl:call-template name="getTitle">
709
+ <xsl:with-param name="name" select="'title-annex'"/>
710
+ </xsl:call-template>
711
+ </xsl:variable>
712
+ <xsl:text> — </xsl:text><xsl:value-of select="$title-annex"/><xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:annexid"/>
713
+ </xsl:if>
714
+ </fo:block>
715
+ </fo:block-container>
674
716
  </fo:table-cell>
675
717
  </fo:table-row>
676
718
  </fo:table-body>
@@ -753,7 +795,7 @@
753
795
  <xsl:with-param name="key">table_of_contents</xsl:with-param>
754
796
  </xsl:call-template>
755
797
  </fo:block>
756
- <fo:block margin-top="6pt" text-align="right" font-weight="bold">
798
+ <fo:block margin-top="6pt" text-align="end" font-weight="bold">
757
799
  <xsl:call-template name="getLocalizedString">
758
800
  <xsl:with-param name="key">Page.sg</xsl:with-param>
759
801
  </xsl:call-template>
@@ -824,7 +866,7 @@
824
866
  <fo:block space-before="36pt" text-align="center" font-weight="bold" keep-with-next="always">
825
867
  <xsl:value-of select="$title-list-tables"/>
826
868
  </fo:block>
827
- <fo:block margin-top="6pt" text-align="right" font-weight="bold" keep-with-next="always">
869
+ <fo:block margin-top="6pt" text-align="end" font-weight="bold" keep-with-next="always">
828
870
  <xsl:call-template name="getLocalizedString">
829
871
  <xsl:with-param name="key">Page.sg</xsl:with-param>
830
872
  </xsl:call-template>
@@ -856,7 +898,7 @@
856
898
  <fo:block space-before="36pt" text-align="center" font-weight="bold" keep-with-next="always">
857
899
  <xsl:value-of select="$title-list-figures"/>
858
900
  </fo:block>
859
- <fo:block margin-top="6pt" text-align="right" font-weight="bold" keep-with-next="always">
901
+ <fo:block margin-top="6pt" text-align="end" font-weight="bold" keep-with-next="always">
860
902
  <xsl:call-template name="getLocalizedString">
861
903
  <xsl:with-param name="key">Page.sg</xsl:with-param>
862
904
  </xsl:call-template>
@@ -1155,12 +1197,19 @@
1155
1197
  <xsl:attribute name="text-align">
1156
1198
  <xsl:choose>
1157
1199
  <xsl:when test="@class='supertitle'">center</xsl:when>
1158
- <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
1200
+ <!-- <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when> -->
1201
+ <xsl:when test="@align"><xsl:call-template name="setAlignment"/></xsl:when>
1159
1202
  <xsl:when test="ancestor::*[1][local-name() = 'td']/@align">
1160
- <xsl:value-of select="ancestor::*[1][local-name() = 'td']/@align"/>
1203
+ <!-- <xsl:value-of select="ancestor::*[1][local-name() = 'td']/@align"/> -->
1204
+ <xsl:call-template name="setAlignment">
1205
+ <xsl:with-param name="align" select="ancestor::*[1][local-name() = 'td']/@align"/>
1206
+ </xsl:call-template>
1161
1207
  </xsl:when>
1162
1208
  <xsl:when test="ancestor::*[1][local-name() = 'th']/@align">
1163
- <xsl:value-of select="ancestor::*[1][local-name() = 'th']/@align"/>
1209
+ <!-- <xsl:value-of select="ancestor::*[1][local-name() = 'th']/@align"/> -->
1210
+ <xsl:call-template name="setAlignment">
1211
+ <xsl:with-param name="align" select="ancestor::*[1][local-name() = 'th']/@align"/>
1212
+ </xsl:call-template>
1164
1213
  </xsl:when>
1165
1214
  <xsl:otherwise>justify</xsl:otherwise>
1166
1215
  </xsl:choose>
@@ -1374,6 +1423,7 @@
1374
1423
  <xsl:variable name="text-align">
1375
1424
  <xsl:choose>
1376
1425
  <xsl:when test="$level = 1 and $doctype = 'resolution'">center</xsl:when>
1426
+ <xsl:when test="$lang = 'ar'">start</xsl:when>
1377
1427
  <xsl:otherwise>left</xsl:otherwise>
1378
1428
  </xsl:choose>
1379
1429
  </xsl:variable>
@@ -1664,19 +1714,25 @@
1664
1714
  </fo:list-item-label>
1665
1715
  <fo:list-item-body start-indent="body-start()">
1666
1716
  <fo:block-container>
1717
+ <xsl:variable name="attribute-margin">
1718
+ <xsl:choose>
1719
+ <xsl:when test="$lang = 'ar'">margin-right</xsl:when>
1720
+ <xsl:otherwise>margin-left</xsl:otherwise>
1721
+ </xsl:choose>
1722
+ </xsl:variable>
1667
1723
  <xsl:if test="../preceding-sibling::*[1][local-name() = 'title']">
1668
- <xsl:attribute name="margin-left">18mm</xsl:attribute>
1724
+ <xsl:attribute name="{$attribute-margin}">18mm</xsl:attribute>
1669
1725
  </xsl:if>
1670
1726
  <xsl:if test="local-name(..) = 'ul'">
1671
- <xsl:attribute name="margin-left">7mm</xsl:attribute><!-- 15mm -->
1727
+ <xsl:attribute name="{$attribute-margin}">7mm</xsl:attribute><!-- 15mm -->
1672
1728
  <xsl:if test="ancestor::itu:table">
1673
- <xsl:attribute name="margin-left">4.5mm</xsl:attribute>
1729
+ <xsl:attribute name="{$attribute-margin}">4.5mm</xsl:attribute>
1674
1730
  </xsl:if>
1675
1731
  <!-- <xsl:if test="count(ancestor::itu:ol) + count(ancestor::itu:ul) &gt; 1">
1676
1732
  <xsl:attribute name="margin-left">7mm</xsl:attribute>
1677
1733
  </xsl:if> -->
1678
1734
  </xsl:if>
1679
- <fo:block-container margin-left="0mm">
1735
+ <fo:block-container margin-left="0mm" margin-right="0mm">
1680
1736
  <fo:block>
1681
1737
  <xsl:apply-templates/>
1682
1738
  <xsl:apply-templates select=".//itu:note" mode="process"/>
@@ -1755,19 +1811,7 @@
1755
1811
  <xsl:template match="itu:formula" mode="process">
1756
1812
  <xsl:call-template name="formula"/>
1757
1813
  </xsl:template>
1758
-
1759
- <xsl:template match="mathml:math" priority="2">
1760
- <fo:inline font-family="STIX Two Math" font-size="11pt">
1761
- <xsl:variable name="mathml">
1762
- <xsl:apply-templates select="." mode="mathml"/>
1763
- </xsl:variable>
1764
- <fo:instream-foreign-object fox:alt-text="Math">
1765
- <!-- <xsl:copy-of select="."/> -->
1766
- <xsl:copy-of select="xalan:nodeset($mathml)"/>
1767
- </fo:instream-foreign-object>
1768
- </fo:inline>
1769
- </xsl:template>
1770
-
1814
+
1771
1815
 
1772
1816
  <xsl:template match="itu:references[@normative='true']">
1773
1817
  <fo:block id="{@id}">
@@ -1792,10 +1836,10 @@
1792
1836
  <fo:table-column column-width="90%"/>
1793
1837
  <fo:table-body>
1794
1838
  <fo:table-row>
1795
- <fo:table-cell text-align="left" padding-bottom="8mm">
1839
+ <fo:table-cell text-align="start" padding-bottom="8mm">
1796
1840
  <fo:block><fo:page-number/></fo:block>
1797
1841
  </fo:table-cell>
1798
- <fo:table-cell font-weight="bold" text-align="left" padding-bottom="8mm">
1842
+ <fo:table-cell font-weight="bold" text-align="start" padding-bottom="8mm">
1799
1843
  <fo:block><xsl:value-of select="$footer-text"/></fo:block>
1800
1844
  </fo:table-cell>
1801
1845
  </fo:table-row>
@@ -1810,10 +1854,10 @@
1810
1854
  <fo:table-column column-width="10%"/>
1811
1855
  <fo:table-body>
1812
1856
  <fo:table-row>
1813
- <fo:table-cell font-weight="bold" text-align="right" padding-bottom="8mm">
1857
+ <fo:table-cell font-weight="bold" text-align="end" padding-bottom="8mm">
1814
1858
  <fo:block><xsl:value-of select="$footer-text"/></fo:block>
1815
1859
  </fo:table-cell>
1816
- <fo:table-cell text-align="right" padding-bottom="8mm" padding-right="2mm">
1860
+ <fo:table-cell text-align="end" padding-bottom="8mm" padding-right="2mm">
1817
1861
  <fo:block><fo:page-number/></fo:block>
1818
1862
  </fo:table-cell>
1819
1863
  </fo:table-row>
@@ -1842,7 +1886,7 @@
1842
1886
  <xsl:variable name="year" select="substring($date, 1, 4)"/>
1843
1887
  <xsl:variable name="month" select="substring($date, 6, 2)"/>
1844
1888
  <xsl:if test="$month != '' and $year != ''">
1845
- <xsl:text>(</xsl:text><xsl:value-of select="$month"/>/<xsl:value-of select="$year"/><xsl:text>)</xsl:text>
1889
+ <xsl:value-of select="$LRM"/><xsl:text>(</xsl:text><xsl:value-of select="$month"/>/<xsl:value-of select="$year"/><xsl:text>)</xsl:text><xsl:value-of select="$LRM"/>
1846
1890
  </xsl:if>
1847
1891
  </xsl:template>
1848
1892
 
@@ -2015,6 +2059,9 @@
2015
2059
  <title-continued lang="en">(continued)</title-continued>
2016
2060
  <title-continued lang="fr">(continué)</title-continued>
2017
2061
 
2062
+ </xsl:variable><xsl:variable name="bibdata">
2063
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']"/>
2064
+ <xsl:copy-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'localized-strings']"/>
2018
2065
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
2019
2066
  <xsl:param name="name"/>
2020
2067
  <xsl:param name="lang"/>
@@ -2040,10 +2087,15 @@
2040
2087
  </xsl:choose>
2041
2088
  </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">
2042
2089
 
2090
+
2091
+ <xsl:attribute name="font-family">Times New Roman, STIX Two Math</xsl:attribute>
2092
+ <xsl:attribute name="font-size">12pt</xsl:attribute>
2093
+
2043
2094
  </xsl:attribute-set><xsl:attribute-set name="link-style">
2044
2095
 
2045
2096
 
2046
2097
 
2098
+
2047
2099
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
2048
2100
  <xsl:attribute name="white-space">pre</xsl:attribute>
2049
2101
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -2156,6 +2208,7 @@
2156
2208
 
2157
2209
  </xsl:attribute-set><xsl:attribute-set name="table-name-style">
2158
2210
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2211
+
2159
2212
 
2160
2213
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2161
2214
  <xsl:attribute name="text-align">center</xsl:attribute>
@@ -2183,6 +2236,7 @@
2183
2236
  </xsl:attribute-set><xsl:attribute-set name="xref-style">
2184
2237
 
2185
2238
 
2239
+
2186
2240
  <xsl:attribute name="color">blue</xsl:attribute>
2187
2241
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
2188
2242
 
@@ -2199,6 +2253,7 @@
2199
2253
 
2200
2254
 
2201
2255
 
2256
+
2202
2257
 
2203
2258
 
2204
2259
 
@@ -2228,6 +2283,7 @@
2228
2283
 
2229
2284
 
2230
2285
 
2286
+
2231
2287
  </xsl:attribute-set><xsl:attribute-set name="note-p-style">
2232
2288
 
2233
2289
 
@@ -2248,11 +2304,13 @@
2248
2304
 
2249
2305
 
2250
2306
 
2307
+
2251
2308
 
2252
2309
  <xsl:attribute name="margin-top">4pt</xsl:attribute>
2253
2310
 
2254
2311
 
2255
2312
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
2313
+
2256
2314
 
2257
2315
 
2258
2316
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
@@ -2279,6 +2337,7 @@
2279
2337
 
2280
2338
 
2281
2339
 
2340
+
2282
2341
  </xsl:attribute-set><xsl:attribute-set name="origin-style">
2283
2342
 
2284
2343
 
@@ -2287,6 +2346,7 @@
2287
2346
 
2288
2347
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
2289
2348
 
2349
+
2290
2350
 
2291
2351
 
2292
2352
 
@@ -2322,6 +2382,7 @@
2322
2382
 
2323
2383
 
2324
2384
 
2385
+
2325
2386
  </xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
2326
2387
 
2327
2388
  <xsl:attribute name="font-size">10pt</xsl:attribute>
@@ -2333,6 +2394,7 @@
2333
2394
 
2334
2395
 
2335
2396
 
2397
+
2336
2398
  <xsl:attribute name="width">75%</xsl:attribute>
2337
2399
  <xsl:attribute name="content-height">100%</xsl:attribute>
2338
2400
  <xsl:attribute name="content-width">scale-to-fit</xsl:attribute>
@@ -2354,13 +2416,34 @@
2354
2416
 
2355
2417
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
2356
2418
 
2357
-
2419
+
2358
2420
  </xsl:attribute-set><xsl:attribute-set name="deprecates-style">
2359
2421
 
2360
2422
  </xsl:attribute-set><xsl:attribute-set name="definition-style">
2361
2423
 
2362
2424
 
2363
- </xsl:attribute-set><xsl:template name="processPrefaceSectionsDefault_Contents">
2425
+
2426
+ </xsl:attribute-set><xsl:variable name="color-added-text">
2427
+ <xsl:text>rgb(0, 255, 0)</xsl:text>
2428
+ </xsl:variable><xsl:attribute-set name="add-style">
2429
+ <xsl:attribute name="color">red</xsl:attribute>
2430
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
2431
+ <!-- <xsl:attribute name="color">black</xsl:attribute>
2432
+ <xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
2433
+ <xsl:attribute name="padding-top">1mm</xsl:attribute>
2434
+ <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
2435
+ </xsl:attribute-set><xsl:variable name="color-deleted-text">
2436
+ <xsl:text>red</xsl:text>
2437
+ </xsl:variable><xsl:attribute-set name="del-style">
2438
+ <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
2439
+ <xsl:attribute name="text-decoration">line-through</xsl:attribute>
2440
+ </xsl:attribute-set><xsl:attribute-set name="mathml-style">
2441
+ <xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
2442
+
2443
+
2444
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
2445
+
2446
+ </xsl:attribute-set><xsl:variable name="border-block-added">2.5pt solid rgb(0, 176, 80)</xsl:variable><xsl:variable name="border-block-deleted">2.5pt solid rgb(255, 0, 0)</xsl:variable><xsl:template name="processPrefaceSectionsDefault_Contents">
2364
2447
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
2365
2448
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
2366
2449
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
@@ -2405,18 +2488,19 @@
2405
2488
  <xsl:call-template name="add-zero-spaces-java"/>
2406
2489
  </xsl:template><xsl:template match="*[local-name()='table']" name="table">
2407
2490
 
2491
+ <xsl:variable name="table-preamble">
2492
+
2493
+ <fo:block space-before="18pt"> </fo:block>
2494
+
2495
+
2496
+ </xsl:variable>
2497
+
2408
2498
  <xsl:variable name="table">
2409
2499
 
2410
2500
  <xsl:variable name="simple-table">
2411
2501
  <xsl:call-template name="getSimpleTable"/>
2412
2502
  </xsl:variable>
2413
2503
 
2414
-
2415
- <fo:block space-before="18pt"> </fo:block>
2416
-
2417
-
2418
-
2419
-
2420
2504
  <!-- <xsl:if test="$namespace = 'bipm'">
2421
2505
  <fo:block>&#xA0;</fo:block>
2422
2506
  </xsl:if> -->
@@ -2431,7 +2515,7 @@
2431
2515
 
2432
2516
 
2433
2517
 
2434
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
2518
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
2435
2519
 
2436
2520
  <!-- <xsl:variable name="cols-count">
2437
2521
  <xsl:choose>
@@ -2450,8 +2534,6 @@
2450
2534
  <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
2451
2535
  <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
2452
2536
 
2453
-
2454
-
2455
2537
  <xsl:variable name="colwidths">
2456
2538
  <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
2457
2539
  <xsl:call-template name="calculate-column-widths">
@@ -2479,8 +2561,10 @@
2479
2561
  </xsl:choose>
2480
2562
  </xsl:variable>
2481
2563
 
2564
+
2482
2565
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
2483
2566
 
2567
+
2484
2568
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2485
2569
 
2486
2570
 
@@ -2502,6 +2586,8 @@
2502
2586
 
2503
2587
 
2504
2588
 
2589
+
2590
+
2505
2591
  <xsl:variable name="table_width">
2506
2592
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
2507
2593
  100%
@@ -2517,6 +2603,8 @@
2517
2603
 
2518
2604
 
2519
2605
 
2606
+
2607
+
2520
2608
  <attribute name="margin-left">0mm</attribute>
2521
2609
  <attribute name="margin-right">0mm</attribute>
2522
2610
 
@@ -2610,7 +2698,8 @@
2610
2698
  </fo:block-container>
2611
2699
  </xsl:variable>
2612
2700
 
2613
-
2701
+ <xsl:variable name="isAdded" select="@added"/>
2702
+ <xsl:variable name="isDeleted" select="@deleted"/>
2614
2703
 
2615
2704
  <xsl:choose>
2616
2705
  <xsl:when test="@width">
@@ -2624,7 +2713,14 @@
2624
2713
  <fo:table-body>
2625
2714
  <fo:table-row>
2626
2715
  <fo:table-cell column-number="2">
2627
- <fo:block><xsl:copy-of select="$table"/></fo:block>
2716
+ <xsl:copy-of select="$table-preamble"/>
2717
+ <fo:block>
2718
+ <xsl:call-template name="setTrackChangesStyles">
2719
+ <xsl:with-param name="isAdded" select="$isAdded"/>
2720
+ <xsl:with-param name="isDeleted" select="$isDeleted"/>
2721
+ </xsl:call-template>
2722
+ <xsl:copy-of select="$table"/>
2723
+ </fo:block>
2628
2724
  </fo:table-cell>
2629
2725
  </fo:table-row>
2630
2726
  </fo:table-body>
@@ -2635,16 +2731,42 @@
2635
2731
 
2636
2732
  </xsl:when>
2637
2733
  <xsl:otherwise>
2638
- <xsl:copy-of select="$table"/>
2734
+ <xsl:choose>
2735
+ <xsl:when test="$isAdded = 'true' or $isDeleted = 'true'">
2736
+ <xsl:copy-of select="$table-preamble"/>
2737
+ <fo:block>
2738
+ <xsl:call-template name="setTrackChangesStyles">
2739
+ <xsl:with-param name="isAdded" select="$isAdded"/>
2740
+ <xsl:with-param name="isDeleted" select="$isDeleted"/>
2741
+ </xsl:call-template>
2742
+ <xsl:copy-of select="$table"/>
2743
+ </fo:block>
2744
+ </xsl:when>
2745
+ <xsl:otherwise>
2746
+ <xsl:copy-of select="$table-preamble"/>
2747
+ <xsl:copy-of select="$table"/>
2748
+ </xsl:otherwise>
2749
+ </xsl:choose>
2639
2750
  </xsl:otherwise>
2640
2751
  </xsl:choose>
2641
2752
 
2642
2753
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
2754
+ <xsl:param name="continued"/>
2643
2755
  <xsl:if test="normalize-space() != ''">
2644
2756
  <fo:block xsl:use-attribute-sets="table-name-style">
2645
2757
 
2646
2758
 
2647
- <xsl:apply-templates/>
2759
+ <xsl:choose>
2760
+ <xsl:when test="$continued = 'true'">
2761
+ <!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
2762
+
2763
+ </xsl:when>
2764
+ <xsl:otherwise>
2765
+ <xsl:apply-templates/>
2766
+ </xsl:otherwise>
2767
+ </xsl:choose>
2768
+
2769
+
2648
2770
  </fo:block>
2649
2771
  </xsl:if>
2650
2772
  </xsl:template><xsl:template name="calculate-columns-numbers">
@@ -2696,7 +2818,7 @@
2696
2818
  </xsl:for-each>
2697
2819
  </xsl:when>
2698
2820
  <xsl:otherwise>
2699
- <xsl:for-each select="xalan:nodeset($table)//tr">
2821
+ <xsl:for-each select="xalan:nodeset($table)/*/tr">
2700
2822
  <xsl:variable name="td_text">
2701
2823
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
2702
2824
 
@@ -2784,18 +2906,18 @@
2784
2906
  <xsl:apply-templates/>
2785
2907
  </fo:table-header>
2786
2908
  </xsl:template><xsl:template name="table-header-title">
2787
- <xsl:param name="cols-count"/>
2909
+ <xsl:param name="cols-count"/>
2788
2910
  <!-- row for title -->
2789
2911
  <fo:table-row>
2790
2912
  <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">
2791
- <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
2913
+
2914
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
2915
+ <xsl:with-param name="continued">true</xsl:with-param>
2916
+ </xsl:apply-templates>
2792
2917
  <xsl:for-each select="ancestor::*[local-name()='table'][1]">
2793
2918
  <xsl:call-template name="fn_name_display"/>
2794
- </xsl:for-each>
2795
- <fo:block text-align="right" font-style="italic">
2796
- <xsl:text> </xsl:text>
2797
- <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
2798
- </fo:block>
2919
+ </xsl:for-each>
2920
+
2799
2921
  </fo:table-cell>
2800
2922
  </fo:table-row>
2801
2923
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
@@ -3024,6 +3146,7 @@
3024
3146
 
3025
3147
 
3026
3148
 
3149
+
3027
3150
  </xsl:if>
3028
3151
  <xsl:if test="$parent-name = 'tfoot'">
3029
3152
 
@@ -3044,7 +3167,8 @@
3044
3167
  <xsl:attribute name="text-align">
3045
3168
  <xsl:choose>
3046
3169
  <xsl:when test="@align">
3047
- <xsl:value-of select="@align"/>
3170
+ <xsl:call-template name="setAlignment"/>
3171
+ <!-- <xsl:value-of select="@align"/> -->
3048
3172
  </xsl:when>
3049
3173
  <xsl:otherwise>center</xsl:otherwise>
3050
3174
  </xsl:choose>
@@ -3052,6 +3176,7 @@
3052
3176
 
3053
3177
 
3054
3178
 
3179
+
3055
3180
  <xsl:if test="ancestor::*[local-name()='preface']">
3056
3181
  <xsl:attribute name="border">solid black 0pt</xsl:attribute>
3057
3182
  </xsl:if>
@@ -3064,6 +3189,9 @@
3064
3189
 
3065
3190
 
3066
3191
 
3192
+ <xsl:if test="$lang = 'ar'">
3193
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
3194
+ </xsl:if>
3067
3195
  <xsl:if test="@colspan">
3068
3196
  <xsl:attribute name="number-columns-spanned">
3069
3197
  <xsl:value-of select="@colspan"/>
@@ -3095,11 +3223,16 @@
3095
3223
  <xsl:attribute name="text-align">
3096
3224
  <xsl:choose>
3097
3225
  <xsl:when test="@align">
3098
- <xsl:value-of select="@align"/>
3226
+ <xsl:call-template name="setAlignment"/>
3227
+ <!-- <xsl:value-of select="@align"/> -->
3099
3228
  </xsl:when>
3100
3229
  <xsl:otherwise>left</xsl:otherwise>
3101
3230
  </xsl:choose>
3102
3231
  </xsl:attribute>
3232
+ <xsl:if test="$lang = 'ar'">
3233
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
3234
+ </xsl:if>
3235
+
3103
3236
 
3104
3237
 
3105
3238
  <xsl:if test="ancestor::*[local-name()='preface']">
@@ -3116,6 +3249,9 @@
3116
3249
 
3117
3250
 
3118
3251
 
3252
+ <xsl:if test=".//*[local-name() = 'table']">
3253
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
3254
+ </xsl:if>
3119
3255
  <xsl:if test="@colspan">
3120
3256
  <xsl:attribute name="number-columns-spanned">
3121
3257
  <xsl:value-of select="@colspan"/>
@@ -3259,13 +3395,13 @@
3259
3395
  </xsl:choose>
3260
3396
  </xsl:variable>
3261
3397
  <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
3262
- <xsl:element name="{$ns}:table">
3398
+ <!-- <xsl:element name="{$ns}:table"> -->
3263
3399
  <xsl:for-each select="*[local-name() = 'dl'][1]">
3264
3400
  <tbody>
3265
3401
  <xsl:apply-templates mode="dl"/>
3266
3402
  </tbody>
3267
3403
  </xsl:for-each>
3268
- </xsl:element>
3404
+ <!-- </xsl:element> -->
3269
3405
  </xsl:variable>
3270
3406
 
3271
3407
  <xsl:call-template name="calculate-column-widths">
@@ -3359,6 +3495,8 @@
3359
3495
  <xsl:apply-templates/>
3360
3496
  </fo:inline>
3361
3497
  </xsl:template><xsl:template match="*[local-name()='dl']">
3498
+ <xsl:variable name="isAdded" select="@added"/>
3499
+ <xsl:variable name="isDeleted" select="@deleted"/>
3362
3500
  <fo:block-container>
3363
3501
 
3364
3502
  <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
@@ -3375,6 +3513,12 @@
3375
3513
  </xsl:attribute>
3376
3514
 
3377
3515
  </xsl:if>
3516
+
3517
+ <xsl:call-template name="setTrackChangesStyles">
3518
+ <xsl:with-param name="isAdded" select="$isAdded"/>
3519
+ <xsl:with-param name="isDeleted" select="$isDeleted"/>
3520
+ </xsl:call-template>
3521
+
3378
3522
  <fo:block-container>
3379
3523
 
3380
3524
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
@@ -3491,11 +3635,11 @@
3491
3635
  </xsl:choose>
3492
3636
  </xsl:variable>
3493
3637
  <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
3494
- <xsl:element name="{$ns}:table">
3638
+ <!-- <xsl:element name="{$ns}:table"> -->
3495
3639
  <tbody>
3496
3640
  <xsl:apply-templates mode="dl"/>
3497
3641
  </tbody>
3498
- </xsl:element>
3642
+ <!-- </xsl:element> -->
3499
3643
  </xsl:variable>
3500
3644
  <!-- html-table<xsl:copy-of select="$html-table"/> -->
3501
3645
  <xsl:variable name="colwidths">
@@ -3755,6 +3899,7 @@
3755
3899
 
3756
3900
 
3757
3901
 
3902
+
3758
3903
 
3759
3904
  </xsl:variable>
3760
3905
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -3772,8 +3917,74 @@
3772
3917
  <fo:inline text-decoration="underline">
3773
3918
  <xsl:apply-templates/>
3774
3919
  </fo:inline>
3920
+ </xsl:template><xsl:template match="*[local-name()='add']">
3921
+ <xsl:choose>
3922
+ <xsl:when test="@amendment">
3923
+ <fo:inline>
3924
+ <xsl:call-template name="insertTag">
3925
+ <xsl:with-param name="kind">A</xsl:with-param>
3926
+ <xsl:with-param name="value"><xsl:value-of select="@amendment"/></xsl:with-param>
3927
+ </xsl:call-template>
3928
+ <xsl:apply-templates/>
3929
+ <xsl:call-template name="insertTag">
3930
+ <xsl:with-param name="type">closing</xsl:with-param>
3931
+ <xsl:with-param name="kind">A</xsl:with-param>
3932
+ <xsl:with-param name="value"><xsl:value-of select="@amendment"/></xsl:with-param>
3933
+ </xsl:call-template>
3934
+ </fo:inline>
3935
+ </xsl:when>
3936
+ <xsl:when test="@corrigenda">
3937
+ <fo:inline>
3938
+ <xsl:call-template name="insertTag">
3939
+ <xsl:with-param name="kind">C</xsl:with-param>
3940
+ <xsl:with-param name="value"><xsl:value-of select="@corrigenda"/></xsl:with-param>
3941
+ </xsl:call-template>
3942
+ <xsl:apply-templates/>
3943
+ <xsl:call-template name="insertTag">
3944
+ <xsl:with-param name="type">closing</xsl:with-param>
3945
+ <xsl:with-param name="kind">C</xsl:with-param>
3946
+ <xsl:with-param name="value"><xsl:value-of select="@corrigenda"/></xsl:with-param>
3947
+ </xsl:call-template>
3948
+ </fo:inline>
3949
+ </xsl:when>
3950
+ <xsl:otherwise>
3951
+ <fo:inline xsl:use-attribute-sets="add-style">
3952
+ <xsl:apply-templates/>
3953
+ </fo:inline>
3954
+ </xsl:otherwise>
3955
+ </xsl:choose>
3956
+
3957
+ </xsl:template><xsl:template name="insertTag">
3958
+ <xsl:param name="type"/>
3959
+ <xsl:param name="kind"/>
3960
+ <xsl:param name="value"/>
3961
+ <xsl:variable name="add_width" select="string-length($value) * 20"/>
3962
+ <xsl:variable name="maxwidth" select="60 + $add_width"/>
3963
+ <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-20%"><!-- alignment-baseline="middle" -->
3964
+ <!-- <xsl:attribute name="width">7mm</xsl:attribute>
3965
+ <xsl:attribute name="content-height">100%</xsl:attribute> -->
3966
+ <xsl:attribute name="height">5mm</xsl:attribute>
3967
+ <xsl:attribute name="content-width">100%</xsl:attribute>
3968
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
3969
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
3970
+ <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
3971
+ <g>
3972
+ <xsl:if test="$type = 'closing'">
3973
+ <xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
3974
+ </xsl:if>
3975
+ <polyline points="0,0 {$maxwidth},0 {$maxwidth + 30},40 {$maxwidth},80 0,80 " stroke="black" stroke-width="5" fill="white"/>
3976
+ <line x1="0" y1="0" x2="0" y2="80" stroke="black" stroke-width="20"/>
3977
+ </g>
3978
+ <text font-family="Arial" x="15" y="57" font-size="40pt">
3979
+ <xsl:if test="$type = 'closing'">
3980
+ <xsl:attribute name="x">25</xsl:attribute>
3981
+ </xsl:if>
3982
+ <xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
3983
+ </text>
3984
+ </svg>
3985
+ </fo:instream-foreign-object>
3775
3986
  </xsl:template><xsl:template match="*[local-name()='del']">
3776
- <fo:inline font-size="10pt" color="red" text-decoration="line-through">
3987
+ <fo:inline xsl:use-attribute-sets="del-style">
3777
3988
  <xsl:apply-templates/>
3778
3989
  </fo:inline>
3779
3990
  </xsl:template><xsl:template match="*[local-name()='hi']">
@@ -4070,11 +4281,15 @@
4070
4281
  </xsl:apply-templates>
4071
4282
  </xsl:template><xsl:template name="getLang">
4072
4283
  <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4284
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4073
4285
  <xsl:variable name="language">
4074
4286
  <xsl:choose>
4075
4287
  <xsl:when test="$language_current != ''">
4076
4288
  <xsl:value-of select="$language_current"/>
4077
4289
  </xsl:when>
4290
+ <xsl:when test="$language_current_2 != ''">
4291
+ <xsl:value-of select="$language_current_2"/>
4292
+ </xsl:when>
4078
4293
  <xsl:otherwise>
4079
4294
  <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
4080
4295
  </xsl:otherwise>
@@ -4114,13 +4329,23 @@
4114
4329
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
4115
4330
  <xsl:value-of select="substring($str, 2)"/>
4116
4331
  </xsl:template><xsl:template match="mathml:math">
4117
- <fo:inline font-family="STIX Two Math"> <!-- -->
4332
+ <xsl:variable name="isAdded" select="@added"/>
4333
+ <xsl:variable name="isDeleted" select="@deleted"/>
4334
+
4335
+ <fo:inline xsl:use-attribute-sets="mathml-style">
4336
+
4337
+
4338
+ <xsl:call-template name="setTrackChangesStyles">
4339
+ <xsl:with-param name="isAdded" select="$isAdded"/>
4340
+ <xsl:with-param name="isDeleted" select="$isDeleted"/>
4341
+ </xsl:call-template>
4118
4342
 
4119
4343
  <xsl:variable name="mathml">
4120
4344
  <xsl:apply-templates select="." mode="mathml"/>
4121
4345
  </xsl:variable>
4122
4346
  <fo:instream-foreign-object fox:alt-text="Math">
4123
4347
 
4348
+
4124
4349
  <!-- <xsl:copy-of select="."/> -->
4125
4350
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
4126
4351
  </fo:instream-foreign-object>
@@ -4281,6 +4506,7 @@
4281
4506
 
4282
4507
 
4283
4508
  <fo:inline xsl:use-attribute-sets="note-name-style">
4509
+
4284
4510
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4285
4511
  </fo:inline>
4286
4512
  <xsl:apply-templates/>
@@ -4307,6 +4533,7 @@
4307
4533
  </xsl:template><xsl:template match="*[local-name() = 'termnote']">
4308
4534
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
4309
4535
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
4536
+
4310
4537
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4311
4538
  </fo:inline>
4312
4539
  <xsl:apply-templates/>
@@ -4372,8 +4599,15 @@
4372
4599
  </fo:inline>
4373
4600
  </xsl:if>
4374
4601
  </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
4602
+ <xsl:variable name="isAdded" select="@added"/>
4603
+ <xsl:variable name="isDeleted" select="@deleted"/>
4375
4604
  <fo:block-container id="{@id}">
4376
4605
 
4606
+ <xsl:call-template name="setTrackChangesStyles">
4607
+ <xsl:with-param name="isAdded" select="$isAdded"/>
4608
+ <xsl:with-param name="isDeleted" select="$isDeleted"/>
4609
+ </xsl:call-template>
4610
+
4377
4611
  <fo:block>
4378
4612
  <xsl:apply-templates/>
4379
4613
  </fo:block>
@@ -4381,7 +4615,10 @@
4381
4615
  <xsl:for-each select="*[local-name() = 'note']">
4382
4616
  <xsl:call-template name="note"/>
4383
4617
  </xsl:for-each>
4384
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4618
+
4619
+
4620
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4621
+
4385
4622
  </fo:block-container>
4386
4623
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
4387
4624
  <fo:block id="{@id}">
@@ -4393,37 +4630,122 @@
4393
4630
  <xsl:apply-templates/>
4394
4631
  </fo:block>
4395
4632
  </xsl:template><xsl:template match="*[local-name() = 'image']">
4396
- <fo:block xsl:use-attribute-sets="image-style">
4397
-
4398
-
4399
- <xsl:variable name="src">
4400
- <xsl:choose>
4401
- <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
4402
- <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
4403
- </xsl:when>
4404
- <xsl:otherwise>
4405
- <xsl:value-of select="@src"/>
4406
- </xsl:otherwise>
4407
- </xsl:choose>
4408
- </xsl:variable>
4409
-
4410
- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
4411
- </fo:block>
4633
+ <xsl:variable name="isAdded" select="../@added"/>
4634
+ <xsl:variable name="isDeleted" select="../@deleted"/>
4635
+ <xsl:choose>
4636
+ <xsl:when test="ancestor::*[local-name() = 'title']">
4637
+ <fo:inline padding-left="1mm" padding-right="1mm">
4638
+ <xsl:variable name="src">
4639
+ <xsl:call-template name="image_src"/>
4640
+ </xsl:variable>
4641
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle"/>
4642
+ </fo:inline>
4643
+ </xsl:when>
4644
+ <xsl:otherwise>
4645
+ <fo:block xsl:use-attribute-sets="image-style">
4646
+
4647
+ <xsl:variable name="src">
4648
+ <xsl:call-template name="image_src"/>
4649
+ </xsl:variable>
4650
+
4651
+ <xsl:choose>
4652
+ <xsl:when test="$isDeleted = 'true'">
4653
+ <!-- enclose in svg -->
4654
+ <fo:instream-foreign-object fox:alt-text="Image {@alt}">
4655
+ <xsl:attribute name="width">100%</xsl:attribute>
4656
+ <xsl:attribute name="content-height">100%</xsl:attribute>
4657
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4658
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
4659
+
4660
+
4661
+ <xsl:apply-templates select="." mode="cross_image"/>
4662
+
4663
+ </fo:instream-foreign-object>
4664
+ </xsl:when>
4665
+ <xsl:otherwise>
4666
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
4667
+ </xsl:otherwise>
4668
+ </xsl:choose>
4669
+
4670
+ </fo:block>
4671
+ </xsl:otherwise>
4672
+ </xsl:choose>
4673
+ </xsl:template><xsl:template name="image_src">
4674
+ <xsl:choose>
4675
+ <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
4676
+ <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
4677
+ </xsl:when>
4678
+ <xsl:when test="not(starts-with(@src, 'data:'))">
4679
+ <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
4680
+ </xsl:when>
4681
+ <xsl:otherwise>
4682
+ <xsl:value-of select="@src"/>
4683
+ </xsl:otherwise>
4684
+ </xsl:choose>
4685
+ </xsl:template><xsl:template match="*[local-name() = 'image']" mode="cross_image">
4686
+ <xsl:choose>
4687
+ <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
4688
+ <xsl:variable name="src">
4689
+ <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
4690
+ </xsl:variable>
4691
+ <xsl:variable name="width" select="document($src)/@width"/>
4692
+ <xsl:variable name="height" select="document($src)/@height"/>
4693
+ <svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="enable-background:new 0 0 595.28 841.89;" height="{$height}" width="{$width}" viewBox="0 0 {$width} {$height}" y="0px" x="0px" id="Layer_1" version="1.1">
4694
+ <image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{$src}" style="overflow:visible;"/>
4695
+ </svg>
4696
+ </xsl:when>
4697
+ <xsl:when test="not(starts-with(@src, 'data:'))">
4698
+ <xsl:variable name="src">
4699
+ <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
4700
+ </xsl:variable>
4701
+ <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
4702
+ <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
4703
+ <xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
4704
+ <xsl:variable name="height" select="java:getHeight($bufferedImage)"/>
4705
+ <svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="enable-background:new 0 0 595.28 841.89;" height="{$height}" width="{$width}" viewBox="0 0 {$width} {$height}" y="0px" x="0px" id="Layer_1" version="1.1">
4706
+ <image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{$src}" style="overflow:visible;"/>
4707
+ </svg>
4708
+ </xsl:when>
4709
+ <xsl:otherwise>
4710
+ <xsl:variable name="base64String" select="substring-after(@src, 'base64,')"/>
4711
+ <xsl:variable name="decoder" select="java:java.util.Base64.getDecoder()"/>
4712
+ <xsl:variable name="fileContent" select="java:decode($decoder, $base64String)"/>
4713
+ <xsl:variable name="bis" select="java:java.io.ByteArrayInputStream.new($fileContent)"/>
4714
+ <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($bis)"/>
4715
+ <xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
4716
+ <!-- width=<xsl:value-of select="$width"/> -->
4717
+ <xsl:variable name="height" select="java:getHeight($bufferedImage)"/>
4718
+ <!-- height=<xsl:value-of select="$height"/> -->
4719
+ <svg xmlns="http://www.w3.org/2000/svg" xml:space="preserve" style="enable-background:new 0 0 595.28 841.89;" height="{$height}" width="{$width}" viewBox="0 0 {$width} {$height}" y="0px" x="0px" id="Layer_1" version="1.1">
4720
+ <image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{@src}" height="{$height}" width="{$width}" style="overflow:visible;"/>
4721
+ <xsl:call-template name="svg_cross">
4722
+ <xsl:with-param name="width" select="$width"/>
4723
+ <xsl:with-param name="height" select="$height"/>
4724
+ </xsl:call-template>
4725
+ </svg>
4726
+ </xsl:otherwise>
4727
+ </xsl:choose>
4728
+
4729
+ </xsl:template><xsl:template name="svg_cross">
4730
+ <xsl:param name="width"/>
4731
+ <xsl:param name="height"/>
4732
+ <line xmlns="http://www.w3.org/2000/svg" x1="0" y1="0" x2="{$width}" y2="{$height}" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
4733
+ <line xmlns="http://www.w3.org/2000/svg" x1="0" y1="{$height}" x2="{$width}" y2="0" style="stroke: rgb(255, 0, 0); stroke-width:4px; "/>
4412
4734
  </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">
4413
4735
  <xsl:apply-templates mode="contents"/>
4414
4736
  <xsl:text> </xsl:text>
4415
4737
  </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">
4416
4738
  <xsl:apply-templates mode="bookmarks"/>
4417
4739
  <xsl:text> </xsl:text>
4418
- </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
4740
+ </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="contents" priority="2">
4419
4741
  <xsl:value-of select="."/>
4420
- </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
4742
+ </xsl:template><xsl:template match="*[local-name() = 'figure' or local-name() = 'table' or local-name() = 'permission' or local-name() = 'recommendation' or local-name() = 'requirement']/*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
4421
4743
  <xsl:value-of select="."/>
4422
4744
  </xsl:template><xsl:template match="node()" mode="contents">
4423
4745
  <xsl:apply-templates mode="contents"/>
4424
4746
  </xsl:template><xsl:template match="node()" mode="bookmarks">
4425
4747
  <xsl:apply-templates mode="bookmarks"/>
4426
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
4748
+ </xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
4427
4749
  <xsl:apply-templates select="."/>
4428
4750
  </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4429
4751
  <xsl:apply-templates mode="bookmarks"/>
@@ -4622,6 +4944,8 @@
4622
4944
  </fo:list-item-body>
4623
4945
  </fo:list-item>
4624
4946
  </fo:list-block>
4947
+ </xsl:template><xsl:template name="extractSection">
4948
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
4625
4949
  </xsl:template><xsl:template name="extractTitle">
4626
4950
  <xsl:choose>
4627
4951
  <xsl:when test="*[local-name() = 'tab']">
@@ -4668,6 +4992,7 @@
4668
4992
 
4669
4993
 
4670
4994
 
4995
+
4671
4996
  10
4672
4997
 
4673
4998
 
@@ -4951,6 +5276,7 @@
4951
5276
  <xsl:variable name="element">
4952
5277
  block
4953
5278
 
5279
+ <xsl:if test="following-sibling::*[1][local-name() = 'table']">block</xsl:if>
4954
5280
  </xsl:variable>
4955
5281
  <xsl:choose>
4956
5282
  <xsl:when test="ancestor::*[local-name() = 'appendix']">
@@ -4958,7 +5284,7 @@
4958
5284
  <xsl:apply-templates/>
4959
5285
  </fo:inline>
4960
5286
  </xsl:when>
4961
- <xsl:when test="normalize-space($element) = 'block'">
5287
+ <xsl:when test="contains(normalize-space($element), 'block')">
4962
5288
  <fo:block xsl:use-attribute-sets="example-name-style">
4963
5289
  <xsl:apply-templates/>
4964
5290
  </fo:block>
@@ -4990,7 +5316,7 @@
4990
5316
  </fo:inline>
4991
5317
  </xsl:otherwise>
4992
5318
  </xsl:choose>
4993
- </xsl:template><xsl:template match="*[local-name() = 'termsource']">
5319
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
4994
5320
  <fo:block xsl:use-attribute-sets="termsource-style">
4995
5321
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
4996
5322
  <xsl:variable name="termsource_text">
@@ -4999,13 +5325,15 @@
4999
5325
 
5000
5326
  <xsl:choose>
5001
5327
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
5002
- <xsl:apply-templates/>
5328
+ <!-- <xsl:apply-templates /> -->
5329
+ <xsl:copy-of select="$termsource_text"/>
5003
5330
  </xsl:when>
5004
5331
  <xsl:otherwise>
5005
5332
 
5006
5333
  <xsl:text>[</xsl:text>
5007
5334
 
5008
- <xsl:apply-templates/>
5335
+ <!-- <xsl:apply-templates /> -->
5336
+ <xsl:copy-of select="$termsource_text"/>
5009
5337
 
5010
5338
  <xsl:text>]</xsl:text>
5011
5339
 
@@ -5016,8 +5344,15 @@
5016
5344
  <xsl:if test="normalize-space() != ''">
5017
5345
  <xsl:value-of select="."/>
5018
5346
  </xsl:if>
5019
- </xsl:template><xsl:template match="*[local-name() = 'origin']">
5347
+ </xsl:template><xsl:variable name="localized.source">
5348
+ <xsl:call-template name="getLocalizedString">
5349
+ <xsl:with-param name="key">source</xsl:with-param>
5350
+ </xsl:call-template>
5351
+ </xsl:variable><xsl:template match="*[local-name() = 'origin']">
5020
5352
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
5353
+ <xsl:if test="normalize-space(@citeas) = ''">
5354
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
5355
+ </xsl:if>
5021
5356
 
5022
5357
  <fo:inline xsl:use-attribute-sets="origin-style">
5023
5358
  <xsl:apply-templates/>
@@ -5167,7 +5502,8 @@
5167
5502
  </fo:inline>
5168
5503
  </xsl:when>
5169
5504
  <xsl:otherwise>
5170
- <fo:inline padding-right="{$padding-right}mm">​</fo:inline>
5505
+ <xsl:variable name="direction"><xsl:if test="$lang = 'ar'"><xsl:value-of select="$RLM"/></xsl:if></xsl:variable>
5506
+ <fo:inline padding-right="{$padding-right}mm"><xsl:value-of select="$direction"/>​</fo:inline>
5171
5507
  </xsl:otherwise>
5172
5508
  </xsl:choose>
5173
5509
 
@@ -5228,7 +5564,6 @@
5228
5564
 
5229
5565
 
5230
5566
 
5231
-
5232
5567
  <xsl:apply-templates/>
5233
5568
  </fo:block>
5234
5569
 
@@ -5275,7 +5610,7 @@
5275
5610
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
5276
5611
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
5277
5612
  <xsl:choose>
5278
- <xsl:when test="parent::*[local-name() = 'note']">
5613
+ <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
5279
5614
  <fo:block-container>
5280
5615
  <xsl:attribute name="margin-left">
5281
5616
  <xsl:choose>
@@ -5285,6 +5620,7 @@
5285
5620
  </xsl:attribute>
5286
5621
 
5287
5622
 
5623
+
5288
5624
  <fo:block-container margin-left="0mm">
5289
5625
  <fo:block>
5290
5626
  <xsl:apply-templates select="." mode="ul_ol"/>
@@ -5443,8 +5779,8 @@
5443
5779
  <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
5444
5780
  <xsl:apply-templates/>
5445
5781
  </fo:block>
5446
- </xsl:template><xsl:template match="*[local-name() = 'bookmark']">
5447
- <fo:inline id="{@id}"/>
5782
+ </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
5783
+ <fo:inline id="{@id}" font-size="1pt"/>
5448
5784
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
5449
5785
  <!-- <row>
5450
5786
  <date>05-07-2013</date>
@@ -5486,6 +5822,10 @@
5486
5822
 
5487
5823
 
5488
5824
 
5825
+
5826
+
5827
+
5828
+
5489
5829
  </xsl:template><xsl:template name="processBibitemDocId">
5490
5830
  <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')]"/>
5491
5831
  <xsl:choose>
@@ -5542,6 +5882,70 @@
5542
5882
  <xsl:value-of select="substring(.,1,1)"/>
5543
5883
  </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
5544
5884
  <fo:inline><xsl:apply-templates/></fo:inline>
5885
+ </xsl:template><xsl:template match="*[local-name() = 'form']">
5886
+ <fo:block>
5887
+ <xsl:apply-templates/>
5888
+ </fo:block>
5889
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'label']">
5890
+ <fo:inline><xsl:apply-templates/></fo:inline>
5891
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'text' or @type = 'date' or @type = 'file' or @type = 'password']">
5892
+ <fo:inline>
5893
+ <xsl:call-template name="text_input"/>
5894
+ </fo:inline>
5895
+ </xsl:template><xsl:template name="text_input">
5896
+ <xsl:variable name="count">
5897
+ <xsl:choose>
5898
+ <xsl:when test="normalize-space(@maxlength) != ''"><xsl:value-of select="@maxlength"/></xsl:when>
5899
+ <xsl:when test="normalize-space(@size) != ''"><xsl:value-of select="@size"/></xsl:when>
5900
+ <xsl:otherwise>10</xsl:otherwise>
5901
+ </xsl:choose>
5902
+ </xsl:variable>
5903
+ <xsl:call-template name="repeat">
5904
+ <xsl:with-param name="char" select="'_'"/>
5905
+ <xsl:with-param name="count" select="$count"/>
5906
+ </xsl:call-template>
5907
+ <xsl:text> </xsl:text>
5908
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'button']">
5909
+ <xsl:variable name="caption">
5910
+ <xsl:choose>
5911
+ <xsl:when test="normalize-space(@value) != ''"><xsl:value-of select="@value"/></xsl:when>
5912
+ <xsl:otherwise>BUTTON</xsl:otherwise>
5913
+ </xsl:choose>
5914
+ </xsl:variable>
5915
+ <fo:inline>[<xsl:value-of select="$caption"/>]</fo:inline>
5916
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'checkbox']">
5917
+ <fo:inline padding-right="1mm">
5918
+ <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
5919
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
5920
+ <xsl:attribute name="content-width">100%</xsl:attribute>
5921
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
5922
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
5923
+ <svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
5924
+ <polyline points="0,0 80,0 80,80 0,80 0,0" stroke="black" stroke-width="5" fill="white"/>
5925
+ </svg>
5926
+ </fo:instream-foreign-object>
5927
+ </fo:inline>
5928
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'radio']">
5929
+ <fo:inline padding-right="1mm">
5930
+ <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
5931
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
5932
+ <xsl:attribute name="content-width">100%</xsl:attribute>
5933
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
5934
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
5935
+ <svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
5936
+ <circle cx="40" cy="40" r="30" stroke="black" stroke-width="5" fill="white"/>
5937
+ <circle cx="40" cy="40" r="15" stroke="black" stroke-width="5" fill="white"/>
5938
+ </svg>
5939
+ </fo:instream-foreign-object>
5940
+ </fo:inline>
5941
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'select']">
5942
+ <fo:inline>
5943
+ <xsl:call-template name="text_input"/>
5944
+ </fo:inline>
5945
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'textarea']">
5946
+ <fo:block-container border="1pt solid black" width="50%">
5947
+ <fo:block> </fo:block>
5948
+ </fo:block-container>
5545
5949
  </xsl:template><xsl:template name="convertDate">
5546
5950
  <xsl:param name="date"/>
5547
5951
  <xsl:param name="format" select="'short'"/>
@@ -5806,6 +6210,7 @@
5806
6210
 
5807
6211
 
5808
6212
 
6213
+
5809
6214
  <xsl:value-of select="document('')//*/namespace::itu"/>
5810
6215
 
5811
6216
 
@@ -5873,17 +6278,62 @@
5873
6278
  </xsl:call-template>
5874
6279
  </xsl:if>
5875
6280
  </xsl:template><xsl:template name="getLocalizedString">
5876
- <xsl:param name="key"/>
6281
+ <xsl:param name="key"/>
5877
6282
 
5878
6283
  <xsl:variable name="curr_lang">
5879
6284
  <xsl:call-template name="getLang"/>
5880
6285
  </xsl:variable>
5881
6286
 
6287
+ <xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
6288
+
5882
6289
  <xsl:choose>
6290
+ <xsl:when test="$data_value != ''">
6291
+ <xsl:value-of select="$data_value"/>
6292
+ </xsl:when>
5883
6293
  <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
5884
6294
  <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5885
6295
  </xsl:when>
5886
6296
  <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
5887
6297
  </xsl:choose>
5888
6298
 
6299
+ </xsl:template><xsl:template name="setTrackChangesStyles">
6300
+ <xsl:param name="isAdded"/>
6301
+ <xsl:param name="isDeleted"/>
6302
+ <xsl:choose>
6303
+ <xsl:when test="local-name() = 'math'">
6304
+ <xsl:if test="$isAdded = 'true'">
6305
+ <xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
6306
+ </xsl:if>
6307
+ <xsl:if test="$isDeleted = 'true'">
6308
+ <xsl:attribute name="background-color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
6309
+ </xsl:if>
6310
+ </xsl:when>
6311
+ <xsl:otherwise>
6312
+ <xsl:if test="$isAdded = 'true'">
6313
+ <xsl:attribute name="border"><xsl:value-of select="$border-block-added"/></xsl:attribute>
6314
+ <xsl:attribute name="padding">2mm</xsl:attribute>
6315
+ </xsl:if>
6316
+ <xsl:if test="$isDeleted = 'true'">
6317
+ <xsl:attribute name="border"><xsl:value-of select="$border-block-deleted"/></xsl:attribute>
6318
+ <xsl:if test="local-name() = 'table'">
6319
+ <xsl:attribute name="background-color">rgb(255, 185, 185)</xsl:attribute>
6320
+ </xsl:if>
6321
+ <!-- <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute> -->
6322
+ <xsl:attribute name="padding">2mm</xsl:attribute>
6323
+ </xsl:if>
6324
+ </xsl:otherwise>
6325
+ </xsl:choose>
6326
+ </xsl:template><xsl:variable name="LRM" select="'‎'"/><xsl:variable name="RLM" select="'‏'"/><xsl:template name="setWritingMode">
6327
+ <xsl:if test="$lang = 'ar'">
6328
+ <xsl:attribute name="writing-mode">rl-tb</xsl:attribute>
6329
+ </xsl:if>
6330
+ </xsl:template><xsl:template name="setAlignment">
6331
+ <xsl:param name="align" select="normalize-space(@align)"/>
6332
+ <xsl:choose>
6333
+ <xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
6334
+ <xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
6335
+ <xsl:when test="$align != ''">
6336
+ <xsl:value-of select="$align"/>
6337
+ </xsl:when>
6338
+ </xsl:choose>
5889
6339
  </xsl:template></xsl:stylesheet>