metanorma-itu 1.3.0 → 1.3.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -118,10 +118,17 @@
118
118
 
119
119
  <xsl:template match="/">
120
120
  <xsl:call-template name="namespaceCheck"/>
121
- <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>
122
125
  <xsl:if test="$doctype = 'resolution'">
123
126
  <xsl:attribute name="font-size">11pt</xsl:attribute>
124
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>
125
132
  <fo:layout-master-set>
126
133
 
127
134
 
@@ -322,7 +329,7 @@
322
329
  </xsl:if>
323
330
 
324
331
  <!-- cover page -->
325
- <fo:page-sequence master-reference="cover-page">
332
+ <fo:page-sequence master-reference="cover-page" writing-mode="lr-tb">
326
333
  <xsl:if test="$doctype = 'resolution'">
327
334
  <xsl:attribute name="force-page-count">no-force</xsl:attribute>
328
335
  </xsl:if>
@@ -343,7 +350,7 @@
343
350
  </fo:block-container>
344
351
 
345
352
  <fo:block-container absolute-position="fixed" left="-7mm" top="0" font-size="0">
346
- <fo:block>
353
+ <fo:block text-align="left">
347
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"/>
348
355
  </fo:block>
349
356
  </fo:block-container>
@@ -359,12 +366,15 @@
359
366
  <fo:block> </fo:block>
360
367
  </fo:table-cell>
361
368
  <fo:table-cell number-columns-spanned="3">
362
- <fo:block font-family="Arial" font-size="13pt" font-weight="bold" color="gray"> <!-- margin-top="16pt" letter-spacing="4pt", Helvetica for letter-spacing working -->
363
- <fo:block><xsl:value-of select="$linebreak"/></fo:block>
364
- <xsl:call-template name="addLetterSpacing">
365
- <xsl:with-param name="text" select="/itu:itu-standard/itu:bibdata/itu:contributor[itu:role/@type='author']/itu:organization/itu:name"/>
366
- </xsl:call-template>
367
- </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>
368
378
  </fo:table-cell>
369
379
  </fo:table-row>
370
380
  <fo:table-row>
@@ -372,48 +382,56 @@
372
382
  <fo:block> </fo:block>
373
383
  </fo:table-cell>
374
384
  <fo:table-cell padding-top="2mm" padding-bottom="-1mm">
375
- <fo:block font-family="Arial" font-size="36pt" font-weight="bold" margin-top="6pt" letter-spacing="2pt"> <!-- Helvetica for letter-spacing working -->
376
- <xsl:value-of select="substring-before(/itu:itu-standard/itu:bibdata/itu:docidentifier[@type = 'ITU'], ' ')"/>
377
- </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>
378
393
  </fo:table-cell>
379
394
  <fo:table-cell padding-top="1mm" number-columns-spanned="2" padding-bottom="-1mm">
380
- <fo:block font-size="30pt" font-weight="bold" text-align="right" margin-top="12pt" padding="0mm">
381
- <xsl:choose>
382
- <xsl:when test="$doctype = 'technical-report' or $doctype = 'technical-paper'">
383
- <xsl:value-of select="$doctypeTitle"/>
384
- </xsl:when>
385
- <xsl:when test="$doctype = 'implementers-guide'">
386
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:docidentifier[@type='ITU-Recommendation']"/>
387
- <xsl:text> </xsl:text>
388
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:doctype[@language = $lang]"/>
389
- </xsl:when>
390
- <xsl:when test="$doctype = 'resolution'"/>
391
- <xsl:when test="$doctype = 'recommendation-supplement'">
392
- <!-- Series L -->
393
- <xsl:variable name="title-series">
394
- <xsl:call-template name="getLocalizedString">
395
- <xsl:with-param name="key">series</xsl:with-param>
396
- </xsl:call-template>
397
- </xsl:variable>
398
- <xsl:call-template name="capitalize">
399
- <xsl:with-param name="str" select="$title-series"/>
400
- </xsl:call-template>
401
- <xsl:text> </xsl:text>
402
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:series[@type='main']/itu:title[@type='abbrev']"/>
403
- <!-- Ex. Supplement 37 -->
404
- <fo:block font-size="18pt">
405
- <xsl:call-template name="getLocalizedString">
406
- <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"/>
407
417
  </xsl:call-template>
408
418
  <xsl:text> </xsl:text>
409
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:docnumber"/>
410
- </fo:block>
411
- </xsl:when>
412
- <xsl:otherwise>
413
- <xsl:value-of select="substring-after(/itu:itu-standard/itu:bibdata/itu:docidentifier[@type = 'ITU'], ' ')"/>
414
- </xsl:otherwise>
415
- </xsl:choose>
416
- </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>
417
435
  </fo:table-cell>
418
436
  </fo:table-row>
419
437
  <fo:table-row height="17.2mm">
@@ -421,36 +439,48 @@
421
439
  <fo:block> </fo:block>
422
440
  </fo:table-cell>
423
441
  <fo:table-cell font-size="10pt" number-columns-spanned="2" padding-top="1mm">
424
- <fo:block>
425
- <xsl:text>TELECOMMUNICATION</xsl:text>
426
- </fo:block>
427
- <fo:block>
428
- <xsl:text>STANDARDIZATION SECTOR</xsl:text>
429
- </fo:block>
430
- <fo:block>
431
- <xsl:text>OF ITU</xsl:text>
432
- </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>
433
454
  </fo:table-cell>
434
455
  <fo:table-cell text-align="right">
435
456
  <xsl:if test="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:annexid">
436
- <fo:block font-size="18pt" font-weight="bold">
437
- <xsl:variable name="title-annex">
438
- <xsl:call-template name="getTitle">
439
- <xsl:with-param name="name" select="'title-annex'"/>
440
- </xsl:call-template>
441
- </xsl:variable>
442
- <xsl:value-of select="$title-annex"/><xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:annexid"/>
443
- </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>
444
468
  </xsl:if>
445
469
  <xsl:if test="$isAmendment != ''">
446
- <fo:block font-size="18pt" font-weight="bold">
447
- <xsl:value-of select="$isAmendment"/>
448
- </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>
449
476
  </xsl:if>
450
477
  <xsl:if test="$isCorrigendum != ''">
451
- <fo:block font-size="18pt" font-weight="bold">
452
- <xsl:value-of select="$isCorrigendum"/>
453
- </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>
454
484
  </xsl:if>
455
485
  <fo:block font-size="14pt">
456
486
  <xsl:choose>
@@ -475,79 +505,81 @@
475
505
  <fo:block> </fo:block>
476
506
  </fo:table-cell>
477
507
  <fo:table-cell font-size="16pt" number-columns-spanned="3" border-bottom="0.5mm solid black" padding-right="2mm" display-align="after">
478
- <fo:block padding-bottom="7mm">
479
- <xsl:if test="$doctype = 'resolution'">
480
- <fo:block><xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:meeting"/></fo:block>
481
- <fo:block>
482
- <xsl:variable name="meeting-place" select="/itu:itu-standard/itu:bibdata/itu:ext/itu:meeting-place"/>
483
- <xsl:variable name="meeting-date_from" select="/itu:itu-standard/itu:bibdata/itu:ext/itu:meeting-date/itu:from"/>
484
- <xsl:variable name="meeting-date_from_year" select="substring($meeting-date_from, 1, 4)"/>
485
- <xsl:variable name="meeting-date_to" select="/itu:itu-standard/itu:bibdata/itu:ext/itu:meeting-date/itu:to"/>
486
- <xsl:variable name="meeting-date_to_year" select="substring($meeting-date_to, 1, 4)"/>
487
-
488
- <xsl:variable name="date_format">
489
- <xsl:choose>
490
- <xsl:when test="$meeting-date_from_year = $meeting-date_to_year">ddMM</xsl:when>
491
- <xsl:otherwise>ddMMyyyy</xsl:otherwise>
492
- </xsl:choose>
493
- </xsl:variable>
494
- <xsl:variable name="meeting-date_from_str">
495
- <xsl:call-template name="convertDateLocalized">
496
- <xsl:with-param name="date" select="$meeting-date_from"/>
497
- <xsl:with-param name="format" select="$date_format"/>
498
- </xsl:call-template>
499
- </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>
500
532
 
501
- <xsl:variable name="meeting-date_to_str">
502
- <xsl:call-template name="convertDateLocalized">
503
- <xsl:with-param name="date" select="$meeting-date_to"/>
504
- <xsl:with-param name="format" select="'ddMMyyyy'"/>
505
- </xsl:call-template>
506
- </xsl:variable>
507
-
508
- <xsl:value-of select="$meeting-place"/>
509
- <xsl:if test="$meeting-place != '' and (normalize-space($meeting-date_from_str) != '' or normalize-space($meeting-date_to_str != ''))">
510
- <xsl:text>, </xsl:text>
511
- <xsl:value-of select="$meeting-date_from_str"/>
512
- <xsl:if test="normalize-space($meeting-date_from_str) != '' and normalize-space($meeting-date_to_str) != ''">
513
- <xsl:text> – </xsl:text>
514
- </xsl:if>
515
- <xsl:value-of select="$meeting-date_to_str"/>
516
- </xsl:if>
517
- </fo:block>
518
- </xsl:if>
519
- <fo:block text-transform="uppercase">
520
- <xsl:variable name="series_title" select="normalize-space(/itu:itu-standard/itu:bibdata/itu:series[@type = 'main']/itu:title[@type = 'full'])"/>
521
- <xsl:if test="$series_title != ''">
522
- <xsl:variable name="title">
523
- <xsl:if test="$doctype != 'resolution'">
524
- <!-- <xsl:text>Series </xsl:text> -->
525
- <xsl:call-template name="getLocalizedString">
526
- <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'"/>
527
537
  </xsl:call-template>
528
- <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"/>
529
548
  </xsl:if>
530
- <xsl:value-of select="$series_title"/>
531
- </xsl:variable>
532
- <xsl:value-of select="$title"/>
549
+ </fo:block>
533
550
  </xsl:if>
534
- </fo:block>
535
- <xsl:choose>
536
- <xsl:when test="$doctype = 'recommendation-supplement'"/>
537
- <xsl:otherwise>
538
- <xsl:if test="/itu:itu-standard/itu:bibdata/itu:series">
539
- <fo:block margin-top="6pt">
540
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:series[@type = 'secondary']"/>
541
- <xsl:if test="normalize-space(/itu:itu-standard/itu:bibdata/itu:series[@type = 'tertiary']) != ''">
542
- <xsl:text> — </xsl:text>
543
- <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>
544
561
  </xsl:if>
545
- </fo:block>
562
+ <xsl:value-of select="$series_title"/>
563
+ </xsl:variable>
564
+ <xsl:value-of select="$title"/>
546
565
  </xsl:if>
547
- </xsl:otherwise>
548
- </xsl:choose>
549
-
550
- </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>
551
583
  </fo:table-cell>
552
584
  </fo:table-row>
553
585
  <fo:table-row height="40mm">
@@ -555,49 +587,52 @@
555
587
  <fo:block> </fo:block>
556
588
  </fo:table-cell>
557
589
  <fo:table-cell font-size="18pt" number-columns-spanned="3">
558
- <fo:block padding-right="2mm" margin-top="6pt">
559
- <xsl:if test="not(/itu:itu-standard/itu:bibdata/itu:title[@type = 'annex' and @language = 'en']) and $isAmendment = '' and $isCorrigendum = ''">
560
- <xsl:attribute name="font-weight">bold</xsl:attribute>
561
- </xsl:if>
562
- <xsl:if test="($doctype = 'technical-report' or $doctype = 'technical-paper') and /itu:itu-standard/itu:bibdata/itu:docnumber">
563
- <fo:block font-weight="bold">
564
- <xsl:value-of select="$xSTR-ACRONYM"/>
565
- </fo:block>
566
- </xsl:if>
567
- <xsl:if test="$doctype = 'implementers-guide'">
568
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:doctype[@language = $lang]"/>
569
- <xsl:text> for </xsl:text>
570
- </xsl:if>
571
- <xsl:if test="$doctype = 'resolution'">
572
- <!-- Resolution 1 -->
573
- <xsl:value-of select="$doctypeTitle"/><xsl:text> </xsl:text><xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:docnumber"/>
574
- <xsl:text> – </xsl:text>
575
- </xsl:if>
576
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'main' and @language = 'en']"/>
577
- </fo:block>
578
- <xsl:for-each select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'annex' and @language = 'en']">
579
- <fo:block font-weight="bold">
580
- <xsl:value-of select="."/>
581
- </fo:block>
582
- </xsl:for-each>
583
- <xsl:if test="$isAmendment != ''">
584
- <fo:block padding-right="2mm" margin-top="6pt" font-weight="bold">
585
- <xsl:value-of select="$isAmendment"/>
586
- <xsl:if test="/itu:itu-standard/itu:bibdata/itu:title[@type = 'amendment']">
587
- <xsl:text>: </xsl:text>
588
- <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>
589
595
  </xsl:if>
590
- </fo:block>
591
- </xsl:if>
592
- <xsl:if test="$isCorrigendum != ''">
593
- <fo:block padding-right="2mm" margin-top="6pt" font-weight="bold">
594
- <xsl:value-of select="$isCorrigendum"/>
595
- <xsl:if test="/itu:itu-standard/itu:bibdata/itu:title[@type = 'corrigendum']">
596
- <xsl:text>: </xsl:text>
597
- <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>
598
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>
609
+ </xsl:if>
610
+ <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:title[@type = 'main' and @language = 'en']"/>
599
611
  </fo:block>
600
- </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>
601
636
  </fo:table-cell>
602
637
  </fo:table-row>
603
638
  <fo:table-row height="40mm">
@@ -605,17 +640,20 @@
605
640
  <fo:block> </fo:block>
606
641
  </fo:table-cell>
607
642
  <fo:table-cell number-columns-spanned="3">
608
- <xsl:choose>
609
- <xsl:when test="/itu:itu-standard/itu:boilerplate/itu:legal-statement/itu:clause[@id='draft-warning']">
610
- <xsl:attribute name="border">0.7mm solid black</xsl:attribute>
611
- <fo:block padding-top="3mm" margin-left="1mm" margin-right="1mm">
612
- <xsl:apply-templates select="/itu:itu-standard/itu:boilerplate/itu:legal-statement/itu:clause[@id='draft-warning']" mode="caution"/>
613
- </fo:block>
614
- </xsl:when>
615
- <xsl:otherwise>
616
- <fo:block> </fo:block>
617
- </xsl:otherwise>
618
- </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>
619
657
  </fo:table-cell>
620
658
  </fo:table-row>
621
659
  <fo:table-row height="25mm">
@@ -623,55 +661,58 @@
623
661
  <fo:block> </fo:block>
624
662
  </fo:table-cell>
625
663
  <fo:table-cell number-columns-spanned="3">
626
- <fo:block font-size="16pt" margin-top="3pt">
627
- <xsl:if test="/itu:itu-standard/itu:boilerplate/itu:legal-statement/itu:clause[@id='draft-warning']">
628
- <xsl:attribute name="margin-top">6pt</xsl:attribute>
629
- <xsl:if test="$doctype = 'recommendation-supplement'">
630
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
631
- </xsl:if>
632
- </xsl:if>
633
-
634
- <xsl:choose>
635
- <xsl:when test="$doctype = 'technical-report' or $doctype = 'technical-paper'">
636
- <xsl:if test="/itu:itu-standard/itu:bibdata/itu:status/itu:stage">
637
- <xsl:call-template name="capitalizeWords">
638
- <xsl:with-param name="str" select="/itu:itu-standard/itu:bibdata/itu:status/itu:stage"/>
639
- </xsl:call-template>
640
- <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>
641
671
  </xsl:if>
642
- <xsl:value-of select="$doctypeTitle"/>
643
- <xsl:text>  </xsl:text>
644
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:docidentifier[@type='ITU']"/>
645
- </xsl:when>
646
- <xsl:when test="$doctype = 'implementers-guide'"/>
647
- <xsl:when test="$doctype = 'resolution'"/>
648
- <xsl:when test="$doctype = 'recommendation-supplement'">
649
- <xsl:if test="/itu:itu-standard/itu:bibdata/itu:status/itu:stage = 'draft'">Draft </xsl:if>
650
- <xsl:text>ITU-</xsl:text><xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:editorialgroup/itu:bureau"/><xsl:text> </xsl:text>
651
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:docidentifier[@type = 'ITU-Supplement']"/>
652
- </xsl:when>
653
- <xsl:otherwise>
654
- <xsl:value-of select="$doctypeTitle"/>
655
- <xsl:text>  </xsl:text>
656
- <xsl:if test="/itu:itu-standard/itu:bibdata/itu:contributor/itu:organization/itu:abbreviation">
657
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:contributor/itu:organization/itu:abbreviation"/>
658
- <xsl:text>-</xsl:text>
659
- </xsl:if>
660
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:bureau"/>
661
- <xsl:text>  </xsl:text>
662
- <xsl:value-of select="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:docnumber"/>
663
- </xsl:otherwise>
664
- </xsl:choose>
665
-
666
- <xsl:if test="/itu:itu-standard/itu:bibdata/itu:ext/itu:structuredidentifier/itu:annexid">
667
- <xsl:variable name="title-annex">
668
- <xsl:call-template name="getTitle">
669
- <xsl:with-param name="name" select="'title-annex'"/>
670
- </xsl:call-template>
671
- </xsl:variable>
672
- <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"/>
673
- </xsl:if>
674
- </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>
675
716
  </fo:table-cell>
676
717
  </fo:table-row>
677
718
  </fo:table-body>
@@ -754,7 +795,7 @@
754
795
  <xsl:with-param name="key">table_of_contents</xsl:with-param>
755
796
  </xsl:call-template>
756
797
  </fo:block>
757
- <fo:block margin-top="6pt" text-align="right" font-weight="bold">
798
+ <fo:block margin-top="6pt" text-align="end" font-weight="bold">
758
799
  <xsl:call-template name="getLocalizedString">
759
800
  <xsl:with-param name="key">Page.sg</xsl:with-param>
760
801
  </xsl:call-template>
@@ -825,7 +866,7 @@
825
866
  <fo:block space-before="36pt" text-align="center" font-weight="bold" keep-with-next="always">
826
867
  <xsl:value-of select="$title-list-tables"/>
827
868
  </fo:block>
828
- <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">
829
870
  <xsl:call-template name="getLocalizedString">
830
871
  <xsl:with-param name="key">Page.sg</xsl:with-param>
831
872
  </xsl:call-template>
@@ -857,7 +898,7 @@
857
898
  <fo:block space-before="36pt" text-align="center" font-weight="bold" keep-with-next="always">
858
899
  <xsl:value-of select="$title-list-figures"/>
859
900
  </fo:block>
860
- <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">
861
902
  <xsl:call-template name="getLocalizedString">
862
903
  <xsl:with-param name="key">Page.sg</xsl:with-param>
863
904
  </xsl:call-template>
@@ -1156,12 +1197,19 @@
1156
1197
  <xsl:attribute name="text-align">
1157
1198
  <xsl:choose>
1158
1199
  <xsl:when test="@class='supertitle'">center</xsl:when>
1159
- <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>
1160
1202
  <xsl:when test="ancestor::*[1][local-name() = 'td']/@align">
1161
- <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>
1162
1207
  </xsl:when>
1163
1208
  <xsl:when test="ancestor::*[1][local-name() = 'th']/@align">
1164
- <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>
1165
1213
  </xsl:when>
1166
1214
  <xsl:otherwise>justify</xsl:otherwise>
1167
1215
  </xsl:choose>
@@ -1375,6 +1423,7 @@
1375
1423
  <xsl:variable name="text-align">
1376
1424
  <xsl:choose>
1377
1425
  <xsl:when test="$level = 1 and $doctype = 'resolution'">center</xsl:when>
1426
+ <xsl:when test="$lang = 'ar'">start</xsl:when>
1378
1427
  <xsl:otherwise>left</xsl:otherwise>
1379
1428
  </xsl:choose>
1380
1429
  </xsl:variable>
@@ -1665,19 +1714,25 @@
1665
1714
  </fo:list-item-label>
1666
1715
  <fo:list-item-body start-indent="body-start()">
1667
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>
1668
1723
  <xsl:if test="../preceding-sibling::*[1][local-name() = 'title']">
1669
- <xsl:attribute name="margin-left">18mm</xsl:attribute>
1724
+ <xsl:attribute name="{$attribute-margin}">18mm</xsl:attribute>
1670
1725
  </xsl:if>
1671
1726
  <xsl:if test="local-name(..) = 'ul'">
1672
- <xsl:attribute name="margin-left">7mm</xsl:attribute><!-- 15mm -->
1727
+ <xsl:attribute name="{$attribute-margin}">7mm</xsl:attribute><!-- 15mm -->
1673
1728
  <xsl:if test="ancestor::itu:table">
1674
- <xsl:attribute name="margin-left">4.5mm</xsl:attribute>
1729
+ <xsl:attribute name="{$attribute-margin}">4.5mm</xsl:attribute>
1675
1730
  </xsl:if>
1676
1731
  <!-- <xsl:if test="count(ancestor::itu:ol) + count(ancestor::itu:ul) &gt; 1">
1677
1732
  <xsl:attribute name="margin-left">7mm</xsl:attribute>
1678
1733
  </xsl:if> -->
1679
1734
  </xsl:if>
1680
- <fo:block-container margin-left="0mm">
1735
+ <fo:block-container margin-left="0mm" margin-right="0mm">
1681
1736
  <fo:block>
1682
1737
  <xsl:apply-templates/>
1683
1738
  <xsl:apply-templates select=".//itu:note" mode="process"/>
@@ -1756,19 +1811,7 @@
1756
1811
  <xsl:template match="itu:formula" mode="process">
1757
1812
  <xsl:call-template name="formula"/>
1758
1813
  </xsl:template>
1759
-
1760
- <xsl:template match="mathml:math" priority="2">
1761
- <fo:inline font-family="STIX Two Math" font-size="11pt">
1762
- <xsl:variable name="mathml">
1763
- <xsl:apply-templates select="." mode="mathml"/>
1764
- </xsl:variable>
1765
- <fo:instream-foreign-object fox:alt-text="Math">
1766
- <!-- <xsl:copy-of select="."/> -->
1767
- <xsl:copy-of select="xalan:nodeset($mathml)"/>
1768
- </fo:instream-foreign-object>
1769
- </fo:inline>
1770
- </xsl:template>
1771
-
1814
+
1772
1815
 
1773
1816
  <xsl:template match="itu:references[@normative='true']">
1774
1817
  <fo:block id="{@id}">
@@ -1793,10 +1836,10 @@
1793
1836
  <fo:table-column column-width="90%"/>
1794
1837
  <fo:table-body>
1795
1838
  <fo:table-row>
1796
- <fo:table-cell text-align="left" padding-bottom="8mm">
1839
+ <fo:table-cell text-align="start" padding-bottom="8mm">
1797
1840
  <fo:block><fo:page-number/></fo:block>
1798
1841
  </fo:table-cell>
1799
- <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">
1800
1843
  <fo:block><xsl:value-of select="$footer-text"/></fo:block>
1801
1844
  </fo:table-cell>
1802
1845
  </fo:table-row>
@@ -1811,10 +1854,10 @@
1811
1854
  <fo:table-column column-width="10%"/>
1812
1855
  <fo:table-body>
1813
1856
  <fo:table-row>
1814
- <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">
1815
1858
  <fo:block><xsl:value-of select="$footer-text"/></fo:block>
1816
1859
  </fo:table-cell>
1817
- <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">
1818
1861
  <fo:block><fo:page-number/></fo:block>
1819
1862
  </fo:table-cell>
1820
1863
  </fo:table-row>
@@ -1843,7 +1886,7 @@
1843
1886
  <xsl:variable name="year" select="substring($date, 1, 4)"/>
1844
1887
  <xsl:variable name="month" select="substring($date, 6, 2)"/>
1845
1888
  <xsl:if test="$month != '' and $year != ''">
1846
- <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"/>
1847
1890
  </xsl:if>
1848
1891
  </xsl:template>
1849
1892
 
@@ -2016,6 +2059,9 @@
2016
2059
  <title-continued lang="en">(continued)</title-continued>
2017
2060
  <title-continued lang="fr">(continué)</title-continued>
2018
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']"/>
2019
2065
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
2020
2066
  <xsl:param name="name"/>
2021
2067
  <xsl:param name="lang"/>
@@ -2041,10 +2087,16 @@
2041
2087
  </xsl:choose>
2042
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">
2043
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
+
2044
2094
  </xsl:attribute-set><xsl:attribute-set name="link-style">
2045
2095
 
2046
2096
 
2047
2097
 
2098
+
2099
+
2048
2100
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
2049
2101
  <xsl:attribute name="white-space">pre</xsl:attribute>
2050
2102
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
@@ -2090,7 +2142,7 @@
2090
2142
 
2091
2143
 
2092
2144
 
2093
-
2145
+
2094
2146
  </xsl:attribute-set><xsl:attribute-set name="example-style">
2095
2147
 
2096
2148
 
@@ -2106,6 +2158,7 @@
2106
2158
 
2107
2159
 
2108
2160
 
2161
+
2109
2162
  </xsl:attribute-set><xsl:attribute-set name="example-body-style">
2110
2163
 
2111
2164
 
@@ -2124,9 +2177,7 @@
2124
2177
 
2125
2178
 
2126
2179
 
2127
-
2128
-
2129
-
2180
+
2130
2181
 
2131
2182
 
2132
2183
 
@@ -2155,8 +2206,10 @@
2155
2206
 
2156
2207
 
2157
2208
 
2209
+
2158
2210
  </xsl:attribute-set><xsl:attribute-set name="table-name-style">
2159
2211
  <xsl:attribute name="keep-with-next">always</xsl:attribute>
2212
+
2160
2213
 
2161
2214
  <xsl:attribute name="font-weight">bold</xsl:attribute>
2162
2215
  <xsl:attribute name="text-align">center</xsl:attribute>
@@ -2173,6 +2226,9 @@
2173
2226
 
2174
2227
 
2175
2228
 
2229
+
2230
+ </xsl:attribute-set><xsl:attribute-set name="table-footer-cell-style">
2231
+
2176
2232
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
2177
2233
 
2178
2234
 
@@ -2184,10 +2240,12 @@
2184
2240
  </xsl:attribute-set><xsl:attribute-set name="xref-style">
2185
2241
 
2186
2242
 
2243
+
2187
2244
  <xsl:attribute name="color">blue</xsl:attribute>
2188
2245
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
2189
2246
 
2190
2247
 
2248
+
2191
2249
  </xsl:attribute-set><xsl:attribute-set name="eref-style">
2192
2250
 
2193
2251
 
@@ -2196,10 +2254,12 @@
2196
2254
 
2197
2255
 
2198
2256
 
2257
+
2199
2258
  </xsl:attribute-set><xsl:attribute-set name="note-style">
2200
2259
 
2201
2260
 
2202
2261
 
2262
+
2203
2263
 
2204
2264
 
2205
2265
 
@@ -2215,6 +2275,7 @@
2215
2275
 
2216
2276
 
2217
2277
 
2278
+
2218
2279
  </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">
2219
2280
 
2220
2281
 
@@ -2229,6 +2290,7 @@
2229
2290
 
2230
2291
 
2231
2292
 
2293
+
2232
2294
  </xsl:attribute-set><xsl:attribute-set name="note-p-style">
2233
2295
 
2234
2296
 
@@ -2249,13 +2311,17 @@
2249
2311
 
2250
2312
 
2251
2313
 
2314
+
2252
2315
 
2253
2316
  <xsl:attribute name="margin-top">4pt</xsl:attribute>
2254
2317
 
2255
2318
 
2319
+
2256
2320
  </xsl:attribute-set><xsl:attribute-set name="termnote-name-style">
2321
+
2257
2322
 
2258
2323
 
2324
+
2259
2325
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
2260
2326
 
2261
2327
 
@@ -2280,14 +2346,18 @@
2280
2346
 
2281
2347
 
2282
2348
 
2349
+
2350
+
2283
2351
  </xsl:attribute-set><xsl:attribute-set name="origin-style">
2284
2352
 
2285
2353
 
2286
2354
 
2355
+
2287
2356
  </xsl:attribute-set><xsl:attribute-set name="term-style">
2288
2357
 
2289
2358
  </xsl:attribute-set><xsl:attribute-set name="figure-name-style">
2290
2359
 
2360
+
2291
2361
 
2292
2362
 
2293
2363
 
@@ -2307,6 +2377,7 @@
2307
2377
 
2308
2378
 
2309
2379
 
2380
+
2310
2381
 
2311
2382
 
2312
2383
 
@@ -2323,6 +2394,7 @@
2323
2394
 
2324
2395
 
2325
2396
 
2397
+
2326
2398
  </xsl:attribute-set><xsl:attribute-set name="figure-pseudocode-p-style">
2327
2399
 
2328
2400
  <xsl:attribute name="font-size">10pt</xsl:attribute>
@@ -2334,6 +2406,7 @@
2334
2406
 
2335
2407
 
2336
2408
 
2409
+
2337
2410
  <xsl:attribute name="width">75%</xsl:attribute>
2338
2411
  <xsl:attribute name="content-height">100%</xsl:attribute>
2339
2412
  <xsl:attribute name="content-width">scale-to-fit</xsl:attribute>
@@ -2356,18 +2429,37 @@
2356
2429
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
2357
2430
 
2358
2431
 
2432
+
2359
2433
  </xsl:attribute-set><xsl:attribute-set name="deprecates-style">
2360
2434
 
2435
+
2361
2436
  </xsl:attribute-set><xsl:attribute-set name="definition-style">
2362
2437
 
2363
2438
 
2364
- </xsl:attribute-set><xsl:attribute-set name="add-style">
2439
+
2440
+ </xsl:attribute-set><xsl:variable name="color-added-text">
2441
+ <xsl:text>rgb(0, 255, 0)</xsl:text>
2442
+ </xsl:variable><xsl:attribute-set name="add-style">
2365
2443
  <xsl:attribute name="color">red</xsl:attribute>
2366
2444
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
2367
- </xsl:attribute-set><xsl:attribute-set name="del-style">
2368
- <xsl:attribute name="color">red</xsl:attribute>
2445
+ <!-- <xsl:attribute name="color">black</xsl:attribute>
2446
+ <xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
2447
+ <xsl:attribute name="padding-top">1mm</xsl:attribute>
2448
+ <xsl:attribute name="padding-bottom">0.5mm</xsl:attribute> -->
2449
+ </xsl:attribute-set><xsl:variable name="color-deleted-text">
2450
+ <xsl:text>red</xsl:text>
2451
+ </xsl:variable><xsl:attribute-set name="del-style">
2452
+ <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
2369
2453
  <xsl:attribute name="text-decoration">line-through</xsl:attribute>
2370
- </xsl:attribute-set><xsl:template name="processPrefaceSectionsDefault_Contents">
2454
+ </xsl:attribute-set><xsl:attribute-set name="mathml-style">
2455
+ <xsl:attribute name="font-family">STIX Two Math</xsl:attribute>
2456
+
2457
+
2458
+ <xsl:attribute name="font-size">11pt</xsl:attribute>
2459
+
2460
+ </xsl:attribute-set><xsl:attribute-set name="list-style">
2461
+
2462
+ </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">
2371
2463
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
2372
2464
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
2373
2465
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='introduction']" mode="contents"/>
@@ -2412,20 +2504,21 @@
2412
2504
  <xsl:call-template name="add-zero-spaces-java"/>
2413
2505
  </xsl:template><xsl:template match="*[local-name()='table']" name="table">
2414
2506
 
2507
+ <xsl:variable name="table-preamble">
2508
+
2509
+ <fo:block space-before="18pt"> </fo:block>
2510
+
2511
+
2512
+ </xsl:variable>
2513
+
2415
2514
  <xsl:variable name="table">
2416
2515
 
2417
2516
  <xsl:variable name="simple-table">
2418
- <xsl:call-template name="getSimpleTable"/>
2517
+ <xsl:call-template name="getSimpleTable"/>
2419
2518
  </xsl:variable>
2420
2519
 
2421
-
2422
- <fo:block space-before="18pt"> </fo:block>
2423
-
2424
-
2425
-
2426
-
2427
2520
  <!-- <xsl:if test="$namespace = 'bipm'">
2428
- <fo:block>&#xA0;</fo:block>
2521
+ <fo:block>&#xA0;</fo:block>
2429
2522
  </xsl:if> -->
2430
2523
 
2431
2524
  <!-- $namespace = 'iso' or -->
@@ -2438,7 +2531,7 @@
2438
2531
 
2439
2532
 
2440
2533
 
2441
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
2534
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)/*/tr[1]/td)"/>
2442
2535
 
2443
2536
  <!-- <xsl:variable name="cols-count">
2444
2537
  <xsl:choose>
@@ -2457,8 +2550,6 @@
2457
2550
  <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
2458
2551
  <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
2459
2552
 
2460
-
2461
-
2462
2553
  <xsl:variable name="colwidths">
2463
2554
  <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
2464
2555
  <xsl:call-template name="calculate-column-widths">
@@ -2486,8 +2577,10 @@
2486
2577
  </xsl:choose>
2487
2578
  </xsl:variable>
2488
2579
 
2580
+
2489
2581
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
2490
2582
 
2583
+
2491
2584
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2492
2585
 
2493
2586
 
@@ -2509,6 +2602,8 @@
2509
2602
 
2510
2603
 
2511
2604
 
2605
+
2606
+
2512
2607
  <xsl:variable name="table_width">
2513
2608
  <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
2514
2609
  100%
@@ -2524,6 +2619,8 @@
2524
2619
 
2525
2620
 
2526
2621
 
2622
+
2623
+
2527
2624
  <attribute name="margin-left">0mm</attribute>
2528
2625
  <attribute name="margin-right">0mm</attribute>
2529
2626
 
@@ -2534,6 +2631,7 @@
2534
2631
 
2535
2632
 
2536
2633
 
2634
+
2537
2635
  </xsl:variable>
2538
2636
 
2539
2637
 
@@ -2617,7 +2715,8 @@
2617
2715
  </fo:block-container>
2618
2716
  </xsl:variable>
2619
2717
 
2620
-
2718
+ <xsl:variable name="isAdded" select="@added"/>
2719
+ <xsl:variable name="isDeleted" select="@deleted"/>
2621
2720
 
2622
2721
  <xsl:choose>
2623
2722
  <xsl:when test="@width">
@@ -2631,7 +2730,14 @@
2631
2730
  <fo:table-body>
2632
2731
  <fo:table-row>
2633
2732
  <fo:table-cell column-number="2">
2634
- <fo:block><xsl:copy-of select="$table"/></fo:block>
2733
+ <xsl:copy-of select="$table-preamble"/>
2734
+ <fo:block>
2735
+ <xsl:call-template name="setTrackChangesStyles">
2736
+ <xsl:with-param name="isAdded" select="$isAdded"/>
2737
+ <xsl:with-param name="isDeleted" select="$isDeleted"/>
2738
+ </xsl:call-template>
2739
+ <xsl:copy-of select="$table"/>
2740
+ </fo:block>
2635
2741
  </fo:table-cell>
2636
2742
  </fo:table-row>
2637
2743
  </fo:table-body>
@@ -2642,16 +2748,45 @@
2642
2748
 
2643
2749
  </xsl:when>
2644
2750
  <xsl:otherwise>
2645
- <xsl:copy-of select="$table"/>
2751
+ <xsl:choose>
2752
+ <xsl:when test="$isAdded = 'true' or $isDeleted = 'true'">
2753
+ <xsl:copy-of select="$table-preamble"/>
2754
+ <fo:block>
2755
+ <xsl:call-template name="setTrackChangesStyles">
2756
+ <xsl:with-param name="isAdded" select="$isAdded"/>
2757
+ <xsl:with-param name="isDeleted" select="$isDeleted"/>
2758
+ </xsl:call-template>
2759
+ <xsl:copy-of select="$table"/>
2760
+ </fo:block>
2761
+ </xsl:when>
2762
+ <xsl:otherwise>
2763
+ <xsl:copy-of select="$table-preamble"/>
2764
+ <xsl:copy-of select="$table"/>
2765
+ </xsl:otherwise>
2766
+ </xsl:choose>
2646
2767
  </xsl:otherwise>
2647
2768
  </xsl:choose>
2648
2769
 
2649
2770
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
2771
+ <xsl:param name="continued"/>
2650
2772
  <xsl:if test="normalize-space() != ''">
2651
2773
  <fo:block xsl:use-attribute-sets="table-name-style">
2652
2774
 
2653
2775
 
2654
- <xsl:apply-templates/>
2776
+
2777
+
2778
+
2779
+ <xsl:choose>
2780
+ <xsl:when test="$continued = 'true'">
2781
+ <!-- <xsl:if test="$namespace = 'bsi'"></xsl:if> -->
2782
+
2783
+ </xsl:when>
2784
+ <xsl:otherwise>
2785
+ <xsl:apply-templates/>
2786
+ </xsl:otherwise>
2787
+ </xsl:choose>
2788
+
2789
+
2655
2790
  </fo:block>
2656
2791
  </xsl:if>
2657
2792
  </xsl:template><xsl:template name="calculate-columns-numbers">
@@ -2703,7 +2838,7 @@
2703
2838
  </xsl:for-each>
2704
2839
  </xsl:when>
2705
2840
  <xsl:otherwise>
2706
- <xsl:for-each select="xalan:nodeset($table)//tr">
2841
+ <xsl:for-each select="xalan:nodeset($table)/*/tr">
2707
2842
  <xsl:variable name="td_text">
2708
2843
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
2709
2844
 
@@ -2788,21 +2923,22 @@
2788
2923
  <!-- font-weight="bold" -->
2789
2924
  <fo:table-header>
2790
2925
 
2926
+
2791
2927
  <xsl:apply-templates/>
2792
2928
  </fo:table-header>
2793
2929
  </xsl:template><xsl:template name="table-header-title">
2794
- <xsl:param name="cols-count"/>
2930
+ <xsl:param name="cols-count"/>
2795
2931
  <!-- row for title -->
2796
2932
  <fo:table-row>
2797
2933
  <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">
2798
- <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation"/>
2934
+
2935
+ <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
2936
+ <xsl:with-param name="continued">true</xsl:with-param>
2937
+ </xsl:apply-templates>
2799
2938
  <xsl:for-each select="ancestor::*[local-name()='table'][1]">
2800
2939
  <xsl:call-template name="fn_name_display"/>
2801
- </xsl:for-each>
2802
- <fo:block text-align="right" font-style="italic">
2803
- <xsl:text> </xsl:text>
2804
- <fo:retrieve-table-marker retrieve-class-name="table_continued"/>
2805
- </fo:block>
2940
+ </xsl:for-each>
2941
+
2806
2942
  </fo:table-cell>
2807
2943
  </fo:table-row>
2808
2944
  </xsl:template><xsl:template match="*[local-name()='thead']" mode="process_tbody">
@@ -3031,6 +3167,7 @@
3031
3167
 
3032
3168
 
3033
3169
 
3170
+
3034
3171
  </xsl:if>
3035
3172
  <xsl:if test="$parent-name = 'tfoot'">
3036
3173
 
@@ -3040,6 +3177,10 @@
3040
3177
 
3041
3178
 
3042
3179
 
3180
+
3181
+
3182
+
3183
+
3043
3184
  <!-- <xsl:if test="$namespace = 'bipm'">
3044
3185
  <xsl:attribute name="height">8mm</xsl:attribute>
3045
3186
  </xsl:if> -->
@@ -3051,7 +3192,8 @@
3051
3192
  <xsl:attribute name="text-align">
3052
3193
  <xsl:choose>
3053
3194
  <xsl:when test="@align">
3054
- <xsl:value-of select="@align"/>
3195
+ <xsl:call-template name="setAlignment"/>
3196
+ <!-- <xsl:value-of select="@align"/> -->
3055
3197
  </xsl:when>
3056
3198
  <xsl:otherwise>center</xsl:otherwise>
3057
3199
  </xsl:choose>
@@ -3059,6 +3201,7 @@
3059
3201
 
3060
3202
 
3061
3203
 
3204
+
3062
3205
  <xsl:if test="ancestor::*[local-name()='preface']">
3063
3206
  <xsl:attribute name="border">solid black 0pt</xsl:attribute>
3064
3207
  </xsl:if>
@@ -3071,6 +3214,10 @@
3071
3214
 
3072
3215
 
3073
3216
 
3217
+
3218
+ <xsl:if test="$lang = 'ar'">
3219
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
3220
+ </xsl:if>
3074
3221
  <xsl:if test="@colspan">
3075
3222
  <xsl:attribute name="number-columns-spanned">
3076
3223
  <xsl:value-of select="@colspan"/>
@@ -3102,11 +3249,16 @@
3102
3249
  <xsl:attribute name="text-align">
3103
3250
  <xsl:choose>
3104
3251
  <xsl:when test="@align">
3105
- <xsl:value-of select="@align"/>
3252
+ <xsl:call-template name="setAlignment"/>
3253
+ <!-- <xsl:value-of select="@align"/> -->
3106
3254
  </xsl:when>
3107
3255
  <xsl:otherwise>left</xsl:otherwise>
3108
3256
  </xsl:choose>
3109
3257
  </xsl:attribute>
3258
+ <xsl:if test="$lang = 'ar'">
3259
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
3260
+ </xsl:if>
3261
+
3110
3262
 
3111
3263
 
3112
3264
  <xsl:if test="ancestor::*[local-name()='preface']">
@@ -3123,6 +3275,12 @@
3123
3275
 
3124
3276
 
3125
3277
 
3278
+
3279
+
3280
+
3281
+ <xsl:if test=".//*[local-name() = 'table']">
3282
+ <xsl:attribute name="padding-right">1mm</xsl:attribute>
3283
+ </xsl:if>
3126
3284
  <xsl:if test="@colspan">
3127
3285
  <xsl:attribute name="number-columns-spanned">
3128
3286
  <xsl:value-of select="@colspan"/>
@@ -3266,13 +3424,13 @@
3266
3424
  </xsl:choose>
3267
3425
  </xsl:variable>
3268
3426
  <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
3269
- <xsl:element name="{$ns}:table">
3427
+ <!-- <xsl:element name="{$ns}:table"> -->
3270
3428
  <xsl:for-each select="*[local-name() = 'dl'][1]">
3271
3429
  <tbody>
3272
3430
  <xsl:apply-templates mode="dl"/>
3273
3431
  </tbody>
3274
3432
  </xsl:for-each>
3275
- </xsl:element>
3433
+ <!-- </xsl:element> -->
3276
3434
  </xsl:variable>
3277
3435
 
3278
3436
  <xsl:call-template name="calculate-column-widths">
@@ -3354,6 +3512,7 @@
3354
3512
 
3355
3513
 
3356
3514
 
3515
+
3357
3516
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
3358
3517
 
3359
3518
 
@@ -3366,6 +3525,8 @@
3366
3525
  <xsl:apply-templates/>
3367
3526
  </fo:inline>
3368
3527
  </xsl:template><xsl:template match="*[local-name()='dl']">
3528
+ <xsl:variable name="isAdded" select="@added"/>
3529
+ <xsl:variable name="isDeleted" select="@deleted"/>
3369
3530
  <fo:block-container>
3370
3531
 
3371
3532
  <xsl:if test="not(ancestor::*[local-name() = 'quote'])">
@@ -3382,6 +3543,12 @@
3382
3543
  </xsl:attribute>
3383
3544
 
3384
3545
  </xsl:if>
3546
+
3547
+ <xsl:call-template name="setTrackChangesStyles">
3548
+ <xsl:with-param name="isAdded" select="$isAdded"/>
3549
+ <xsl:with-param name="isDeleted" select="$isDeleted"/>
3550
+ </xsl:call-template>
3551
+
3385
3552
  <fo:block-container>
3386
3553
 
3387
3554
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
@@ -3439,6 +3606,7 @@
3439
3606
 
3440
3607
 
3441
3608
 
3609
+
3442
3610
  <xsl:variable name="title-key">
3443
3611
 
3444
3612
 
@@ -3498,11 +3666,11 @@
3498
3666
  </xsl:choose>
3499
3667
  </xsl:variable>
3500
3668
  <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
3501
- <xsl:element name="{$ns}:table">
3669
+ <!-- <xsl:element name="{$ns}:table"> -->
3502
3670
  <tbody>
3503
3671
  <xsl:apply-templates mode="dl"/>
3504
3672
  </tbody>
3505
- </xsl:element>
3673
+ <!-- </xsl:element> -->
3506
3674
  </xsl:variable>
3507
3675
  <!-- html-table<xsl:copy-of select="$html-table"/> -->
3508
3676
  <xsl:variable name="colwidths">
@@ -3656,6 +3824,7 @@
3656
3824
 
3657
3825
  <fo:table-row>
3658
3826
 
3827
+
3659
3828
  <fo:table-cell>
3660
3829
 
3661
3830
  <xsl:if test="ancestor::*[1][local-name() = 'dl']/preceding-sibling::*[1][local-name() = 'formula']">
@@ -3679,6 +3848,7 @@
3679
3848
 
3680
3849
 
3681
3850
 
3851
+
3682
3852
  <xsl:apply-templates/>
3683
3853
  <!-- <xsl:if test="$namespace = 'gb'">
3684
3854
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -3737,6 +3907,8 @@
3737
3907
 
3738
3908
  <xsl:apply-templates/>
3739
3909
  </fo:inline>
3910
+ </xsl:template><xsl:template match="*[local-name()='padding']">
3911
+ <fo:inline padding-right="{@value}"> </fo:inline>
3740
3912
  </xsl:template><xsl:template match="*[local-name()='sup']">
3741
3913
  <fo:inline font-size="80%" vertical-align="super">
3742
3914
  <xsl:apply-templates/>
@@ -3762,6 +3934,7 @@
3762
3934
 
3763
3935
 
3764
3936
 
3937
+
3765
3938
 
3766
3939
  </xsl:variable>
3767
3940
  <xsl:variable name="font-size" select="normalize-space($_font-size)"/>
@@ -3780,9 +3953,71 @@
3780
3953
  <xsl:apply-templates/>
3781
3954
  </fo:inline>
3782
3955
  </xsl:template><xsl:template match="*[local-name()='add']">
3783
- <fo:inline xsl:use-attribute-sets="add-style">
3784
- <xsl:apply-templates/>
3785
- </fo:inline>
3956
+ <xsl:choose>
3957
+ <xsl:when test="@amendment">
3958
+ <fo:inline>
3959
+ <xsl:call-template name="insertTag">
3960
+ <xsl:with-param name="kind">A</xsl:with-param>
3961
+ <xsl:with-param name="value"><xsl:value-of select="@amendment"/></xsl:with-param>
3962
+ </xsl:call-template>
3963
+ <xsl:apply-templates/>
3964
+ <xsl:call-template name="insertTag">
3965
+ <xsl:with-param name="type">closing</xsl:with-param>
3966
+ <xsl:with-param name="kind">A</xsl:with-param>
3967
+ <xsl:with-param name="value"><xsl:value-of select="@amendment"/></xsl:with-param>
3968
+ </xsl:call-template>
3969
+ </fo:inline>
3970
+ </xsl:when>
3971
+ <xsl:when test="@corrigenda">
3972
+ <fo:inline>
3973
+ <xsl:call-template name="insertTag">
3974
+ <xsl:with-param name="kind">C</xsl:with-param>
3975
+ <xsl:with-param name="value"><xsl:value-of select="@corrigenda"/></xsl:with-param>
3976
+ </xsl:call-template>
3977
+ <xsl:apply-templates/>
3978
+ <xsl:call-template name="insertTag">
3979
+ <xsl:with-param name="type">closing</xsl:with-param>
3980
+ <xsl:with-param name="kind">C</xsl:with-param>
3981
+ <xsl:with-param name="value"><xsl:value-of select="@corrigenda"/></xsl:with-param>
3982
+ </xsl:call-template>
3983
+ </fo:inline>
3984
+ </xsl:when>
3985
+ <xsl:otherwise>
3986
+ <fo:inline xsl:use-attribute-sets="add-style">
3987
+ <xsl:apply-templates/>
3988
+ </fo:inline>
3989
+ </xsl:otherwise>
3990
+ </xsl:choose>
3991
+
3992
+ </xsl:template><xsl:template name="insertTag">
3993
+ <xsl:param name="type"/>
3994
+ <xsl:param name="kind"/>
3995
+ <xsl:param name="value"/>
3996
+ <xsl:variable name="add_width" select="string-length($value) * 20"/>
3997
+ <xsl:variable name="maxwidth" select="60 + $add_width"/>
3998
+ <fo:instream-foreign-object fox:alt-text="OpeningTag" baseline-shift="-20%"><!-- alignment-baseline="middle" -->
3999
+ <!-- <xsl:attribute name="width">7mm</xsl:attribute>
4000
+ <xsl:attribute name="content-height">100%</xsl:attribute> -->
4001
+ <xsl:attribute name="height">5mm</xsl:attribute>
4002
+ <xsl:attribute name="content-width">100%</xsl:attribute>
4003
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4004
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
4005
+ <svg xmlns="http://www.w3.org/2000/svg" width="{$maxwidth + 32}" height="80">
4006
+ <g>
4007
+ <xsl:if test="$type = 'closing'">
4008
+ <xsl:attribute name="transform">scale(-1 1) translate(-<xsl:value-of select="$maxwidth + 32"/>,0)</xsl:attribute>
4009
+ </xsl:if>
4010
+ <polyline points="0,0 {$maxwidth},0 {$maxwidth + 30},40 {$maxwidth},80 0,80 " stroke="black" stroke-width="5" fill="white"/>
4011
+ <line x1="0" y1="0" x2="0" y2="80" stroke="black" stroke-width="20"/>
4012
+ </g>
4013
+ <text font-family="Arial" x="15" y="57" font-size="40pt">
4014
+ <xsl:if test="$type = 'closing'">
4015
+ <xsl:attribute name="x">25</xsl:attribute>
4016
+ </xsl:if>
4017
+ <xsl:value-of select="$kind"/><tspan dy="10" font-size="30pt"><xsl:value-of select="$value"/></tspan>
4018
+ </text>
4019
+ </svg>
4020
+ </fo:instream-foreign-object>
3786
4021
  </xsl:template><xsl:template match="*[local-name()='del']">
3787
4022
  <fo:inline xsl:use-attribute-sets="del-style">
3788
4023
  <xsl:apply-templates/>
@@ -4081,11 +4316,15 @@
4081
4316
  </xsl:apply-templates>
4082
4317
  </xsl:template><xsl:template name="getLang">
4083
4318
  <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4319
+ <xsl:variable name="language_current_2" select="normalize-space(xalan:nodeset($bibdata)//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4084
4320
  <xsl:variable name="language">
4085
4321
  <xsl:choose>
4086
4322
  <xsl:when test="$language_current != ''">
4087
4323
  <xsl:value-of select="$language_current"/>
4088
4324
  </xsl:when>
4325
+ <xsl:when test="$language_current_2 != ''">
4326
+ <xsl:value-of select="$language_current_2"/>
4327
+ </xsl:when>
4089
4328
  <xsl:otherwise>
4090
4329
  <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
4091
4330
  </xsl:otherwise>
@@ -4125,13 +4364,23 @@
4125
4364
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
4126
4365
  <xsl:value-of select="substring($str, 2)"/>
4127
4366
  </xsl:template><xsl:template match="mathml:math">
4128
- <fo:inline font-family="STIX Two Math"> <!-- -->
4367
+ <xsl:variable name="isAdded" select="@added"/>
4368
+ <xsl:variable name="isDeleted" select="@deleted"/>
4369
+
4370
+ <fo:inline xsl:use-attribute-sets="mathml-style">
4371
+
4372
+
4373
+ <xsl:call-template name="setTrackChangesStyles">
4374
+ <xsl:with-param name="isAdded" select="$isAdded"/>
4375
+ <xsl:with-param name="isDeleted" select="$isDeleted"/>
4376
+ </xsl:call-template>
4129
4377
 
4130
4378
  <xsl:variable name="mathml">
4131
4379
  <xsl:apply-templates select="." mode="mathml"/>
4132
4380
  </xsl:variable>
4133
4381
  <fo:instream-foreign-object fox:alt-text="Math">
4134
4382
 
4383
+
4135
4384
  <!-- <xsl:copy-of select="."/> -->
4136
4385
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
4137
4386
  </fo:instream-foreign-object>
@@ -4149,9 +4398,27 @@
4149
4398
  <xsl:copy>
4150
4399
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
4151
4400
  </xsl:copy>
4152
- <mathml:mspace width="0.5ex"/>
4401
+ <xsl:choose>
4402
+ <!-- if in msub, then don't add space -->
4403
+ <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
4404
+ <!-- if next char in digit, don't add space -->
4405
+ <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
4406
+ <xsl:otherwise>
4407
+ <mathml:mspace width="0.5ex"/>
4408
+ </xsl:otherwise>
4409
+ </xsl:choose>
4153
4410
  </xsl:template><xsl:template match="mathml:math/*[local-name()='unit']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='prefix']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='dimension']" mode="mathml"/><xsl:template match="mathml:math/*[local-name()='quantity']" mode="mathml"/><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
4154
4411
  <xsl:variable name="target">
4412
+ <xsl:choose>
4413
+ <xsl:when test="@updatetype = 'true'">
4414
+ <xsl:value-of select="concat(normalize-space(@target), '.pdf')"/>
4415
+ </xsl:when>
4416
+ <xsl:otherwise>
4417
+ <xsl:value-of select="normalize-space(@target)"/>
4418
+ </xsl:otherwise>
4419
+ </xsl:choose>
4420
+ </xsl:variable>
4421
+ <xsl:variable name="target_text">
4155
4422
  <xsl:choose>
4156
4423
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
4157
4424
  <xsl:value-of select="normalize-space(substring-after(@target, 'mailto:'))"/>
@@ -4163,20 +4430,21 @@
4163
4430
  </xsl:variable>
4164
4431
  <fo:inline xsl:use-attribute-sets="link-style">
4165
4432
 
4433
+
4166
4434
  <xsl:choose>
4167
- <xsl:when test="$target = ''">
4435
+ <xsl:when test="$target_text = ''">
4168
4436
  <xsl:apply-templates/>
4169
4437
  </xsl:when>
4170
4438
  <xsl:otherwise>
4171
- <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
4439
+ <fo:basic-link external-destination="{$target}" fox:alt-text="{$target}">
4172
4440
  <xsl:choose>
4173
4441
  <xsl:when test="normalize-space(.) = ''">
4174
- <!-- <xsl:value-of select="$target"/> -->
4175
4442
  <xsl:call-template name="add-zero-spaces-link-java">
4176
- <xsl:with-param name="text" select="$target"/>
4443
+ <xsl:with-param name="text" select="$target_text"/>
4177
4444
  </xsl:call-template>
4178
4445
  </xsl:when>
4179
4446
  <xsl:otherwise>
4447
+ <!-- output text from <link>text</link> -->
4180
4448
  <xsl:apply-templates/>
4181
4449
  </xsl:otherwise>
4182
4450
  </xsl:choose>
@@ -4292,6 +4560,7 @@
4292
4560
 
4293
4561
 
4294
4562
  <fo:inline xsl:use-attribute-sets="note-name-style">
4563
+
4295
4564
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4296
4565
  </fo:inline>
4297
4566
  <xsl:apply-templates/>
@@ -4317,7 +4586,9 @@
4317
4586
  </xsl:choose>
4318
4587
  </xsl:template><xsl:template match="*[local-name() = 'termnote']">
4319
4588
  <fo:block id="{@id}" xsl:use-attribute-sets="termnote-style">
4589
+
4320
4590
  <fo:inline xsl:use-attribute-sets="termnote-name-style">
4591
+
4321
4592
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4322
4593
  </fo:inline>
4323
4594
  <xsl:apply-templates/>
@@ -4383,16 +4654,27 @@
4383
4654
  </fo:inline>
4384
4655
  </xsl:if>
4385
4656
  </xsl:template><xsl:template match="*[local-name() = 'figure']" name="figure">
4657
+ <xsl:variable name="isAdded" select="@added"/>
4658
+ <xsl:variable name="isDeleted" select="@deleted"/>
4386
4659
  <fo:block-container id="{@id}">
4387
4660
 
4661
+ <xsl:call-template name="setTrackChangesStyles">
4662
+ <xsl:with-param name="isAdded" select="$isAdded"/>
4663
+ <xsl:with-param name="isDeleted" select="$isDeleted"/>
4664
+ </xsl:call-template>
4665
+
4388
4666
  <fo:block>
4667
+
4389
4668
  <xsl:apply-templates/>
4390
4669
  </fo:block>
4391
4670
  <xsl:call-template name="fn_display_figure"/>
4392
4671
  <xsl:for-each select="*[local-name() = 'note']">
4393
4672
  <xsl:call-template name="note"/>
4394
4673
  </xsl:for-each>
4395
- <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4674
+
4675
+
4676
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4677
+
4396
4678
  </fo:block-container>
4397
4679
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']">
4398
4680
  <fo:block id="{@id}">
@@ -4404,6 +4686,8 @@
4404
4686
  <xsl:apply-templates/>
4405
4687
  </fo:block>
4406
4688
  </xsl:template><xsl:template match="*[local-name() = 'image']">
4689
+ <xsl:variable name="isAdded" select="../@added"/>
4690
+ <xsl:variable name="isDeleted" select="../@deleted"/>
4407
4691
  <xsl:choose>
4408
4692
  <xsl:when test="ancestor::*[local-name() = 'title']">
4409
4693
  <fo:inline padding-left="1mm" padding-right="1mm">
@@ -4419,7 +4703,26 @@
4419
4703
  <xsl:variable name="src">
4420
4704
  <xsl:call-template name="image_src"/>
4421
4705
  </xsl:variable>
4422
- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
4706
+
4707
+ <xsl:choose>
4708
+ <xsl:when test="$isDeleted = 'true'">
4709
+ <!-- enclose in svg -->
4710
+ <fo:instream-foreign-object fox:alt-text="Image {@alt}">
4711
+ <xsl:attribute name="width">100%</xsl:attribute>
4712
+ <xsl:attribute name="content-height">100%</xsl:attribute>
4713
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
4714
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
4715
+
4716
+
4717
+ <xsl:apply-templates select="." mode="cross_image"/>
4718
+
4719
+ </fo:instream-foreign-object>
4720
+ </xsl:when>
4721
+ <xsl:otherwise>
4722
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
4723
+ </xsl:otherwise>
4724
+ </xsl:choose>
4725
+
4423
4726
  </fo:block>
4424
4727
  </xsl:otherwise>
4425
4728
  </xsl:choose>
@@ -4435,21 +4738,70 @@
4435
4738
  <xsl:value-of select="@src"/>
4436
4739
  </xsl:otherwise>
4437
4740
  </xsl:choose>
4741
+ </xsl:template><xsl:template match="*[local-name() = 'image']" mode="cross_image">
4742
+ <xsl:choose>
4743
+ <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
4744
+ <xsl:variable name="src">
4745
+ <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
4746
+ </xsl:variable>
4747
+ <xsl:variable name="width" select="document($src)/@width"/>
4748
+ <xsl:variable name="height" select="document($src)/@height"/>
4749
+ <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">
4750
+ <image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{$src}" style="overflow:visible;"/>
4751
+ </svg>
4752
+ </xsl:when>
4753
+ <xsl:when test="not(starts-with(@src, 'data:'))">
4754
+ <xsl:variable name="src">
4755
+ <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
4756
+ </xsl:variable>
4757
+ <xsl:variable name="file" select="java:java.io.File.new(@src)"/>
4758
+ <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($file)"/>
4759
+ <xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
4760
+ <xsl:variable name="height" select="java:getHeight($bufferedImage)"/>
4761
+ <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">
4762
+ <image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{$src}" style="overflow:visible;"/>
4763
+ </svg>
4764
+ </xsl:when>
4765
+ <xsl:otherwise>
4766
+ <xsl:variable name="base64String" select="substring-after(@src, 'base64,')"/>
4767
+ <xsl:variable name="decoder" select="java:java.util.Base64.getDecoder()"/>
4768
+ <xsl:variable name="fileContent" select="java:decode($decoder, $base64String)"/>
4769
+ <xsl:variable name="bis" select="java:java.io.ByteArrayInputStream.new($fileContent)"/>
4770
+ <xsl:variable name="bufferedImage" select="java:javax.imageio.ImageIO.read($bis)"/>
4771
+ <xsl:variable name="width" select="java:getWidth($bufferedImage)"/>
4772
+ <!-- width=<xsl:value-of select="$width"/> -->
4773
+ <xsl:variable name="height" select="java:getHeight($bufferedImage)"/>
4774
+ <!-- height=<xsl:value-of select="$height"/> -->
4775
+ <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">
4776
+ <image xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="{@src}" height="{$height}" width="{$width}" style="overflow:visible;"/>
4777
+ <xsl:call-template name="svg_cross">
4778
+ <xsl:with-param name="width" select="$width"/>
4779
+ <xsl:with-param name="height" select="$height"/>
4780
+ </xsl:call-template>
4781
+ </svg>
4782
+ </xsl:otherwise>
4783
+ </xsl:choose>
4784
+
4785
+ </xsl:template><xsl:template name="svg_cross">
4786
+ <xsl:param name="width"/>
4787
+ <xsl:param name="height"/>
4788
+ <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; "/>
4789
+ <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; "/>
4438
4790
  </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">
4439
4791
  <xsl:apply-templates mode="contents"/>
4440
4792
  <xsl:text> </xsl:text>
4441
4793
  </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">
4442
4794
  <xsl:apply-templates mode="bookmarks"/>
4443
4795
  <xsl:text> </xsl:text>
4444
- </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
4796
+ </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">
4445
4797
  <xsl:value-of select="."/>
4446
- </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
4798
+ </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">
4447
4799
  <xsl:value-of select="."/>
4448
4800
  </xsl:template><xsl:template match="node()" mode="contents">
4449
4801
  <xsl:apply-templates mode="contents"/>
4450
4802
  </xsl:template><xsl:template match="node()" mode="bookmarks">
4451
4803
  <xsl:apply-templates mode="bookmarks"/>
4452
- </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
4804
+ </xsl:template><xsl:template match="*[local-name() = 'title' or local-name() = 'name']//*[local-name() = 'stem']" mode="contents">
4453
4805
  <xsl:apply-templates select="."/>
4454
4806
  </xsl:template><xsl:template match="*[local-name() = 'references'][@hidden='true']" mode="contents" priority="3"/><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4455
4807
  <xsl:apply-templates mode="bookmarks"/>
@@ -4597,6 +4949,7 @@
4597
4949
  <xsl:if test="normalize-space() != ''">
4598
4950
  <fo:block xsl:use-attribute-sets="figure-name-style">
4599
4951
 
4952
+
4600
4953
  <xsl:apply-templates/>
4601
4954
  </fo:block>
4602
4955
  </xsl:if>
@@ -4648,6 +5001,8 @@
4648
5001
  </fo:list-item-body>
4649
5002
  </fo:list-item>
4650
5003
  </fo:list-block>
5004
+ </xsl:template><xsl:template name="extractSection">
5005
+ <xsl:value-of select="*[local-name() = 'tab'][1]/preceding-sibling::node()"/>
4651
5006
  </xsl:template><xsl:template name="extractTitle">
4652
5007
  <xsl:choose>
4653
5008
  <xsl:when test="*[local-name() = 'tab']">
@@ -4674,6 +5029,8 @@
4674
5029
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
4675
5030
 
4676
5031
  <fo:block-container margin-left="0mm">
5032
+ <xsl:copy-of select="@id"/>
5033
+
4677
5034
  <xsl:if test="parent::*[local-name() = 'note']">
4678
5035
  <xsl:attribute name="margin-left">
4679
5036
  <xsl:choose>
@@ -4684,7 +5041,9 @@
4684
5041
 
4685
5042
  </xsl:if>
4686
5043
  <fo:block-container margin-left="0mm">
4687
-
5044
+
5045
+
5046
+
4688
5047
  <fo:block xsl:use-attribute-sets="sourcecode-style">
4689
5048
  <xsl:variable name="_font-size">
4690
5049
 
@@ -4694,6 +5053,7 @@
4694
5053
 
4695
5054
 
4696
5055
 
5056
+
4697
5057
  10
4698
5058
 
4699
5059
 
@@ -4712,10 +5072,14 @@
4712
5072
  </xsl:choose>
4713
5073
  </xsl:attribute>
4714
5074
  </xsl:if>
4715
- <xsl:apply-templates/>
4716
- </fo:block>
5075
+
5076
+ <xsl:apply-templates/>
5077
+ </fo:block>
5078
+
5079
+
4717
5080
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4718
5081
 
5082
+
4719
5083
  </fo:block-container>
4720
5084
  </fo:block-container>
4721
5085
  </xsl:template><xsl:template match="*[local-name()='sourcecode']/text()" priority="2">
@@ -4950,6 +5314,7 @@
4950
5314
  </xsl:template><xsl:template match="*[local-name() = 'example']">
4951
5315
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
4952
5316
 
5317
+
4953
5318
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
4954
5319
 
4955
5320
  <xsl:variable name="element">
@@ -4977,6 +5342,7 @@
4977
5342
  <xsl:variable name="element">
4978
5343
  block
4979
5344
 
5345
+ <xsl:if test="following-sibling::*[1][local-name() = 'table']">block</xsl:if>
4980
5346
  </xsl:variable>
4981
5347
  <xsl:choose>
4982
5348
  <xsl:when test="ancestor::*[local-name() = 'appendix']">
@@ -4984,7 +5350,7 @@
4984
5350
  <xsl:apply-templates/>
4985
5351
  </fo:inline>
4986
5352
  </xsl:when>
4987
- <xsl:when test="normalize-space($element) = 'block'">
5353
+ <xsl:when test="contains(normalize-space($element), 'block')">
4988
5354
  <fo:block xsl:use-attribute-sets="example-name-style">
4989
5355
  <xsl:apply-templates/>
4990
5356
  </fo:block>
@@ -5016,7 +5382,7 @@
5016
5382
  </fo:inline>
5017
5383
  </xsl:otherwise>
5018
5384
  </xsl:choose>
5019
- </xsl:template><xsl:template match="*[local-name() = 'termsource']">
5385
+ </xsl:template><xsl:template match="*[local-name() = 'termsource']" name="termsource">
5020
5386
  <fo:block xsl:use-attribute-sets="termsource-style">
5021
5387
  <!-- Example: [SOURCE: ISO 5127:2017, 3.1.6.02] -->
5022
5388
  <xsl:variable name="termsource_text">
@@ -5025,13 +5391,15 @@
5025
5391
 
5026
5392
  <xsl:choose>
5027
5393
  <xsl:when test="starts-with(normalize-space($termsource_text), '[')">
5028
- <xsl:apply-templates/>
5394
+ <!-- <xsl:apply-templates /> -->
5395
+ <xsl:copy-of select="$termsource_text"/>
5029
5396
  </xsl:when>
5030
5397
  <xsl:otherwise>
5031
5398
 
5032
5399
  <xsl:text>[</xsl:text>
5033
5400
 
5034
- <xsl:apply-templates/>
5401
+ <!-- <xsl:apply-templates /> -->
5402
+ <xsl:copy-of select="$termsource_text"/>
5035
5403
 
5036
5404
  <xsl:text>]</xsl:text>
5037
5405
 
@@ -5042,8 +5410,15 @@
5042
5410
  <xsl:if test="normalize-space() != ''">
5043
5411
  <xsl:value-of select="."/>
5044
5412
  </xsl:if>
5045
- </xsl:template><xsl:template match="*[local-name() = 'origin']">
5413
+ </xsl:template><xsl:variable name="localized.source">
5414
+ <xsl:call-template name="getLocalizedString">
5415
+ <xsl:with-param name="key">source</xsl:with-param>
5416
+ </xsl:call-template>
5417
+ </xsl:variable><xsl:template match="*[local-name() = 'origin']">
5046
5418
  <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
5419
+ <xsl:if test="normalize-space(@citeas) = ''">
5420
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="@bibitemid"/></xsl:attribute>
5421
+ </xsl:if>
5047
5422
 
5048
5423
  <fo:inline xsl:use-attribute-sets="origin-style">
5049
5424
  <xsl:apply-templates/>
@@ -5149,6 +5524,7 @@
5149
5524
 
5150
5525
 
5151
5526
 
5527
+
5152
5528
  <xsl:choose>
5153
5529
  <xsl:when test="$depth = 5">7</xsl:when>
5154
5530
  <xsl:when test="$depth = 4">10</xsl:when>
@@ -5193,7 +5569,8 @@
5193
5569
  </fo:inline>
5194
5570
  </xsl:when>
5195
5571
  <xsl:otherwise>
5196
- <fo:inline padding-right="{$padding-right}mm">​</fo:inline>
5572
+ <xsl:variable name="direction"><xsl:if test="$lang = 'ar'"><xsl:value-of select="$RLM"/></xsl:if></xsl:variable>
5573
+ <fo:inline padding-right="{$padding-right}mm"><xsl:value-of select="$direction"/>​</fo:inline>
5197
5574
  </xsl:otherwise>
5198
5575
  </xsl:choose>
5199
5576
 
@@ -5254,7 +5631,6 @@
5254
5631
 
5255
5632
 
5256
5633
 
5257
-
5258
5634
  <xsl:apply-templates/>
5259
5635
  </fo:block>
5260
5636
 
@@ -5271,6 +5647,7 @@
5271
5647
  <xsl:call-template name="setId"/>
5272
5648
 
5273
5649
 
5650
+
5274
5651
  <xsl:if test="@inline-header='true'">
5275
5652
  <xsl:attribute name="text-align">justify</xsl:attribute>
5276
5653
  </xsl:if>
@@ -5301,7 +5678,7 @@
5301
5678
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
5302
5679
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
5303
5680
  <xsl:choose>
5304
- <xsl:when test="parent::*[local-name() = 'note']">
5681
+ <xsl:when test="parent::*[local-name() = 'note'] or parent::*[local-name() = 'termnote']">
5305
5682
  <fo:block-container>
5306
5683
  <xsl:attribute name="margin-left">
5307
5684
  <xsl:choose>
@@ -5311,6 +5688,7 @@
5311
5688
  </xsl:attribute>
5312
5689
 
5313
5690
 
5691
+
5314
5692
  <fo:block-container margin-left="0mm">
5315
5693
  <fo:block>
5316
5694
  <xsl:apply-templates select="." mode="ul_ol"/>
@@ -5512,21 +5890,25 @@
5512
5890
 
5513
5891
 
5514
5892
 
5893
+
5894
+
5895
+
5896
+
5515
5897
  </xsl:template><xsl:template name="processBibitemDocId">
5516
5898
  <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')]"/>
5517
5899
  <xsl:choose>
5518
5900
  <xsl:when test="normalize-space($_doc_ident) != ''">
5519
- <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"/>
5901
+ <!-- <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"/>
5520
5902
  <xsl:if test="$type != '' and not(contains($_doc_ident, $type))">
5521
5903
  <xsl:value-of select="$type"/><xsl:text> </xsl:text>
5522
- </xsl:if>
5904
+ </xsl:if> -->
5523
5905
  <xsl:value-of select="$_doc_ident"/>
5524
5906
  </xsl:when>
5525
5907
  <xsl:otherwise>
5526
- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
5908
+ <!-- <xsl:variable name="type" select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]/@type"/>
5527
5909
  <xsl:if test="$type != ''">
5528
5910
  <xsl:value-of select="$type"/><xsl:text> </xsl:text>
5529
- </xsl:if>
5911
+ </xsl:if> -->
5530
5912
  <xsl:value-of select="*[local-name() = 'docidentifier'][not(@type = 'metanorma')]"/>
5531
5913
  </xsl:otherwise>
5532
5914
  </xsl:choose>
@@ -5568,6 +5950,70 @@
5568
5950
  <xsl:value-of select="substring(.,1,1)"/>
5569
5951
  </xsl:template><xsl:template match="*[local-name() = 'title']" mode="title">
5570
5952
  <fo:inline><xsl:apply-templates/></fo:inline>
5953
+ </xsl:template><xsl:template match="*[local-name() = 'form']">
5954
+ <fo:block>
5955
+ <xsl:apply-templates/>
5956
+ </fo:block>
5957
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'label']">
5958
+ <fo:inline><xsl:apply-templates/></fo:inline>
5959
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'text' or @type = 'date' or @type = 'file' or @type = 'password']">
5960
+ <fo:inline>
5961
+ <xsl:call-template name="text_input"/>
5962
+ </fo:inline>
5963
+ </xsl:template><xsl:template name="text_input">
5964
+ <xsl:variable name="count">
5965
+ <xsl:choose>
5966
+ <xsl:when test="normalize-space(@maxlength) != ''"><xsl:value-of select="@maxlength"/></xsl:when>
5967
+ <xsl:when test="normalize-space(@size) != ''"><xsl:value-of select="@size"/></xsl:when>
5968
+ <xsl:otherwise>10</xsl:otherwise>
5969
+ </xsl:choose>
5970
+ </xsl:variable>
5971
+ <xsl:call-template name="repeat">
5972
+ <xsl:with-param name="char" select="'_'"/>
5973
+ <xsl:with-param name="count" select="$count"/>
5974
+ </xsl:call-template>
5975
+ <xsl:text> </xsl:text>
5976
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'button']">
5977
+ <xsl:variable name="caption">
5978
+ <xsl:choose>
5979
+ <xsl:when test="normalize-space(@value) != ''"><xsl:value-of select="@value"/></xsl:when>
5980
+ <xsl:otherwise>BUTTON</xsl:otherwise>
5981
+ </xsl:choose>
5982
+ </xsl:variable>
5983
+ <fo:inline>[<xsl:value-of select="$caption"/>]</fo:inline>
5984
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'checkbox']">
5985
+ <fo:inline padding-right="1mm">
5986
+ <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
5987
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
5988
+ <xsl:attribute name="content-width">100%</xsl:attribute>
5989
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
5990
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
5991
+ <svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
5992
+ <polyline points="0,0 80,0 80,80 0,80 0,0" stroke="black" stroke-width="5" fill="white"/>
5993
+ </svg>
5994
+ </fo:instream-foreign-object>
5995
+ </fo:inline>
5996
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'input'][@type = 'radio']">
5997
+ <fo:inline padding-right="1mm">
5998
+ <fo:instream-foreign-object fox:alt-text="Box" baseline-shift="-10%">
5999
+ <xsl:attribute name="height">3.5mm</xsl:attribute>
6000
+ <xsl:attribute name="content-width">100%</xsl:attribute>
6001
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
6002
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
6003
+ <svg xmlns="http://www.w3.org/2000/svg" width="80" height="80">
6004
+ <circle cx="40" cy="40" r="30" stroke="black" stroke-width="5" fill="white"/>
6005
+ <circle cx="40" cy="40" r="15" stroke="black" stroke-width="5" fill="white"/>
6006
+ </svg>
6007
+ </fo:instream-foreign-object>
6008
+ </fo:inline>
6009
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'select']">
6010
+ <fo:inline>
6011
+ <xsl:call-template name="text_input"/>
6012
+ </fo:inline>
6013
+ </xsl:template><xsl:template match="*[local-name() = 'form']//*[local-name() = 'textarea']">
6014
+ <fo:block-container border="1pt solid black" width="50%">
6015
+ <fo:block> </fo:block>
6016
+ </fo:block-container>
5571
6017
  </xsl:template><xsl:template name="convertDate">
5572
6018
  <xsl:param name="date"/>
5573
6019
  <xsl:param name="format" select="'short'"/>
@@ -5775,6 +6221,9 @@
5775
6221
  <xsl:when test="parent::*[local-name() = 'preface']">
5776
6222
  <xsl:value-of select="$level_total - 1"/>
5777
6223
  </xsl:when>
6224
+ <xsl:when test="ancestor::*[local-name() = 'preface'] and not(ancestor::*[local-name() = 'foreword']) and not(ancestor::*[local-name() = 'introduction'])"> <!-- for preface/clause -->
6225
+ <xsl:value-of select="$level_total - 1"/>
6226
+ </xsl:when>
5778
6227
  <xsl:when test="ancestor::*[local-name() = 'preface']">
5779
6228
  <xsl:value-of select="$level_total - 2"/>
5780
6229
  </xsl:when>
@@ -5832,6 +6281,7 @@
5832
6281
 
5833
6282
 
5834
6283
 
6284
+
5835
6285
  <xsl:value-of select="document('')//*/namespace::itu"/>
5836
6286
 
5837
6287
 
@@ -5899,17 +6349,79 @@
5899
6349
  </xsl:call-template>
5900
6350
  </xsl:if>
5901
6351
  </xsl:template><xsl:template name="getLocalizedString">
5902
- <xsl:param name="key"/>
6352
+ <xsl:param name="key"/>
5903
6353
 
5904
6354
  <xsl:variable name="curr_lang">
5905
6355
  <xsl:call-template name="getLang"/>
5906
6356
  </xsl:variable>
5907
6357
 
6358
+ <xsl:variable name="data_value" select="normalize-space(xalan:nodeset($bibdata)//*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang])"/>
6359
+
5908
6360
  <xsl:choose>
6361
+ <xsl:when test="$data_value != ''">
6362
+ <xsl:value-of select="$data_value"/>
6363
+ </xsl:when>
5909
6364
  <xsl:when test="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]">
5910
6365
  <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5911
6366
  </xsl:when>
5912
- <xsl:otherwise><xsl:value-of select="$key"/></xsl:otherwise>
6367
+ <xsl:otherwise>
6368
+ <xsl:variable name="key_">
6369
+ <xsl:call-template name="capitalize">
6370
+ <xsl:with-param name="str" select="translate($key, '_', ' ')"/>
6371
+ </xsl:call-template>
6372
+ </xsl:variable>
6373
+ <xsl:value-of select="$key_"/>
6374
+ </xsl:otherwise>
5913
6375
  </xsl:choose>
5914
6376
 
6377
+ </xsl:template><xsl:template name="setTrackChangesStyles">
6378
+ <xsl:param name="isAdded"/>
6379
+ <xsl:param name="isDeleted"/>
6380
+ <xsl:choose>
6381
+ <xsl:when test="local-name() = 'math'">
6382
+ <xsl:if test="$isAdded = 'true'">
6383
+ <xsl:attribute name="background-color"><xsl:value-of select="$color-added-text"/></xsl:attribute>
6384
+ </xsl:if>
6385
+ <xsl:if test="$isDeleted = 'true'">
6386
+ <xsl:attribute name="background-color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute>
6387
+ </xsl:if>
6388
+ </xsl:when>
6389
+ <xsl:otherwise>
6390
+ <xsl:if test="$isAdded = 'true'">
6391
+ <xsl:attribute name="border"><xsl:value-of select="$border-block-added"/></xsl:attribute>
6392
+ <xsl:attribute name="padding">2mm</xsl:attribute>
6393
+ </xsl:if>
6394
+ <xsl:if test="$isDeleted = 'true'">
6395
+ <xsl:attribute name="border"><xsl:value-of select="$border-block-deleted"/></xsl:attribute>
6396
+ <xsl:if test="local-name() = 'table'">
6397
+ <xsl:attribute name="background-color">rgb(255, 185, 185)</xsl:attribute>
6398
+ </xsl:if>
6399
+ <!-- <xsl:attribute name="color"><xsl:value-of select="$color-deleted-text"/></xsl:attribute> -->
6400
+ <xsl:attribute name="padding">2mm</xsl:attribute>
6401
+ </xsl:if>
6402
+ </xsl:otherwise>
6403
+ </xsl:choose>
6404
+ </xsl:template><xsl:variable name="LRM" select="'‎'"/><xsl:variable name="RLM" select="'‏'"/><xsl:template name="setWritingMode">
6405
+ <xsl:if test="$lang = 'ar'">
6406
+ <xsl:attribute name="writing-mode">rl-tb</xsl:attribute>
6407
+ </xsl:if>
6408
+ </xsl:template><xsl:template name="setAlignment">
6409
+ <xsl:param name="align" select="normalize-space(@align)"/>
6410
+ <xsl:choose>
6411
+ <xsl:when test="$lang = 'ar' and $align = 'left'">start</xsl:when>
6412
+ <xsl:when test="$lang = 'ar' and $align = 'right'">end</xsl:when>
6413
+ <xsl:when test="$align != ''">
6414
+ <xsl:value-of select="$align"/>
6415
+ </xsl:when>
6416
+ </xsl:choose>
6417
+ </xsl:template><xsl:template name="setTextAlignment">
6418
+ <xsl:param name="default">left</xsl:param>
6419
+ <xsl:attribute name="text-align">
6420
+ <xsl:choose>
6421
+ <xsl:when test="@align"><xsl:value-of select="@align"/></xsl:when>
6422
+ <xsl:when test="ancestor::*[local-name() = 'td']/@align"><xsl:value-of select="ancestor::*[local-name() = 'td']/@align"/></xsl:when>
6423
+ <xsl:when test="ancestor::*[local-name() = 'th']/@align"><xsl:value-of select="ancestor::*[local-name() = 'th']/@align"/></xsl:when>
6424
+ <xsl:otherwise><xsl:value-of select="$default"/></xsl:otherwise>
6425
+ </xsl:choose>
6426
+ </xsl:attribute>
5915
6427
  </xsl:template></xsl:stylesheet>