metanorma-iso 1.5.7 → 1.5.12

Sign up to get free protection for your applications and to get access to all the features.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/macos.yml +9 -1
  3. data/.github/workflows/rake.yml +66 -0
  4. data/.github/workflows/ubuntu.yml +8 -0
  5. data/.github/workflows/windows.yml +7 -0
  6. data/README.adoc +5 -6
  7. data/lib/asciidoctor/iso/basicdoc.rng +4 -11
  8. data/lib/asciidoctor/iso/boilerplate-fr.xml +40 -0
  9. data/lib/asciidoctor/iso/boilerplate.xml +1 -0
  10. data/lib/asciidoctor/iso/cleanup.rb +38 -0
  11. data/lib/asciidoctor/iso/front.rb +9 -15
  12. data/lib/asciidoctor/iso/isodoc.rng +27 -50
  13. data/lib/asciidoctor/iso/isostandard.rng +8 -1
  14. data/lib/asciidoctor/iso/validate.rb +1 -1
  15. data/lib/asciidoctor/iso/validate_section.rb +9 -0
  16. data/lib/isodoc/iso/html/header.html +12 -24
  17. data/lib/isodoc/iso/html/style-human.css +5 -1
  18. data/lib/isodoc/iso/html/style-iso.css +5 -1
  19. data/lib/isodoc/iso/i18n-en.yaml +4 -0
  20. data/lib/isodoc/iso/i18n-fr.yaml +5 -0
  21. data/lib/isodoc/iso/i18n-zh-Hans.yaml +5 -0
  22. data/lib/isodoc/iso/i18n.rb +10 -11
  23. data/lib/isodoc/iso/iso.amendment.xsl +732 -138
  24. data/lib/isodoc/iso/iso.international-standard.xsl +732 -138
  25. data/lib/isodoc/iso/metadata.rb +19 -19
  26. data/lib/metanorma-iso.rb +1 -0
  27. data/lib/metanorma/iso/processor.rb +1 -1
  28. data/lib/metanorma/iso/version.rb +1 -1
  29. data/metanorma-iso.gemspec +1 -1
  30. data/spec/asciidoctor-iso/amd_spec.rb +7 -7
  31. data/spec/asciidoctor-iso/base_spec.rb +144 -18
  32. data/spec/asciidoctor-iso/cleanup_spec.rb +4 -4
  33. data/spec/asciidoctor-iso/refs_spec.rb +174 -143
  34. data/spec/asciidoctor-iso/validate_spec.rb +52 -15
  35. data/spec/assets/xref_error.adoc +7 -0
  36. data/spec/isodoc/amd_spec.rb +191 -17
  37. data/spec/isodoc/blocks_spec.rb +2 -1
  38. data/spec/isodoc/i18n_spec.rb +13 -13
  39. data/spec/isodoc/inline_spec.rb +2 -2
  40. data/spec/isodoc/iso_spec.rb +2 -2
  41. data/spec/isodoc/metadata_spec.rb +170 -19
  42. data/spec/isodoc/postproc_spec.rb +3 -3
  43. data/spec/isodoc/ref_spec.rb +5 -5
  44. data/spec/isodoc/section_spec.rb +2 -2
  45. data/spec/isodoc/table_spec.rb +1 -1
  46. data/spec/isodoc/terms_spec.rb +1 -1
  47. data/spec/isodoc/xref_spec.rb +11 -11
  48. data/spec/metanorma/processor_spec.rb +1 -1
  49. data/spec/spec_helper.rb +22 -2
  50. metadata +7 -4
@@ -17,7 +17,12 @@
17
17
 
18
18
  <xsl:variable name="docidentifierISO" select="/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso'] | /iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'ISO']"/>
19
19
 
20
- <xsl:variable name="copyrightText" select="concat('© ISO ', iso:iso-standard/iso:bibdata/iso:copyright/iso:from ,' – All rights reserved')"/>
20
+ <xsl:variable name="all_rights_reserved">
21
+ <xsl:call-template name="getLocalizedString">
22
+ <xsl:with-param name="key">all_rights_reserved</xsl:with-param>
23
+ </xsl:call-template>
24
+ </xsl:variable>
25
+ <xsl:variable name="copyrightText" select="concat('© ISO ', /iso:iso-standard/iso:bibdata/iso:copyright/iso:from ,' – ', $all_rights_reserved)"/>
21
26
 
22
27
  <xsl:variable name="lang-1st-letter_tmp" select="substring-before(substring-after(/iso:iso-standard/iso:bibdata/iso:docidentifier[@type = 'iso-with-lang'], '('), ')')"/>
23
28
  <xsl:variable name="lang-1st-letter" select="concat('(', $lang-1st-letter_tmp , ')')"/>
@@ -162,6 +167,9 @@
162
167
  <xsl:template match="/">
163
168
  <xsl:call-template name="namespaceCheck"/>
164
169
  <fo:root font-family="Cambria, Times New Roman, Cambria Math, HanSans" font-size="11pt" xml:lang="{$lang}"> <!-- -->
170
+ <xsl:if test="$lang = 'zh'">
171
+ <xsl:attribute name="font-family">HanSans, Times New Roman, Cambria Math</xsl:attribute>
172
+ </xsl:if>
165
173
  <fo:layout-master-set>
166
174
 
167
175
  <!-- cover page -->
@@ -295,6 +303,10 @@
295
303
 
296
304
  <xsl:call-template name="addPDFUAmeta"/>
297
305
 
306
+ <xsl:call-template name="addBookmarks">
307
+ <xsl:with-param name="contents" select="$contents"/>
308
+ </xsl:call-template>
309
+
298
310
  <!-- cover page -->
299
311
  <xsl:choose>
300
312
  <xsl:when test="$stage-abbreviation != ''">
@@ -372,8 +384,13 @@
372
384
  </fo:block>
373
385
  </fo:table-cell>
374
386
  <fo:table-cell display-align="center">
375
- <fo:block text-align="right">
376
- <fo:block>Reference number</fo:block>
387
+ <fo:block text-align="right">
388
+ <!-- Reference number -->
389
+ <fo:block>
390
+ <xsl:call-template name="getLocalizedString">
391
+ <xsl:with-param name="key">reference_number</xsl:with-param>
392
+ </xsl:call-template>
393
+ </fo:block>
377
394
  <fo:block>
378
395
  <xsl:value-of select="$ISOname"/>
379
396
  </fo:block>
@@ -398,7 +415,15 @@
398
415
  <fo:flow flow-name="xsl-region-body">
399
416
  <fo:block-container>
400
417
  <fo:block margin-top="-1mm" font-size="20pt" text-align="right">
401
- <xsl:value-of select="$stage-fullname-uppercased"/>
418
+ <xsl:value-of select="$stage-fullname-uppercased"/>
419
+ <!-- <xsl:if test="$doctype = 'amendment'">
420
+ <xsl:variable name="title-amendment">
421
+ <xsl:call-template name="getTitle">
422
+ <xsl:with-param name="name" select="'title-amendment'"/>
423
+ </xsl:call-template>
424
+ </xsl:variable>
425
+ <xsl:text> </xsl:text><xsl:value-of select="$title-amendment"/>
426
+ </xsl:if> -->
402
427
  </fo:block>
403
428
  <fo:block font-size="20pt" font-weight="bold" text-align="right">
404
429
  <xsl:value-of select="$docidentifierISO"/>
@@ -473,16 +498,13 @@
473
498
 
474
499
  <xsl:call-template name="printTitlePartEn"/>
475
500
 
476
- <!-- <xsl:if test="normalize-space($title-part) != ''">
477
- <xsl:if test="$part != ''">
478
- <xsl:text> — </xsl:text>
479
- <fo:block font-weight="normal" margin-top="6pt">
480
- <xsl:text>Part </xsl:text><xsl:value-of select="$part"/>
481
- <xsl:text>:</xsl:text>
482
- </fo:block>
483
- </xsl:if>
484
- <xsl:value-of select="$title-part"/>
485
- </xsl:if> -->
501
+ <xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'en' and @type = 'title-amd']"/>
502
+ <xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
503
+ <fo:block margin-top="12pt">
504
+ <xsl:call-template name="printAmendmentTitle"/>
505
+ </fo:block>
506
+ </xsl:if>
507
+
486
508
  </fo:block>
487
509
 
488
510
  <fo:block font-size="9pt"><xsl:value-of select="$linebreak"/></fo:block>
@@ -497,6 +519,15 @@
497
519
 
498
520
  <xsl:call-template name="printTitlePartFr"/>
499
521
 
522
+ <xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'fr' and @type = 'title-amd']"/>
523
+ <xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
524
+ <fo:block margin-top="6pt">
525
+ <xsl:call-template name="printAmendmentTitle">
526
+ <xsl:with-param name="lang" select="'fr'"/>
527
+ </xsl:call-template>
528
+ </fo:block>
529
+ </xsl:if>
530
+
500
531
  </fo:block>
501
532
  </fo:block>
502
533
  <fo:block margin-top="10mm">
@@ -541,7 +572,14 @@
541
572
  </fo:table-cell>
542
573
  <fo:table-cell>
543
574
  <fo:block text-align="left">
544
- <xsl:value-of select="$doctype_uppercased"/>
575
+ <xsl:choose>
576
+ <xsl:when test="$doctype = 'amendment'">
577
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(translate(/iso:iso-standard/iso:bibdata/iso:ext/iso:updates-document-type,'-',' ')))"/>
578
+ </xsl:when>
579
+ <xsl:otherwise>
580
+ <xsl:value-of select="$doctype_uppercased"/>
581
+ </xsl:otherwise>
582
+ </xsl:choose>
545
583
  </fo:block>
546
584
  </fo:table-cell>
547
585
  <fo:table-cell>
@@ -553,24 +591,50 @@
553
591
  <fo:table-row height="42mm">
554
592
  <fo:table-cell number-columns-spanned="3" font-size="10pt" line-height="1.2">
555
593
  <fo:block text-align="right">
556
- <xsl:if test="$stage-abbreviation = 'PRF' or $stage-abbreviation = 'IS' or $stage-abbreviation = 'published'">
594
+ <xsl:if test="$stage-abbreviation = 'PRF' or $stage-abbreviation = 'IS' or $stage-abbreviation = 'D' or $stage-abbreviation = 'published'">
557
595
  <xsl:call-template name="printEdition"/>
558
596
  </xsl:if>
559
597
  <xsl:choose>
560
598
  <xsl:when test="$stage-abbreviation = 'IS' and /iso:iso-standard/iso:bibdata/iso:date[@type = 'published']">
561
599
  <xsl:value-of select="$linebreak"/>
562
600
  <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:date[@type = 'published']"/>
563
- </xsl:when>
601
+ </xsl:when>
602
+ <xsl:when test="($stage-abbreviation = 'IS' or $stage-abbreviation = 'D') and /iso:iso-standard/iso:bibdata/iso:date[@type = 'created']">
603
+ <xsl:value-of select="$linebreak"/>
604
+ <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:date[@type = 'created']"/>
605
+ </xsl:when>
564
606
  <xsl:when test="$stage-abbreviation = 'IS' or $stage-abbreviation = 'published'">
565
607
  <xsl:value-of select="$linebreak"/>
566
608
  <xsl:value-of select="substring(/iso:iso-standard/iso:bibdata/iso:version/iso:revision-date,1, 7)"/>
567
609
  </xsl:when>
568
610
  </xsl:choose>
569
- <!-- <xsl:value-of select="$linebreak"/>
570
- <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:version/iso:revision-date"/> -->
611
+ </fo:block>
612
+ <!-- <xsl:value-of select="$linebreak"/>
613
+ <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:version/iso:revision-date"/> -->
614
+ <xsl:if test="$doctype = 'amendment'">
615
+ <fo:block text-align="right" margin-right="0.5mm">
616
+ <fo:block font-weight="bold" margin-top="4pt">
617
+ <xsl:variable name="title-amendment">
618
+ <xsl:call-template name="getTitle">
619
+ <xsl:with-param name="name" select="'title-amendment'"/>
620
+ </xsl:call-template>
621
+ </xsl:variable>
622
+ <xsl:value-of select="$title-amendment"/><xsl:text> </xsl:text>
623
+ <xsl:variable name="amendment-number" select="/iso:iso-standard/iso:bibdata/iso:ext/iso:structuredidentifier/iso:project-number/@amendment"/>
624
+ <xsl:if test="normalize-space($amendment-number) != ''">
625
+ <xsl:value-of select="$amendment-number"/><xsl:text> </xsl:text>
626
+ </xsl:if>
627
+ </fo:block>
628
+ <fo:block>
629
+ <xsl:if test="/iso:iso-standard/iso:bibdata/iso:date[@type = 'updated']">
630
+ <xsl:value-of select="/iso:iso-standard/iso:bibdata/iso:date[@type = 'updated']"/>
631
+ </xsl:if>
632
+ </fo:block>
571
633
  </fo:block>
634
+ </xsl:if>
572
635
  </fo:table-cell>
573
636
  </fo:table-row>
637
+
574
638
  </fo:table-body>
575
639
  </fo:table>
576
640
 
@@ -639,6 +703,12 @@
639
703
  </xsl:if>
640
704
  <xsl:value-of select="$title-part"/>
641
705
  </xsl:if> -->
706
+ <xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'en' and @type = 'title-amd']"/>
707
+ <xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
708
+ <fo:block margin-right="-5mm" margin-top="12pt">
709
+ <xsl:call-template name="printAmendmentTitle"/>
710
+ </fo:block>
711
+ </xsl:if>
642
712
  </fo:block>
643
713
 
644
714
  <fo:block font-size="9pt"><xsl:value-of select="$linebreak"/></fo:block>
@@ -653,6 +723,15 @@
653
723
 
654
724
  <xsl:call-template name="printTitlePartFr"/>
655
725
 
726
+ <xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'fr' and @type = 'title-amd']"/>
727
+ <xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
728
+ <fo:block margin-right="-5mm" margin-top="6pt">
729
+ <xsl:call-template name="printAmendmentTitle">
730
+ <xsl:with-param name="lang" select="'fr'"/>
731
+ </xsl:call-template>
732
+ </fo:block>
733
+ </xsl:if>
734
+
656
735
  </fo:block>
657
736
  </fo:block>
658
737
  </fo:block-container>
@@ -690,8 +769,12 @@
690
769
  </fo:block>
691
770
  </fo:table-cell>
692
771
  <fo:table-cell display-align="center">
693
- <fo:block text-align="right">
694
- <fo:block>Reference number</fo:block>
772
+ <fo:block text-align="right">
773
+ <fo:block>
774
+ <xsl:call-template name="getLocalizedString">
775
+ <xsl:with-param name="key">reference_number</xsl:with-param>
776
+ </xsl:call-template>
777
+ </fo:block>
695
778
  <fo:block><xsl:value-of select="$ISOname"/></fo:block>
696
779
  <fo:block> </fo:block>
697
780
  <fo:block> </fo:block>
@@ -918,10 +1001,10 @@
918
1001
  <xsl:if test="/iso:iso-standard/iso:boilerplate/iso:copyright-statement">
919
1002
 
920
1003
  <fo:block-container height="252mm" display-align="after">
921
- <fo:block margin-bottom="3mm">
922
- <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Attention))}" width="14mm" content-height="13mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image {@alt}"/>
923
- <fo:inline padding-left="6mm" font-size="12pt" font-weight="bold">COPYRIGHT PROTECTED DOCUMENT</fo:inline>
924
- </fo:block>
1004
+ <!-- <fo:block margin-bottom="3mm">
1005
+ <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Attention))}" width="14mm" content-height="13mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image {@alt}"/>
1006
+ <fo:inline padding-left="6mm" font-size="12pt" font-weight="bold"></fo:inline>
1007
+ </fo:block> -->
925
1008
  <fo:block line-height="90%">
926
1009
  <fo:block font-size="9pt" text-align="justify">
927
1010
  <xsl:apply-templates select="/iso:iso-standard/iso:boilerplate/iso:copyright-statement"/>
@@ -966,7 +1049,7 @@
966
1049
  </xsl:if>
967
1050
 
968
1051
  <xsl:variable name="margin-left">12</xsl:variable>
969
- <xsl:for-each select="xalan:nodeset($contents)//item"><!-- [@display = 'true'][not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
1052
+ <xsl:for-each select="xalan:nodeset($contents)//item[@display = 'true']"><!-- [not(@level = 2 and starts-with(@section, '0'))] skip clause from preface -->
970
1053
 
971
1054
  <fo:block>
972
1055
  <xsl:if test="@level = 1">
@@ -996,9 +1079,9 @@
996
1079
  </fo:list-item-label>
997
1080
  <fo:list-item-body start-indent="body-start()">
998
1081
  <fo:block text-align-last="justify" margin-left="12mm" text-indent="-12mm">
999
- <fo:basic-link internal-destination="{@id}" fox:alt-text="{text()}">
1082
+ <fo:basic-link internal-destination="{@id}" fox:alt-text="{title}">
1000
1083
 
1001
- <xsl:apply-templates/>
1084
+ <xsl:apply-templates select="title"/>
1002
1085
 
1003
1086
  <fo:inline keep-together.within-line="always">
1004
1087
  <fo:leader font-size="9pt" font-weight="normal" leader-pattern="dots"/>
@@ -1040,20 +1123,26 @@
1040
1123
  </fo:block>
1041
1124
  -->
1042
1125
  <fo:block font-size="18pt" font-weight="bold" margin-top="40pt" margin-bottom="20pt" line-height="1.1">
1043
- <xsl:variable name="part-en" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'en' and @type = 'title-part']"/>
1126
+
1127
+ <xsl:variable name="title-part-doc-lang" select="/iso:iso-standard/iso:bibdata/iso:title[@language = $lang and @type = 'title-part']"/>
1128
+
1129
+ <xsl:variable name="title-intro-doc-lang" select="/iso:iso-standard/iso:bibdata/iso:title[@language = $lang and @type = 'title-intro']"/>
1130
+
1044
1131
  <fo:block>
1045
- <xsl:if test="normalize-space($title-intro) != ''">
1046
- <xsl:value-of select="$title-intro"/>
1132
+ <xsl:if test="normalize-space($title-intro-doc-lang) != ''">
1133
+ <xsl:value-of select="$title-intro-doc-lang"/>
1047
1134
  <xsl:text> — </xsl:text>
1048
1135
  </xsl:if>
1049
1136
 
1050
- <xsl:value-of select="$title-main"/>
1137
+ <xsl:variable name="title-main-doc-lang" select="/iso:iso-standard/iso:bibdata/iso:title[@language = $lang and @type = 'title-main']"/>
1138
+
1139
+ <xsl:value-of select="$title-main-doc-lang"/>
1051
1140
 
1052
- <xsl:if test="normalize-space($part-en) != ''">
1141
+ <xsl:if test="normalize-space($title-part-doc-lang) != ''">
1053
1142
  <xsl:if test="$part != ''">
1054
1143
  <xsl:text> — </xsl:text>
1055
- <fo:block font-weight="normal" margin-top="12pt" line-height="1.1">
1056
- <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang='en']),'#',$part)"/>
1144
+ <fo:block font-weight="normal" margin-top="12pt" line-height="1.1">
1145
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($titles/title-part[@lang=$lang]),'#',$part)"/>
1057
1146
  <!-- <xsl:value-of select="$title-part-en"/>
1058
1147
  <xsl:value-of select="$part"/>
1059
1148
  <xsl:text>:</xsl:text> -->
@@ -1062,24 +1151,13 @@
1062
1151
  </xsl:if>
1063
1152
  </fo:block>
1064
1153
  <fo:block>
1065
- <xsl:value-of select="$part-en"/>
1154
+ <xsl:value-of select="$title-part-doc-lang"/>
1066
1155
  </fo:block>
1067
1156
 
1068
- <xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = 'en' and @type = 'title-amd']"/>
1157
+ <xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = $lang and @type = 'title-amd']"/>
1069
1158
  <xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
1070
- <fo:block font-weight="normal" margin-top="12pt" line-height="1.1">
1071
- <xsl:variable name="title-amendment">
1072
- <xsl:call-template name="getTitle">
1073
- <xsl:with-param name="name" select="'title-amendment'"/>
1074
- </xsl:call-template>
1075
- </xsl:variable>
1076
- <xsl:value-of select="$title-amendment"/>
1077
- <xsl:variable name="amendment-number" select="/iso:iso-standard/iso:bibdata/iso:ext/iso:structuredidentifier/iso:project-number/@amendment"/>
1078
- <xsl:if test="normalize-space($amendment-number) != ''">
1079
- <xsl:text> </xsl:text><xsl:value-of select="$amendment-number"/>
1080
- </xsl:if>
1081
- <xsl:text>: </xsl:text>
1082
- <xsl:value-of select="$title-amd"/>
1159
+ <fo:block margin-top="12pt">
1160
+ <xsl:call-template name="printAmendmentTitle"/>
1083
1161
  </fo:block>
1084
1162
  </xsl:if>
1085
1163
 
@@ -1160,7 +1238,28 @@
1160
1238
  </xsl:call-template>
1161
1239
  </fo:block>
1162
1240
  </xsl:if>
1163
- <fo:block font-size="9pt">Price based on <fo:page-number-citation ref-id="lastBlock"/> pages</fo:block>
1241
+ <xsl:variable name="countPages"/>
1242
+ <xsl:variable name="price_based_on">
1243
+ <xsl:call-template name="getLocalizedString">
1244
+ <xsl:with-param name="key">price_based_on</xsl:with-param>
1245
+ </xsl:call-template>
1246
+ </xsl:variable>
1247
+ <xsl:variable name="price_based_on_items">
1248
+ <xsl:call-template name="split">
1249
+ <xsl:with-param name="pText" select="$price_based_on"/>
1250
+ <xsl:with-param name="sep" select="'%'"/>
1251
+ <xsl:with-param name="normalize-space">false</xsl:with-param>
1252
+ </xsl:call-template>
1253
+ </xsl:variable>
1254
+ <!-- Price based on ... pages -->
1255
+ <fo:block font-size="9pt">
1256
+ <xsl:for-each select="xalan:nodeset($price_based_on_items)/item">
1257
+ <xsl:value-of select="."/>
1258
+ <xsl:if test="position() != last()">
1259
+ <fo:page-number-citation ref-id="lastBlock"/>
1260
+ </xsl:if>
1261
+ </xsl:for-each>
1262
+ </fo:block>
1164
1263
  </fo:block-container>
1165
1264
  </fo:block-container>
1166
1265
  </fo:flow>
@@ -1174,6 +1273,27 @@
1174
1273
  <xsl:apply-templates/>
1175
1274
  </xsl:template>
1176
1275
 
1276
+ <xsl:template name="printAmendmentTitle">
1277
+ <xsl:param name="lang" select="'en'"/>
1278
+ <xsl:variable name="title-amd" select="/iso:iso-standard/iso:bibdata/iso:title[@language = $lang and @type = 'title-amd']"/>
1279
+ <xsl:if test="$doctype = 'amendment' and normalize-space($title-amd) != ''">
1280
+ <fo:block font-weight="normal" line-height="1.1">
1281
+ <xsl:variable name="title-amendment">
1282
+ <xsl:call-template name="getTitle">
1283
+ <xsl:with-param name="name" select="'title-amendment'"/>
1284
+ </xsl:call-template>
1285
+ </xsl:variable>
1286
+ <xsl:value-of select="$title-amendment"/>
1287
+ <xsl:variable name="amendment-number" select="/iso:iso-standard/iso:bibdata/iso:ext/iso:structuredidentifier/iso:project-number/@amendment"/>
1288
+ <xsl:if test="normalize-space($amendment-number) != ''">
1289
+ <xsl:text> </xsl:text><xsl:value-of select="$amendment-number"/>
1290
+ </xsl:if>
1291
+ <xsl:text>: </xsl:text>
1292
+ <xsl:value-of select="$title-amd"/>
1293
+ </fo:block>
1294
+ </xsl:if>
1295
+ </xsl:template>
1296
+
1177
1297
  <!-- ============================= -->
1178
1298
  <!-- CONTENTS -->
1179
1299
  <!-- ============================= -->
@@ -1198,9 +1318,7 @@
1198
1318
  </xsl:variable>
1199
1319
 
1200
1320
  <xsl:variable name="display">
1201
- <xsl:choose>
1202
- <xsl:when test="ancestor-or-self::iso:bibitem">false</xsl:when>
1203
- <xsl:when test="ancestor-or-self::iso:term">false</xsl:when>
1321
+ <xsl:choose>
1204
1322
  <xsl:when test="ancestor-or-self::iso:annex and $level &gt;= 2">false</xsl:when>
1205
1323
  <xsl:when test="$section = '' and $type = 'clause'">false</xsl:when>
1206
1324
  <xsl:when test="$level &lt;= 3">true</xsl:when>
@@ -1208,8 +1326,16 @@
1208
1326
  </xsl:choose>
1209
1327
  </xsl:variable>
1210
1328
 
1329
+ <xsl:variable name="skip">
1330
+ <xsl:choose>
1331
+ <xsl:when test="ancestor-or-self::iso:bibitem">true</xsl:when>
1332
+ <xsl:when test="ancestor-or-self::iso:term">true</xsl:when>
1333
+ <xsl:otherwise>false</xsl:otherwise>
1334
+ </xsl:choose>
1335
+ </xsl:variable>
1336
+
1211
1337
 
1212
- <xsl:if test="$display = 'true'">
1338
+ <xsl:if test="$skip = 'false'">
1213
1339
 
1214
1340
  <xsl:variable name="title">
1215
1341
  <xsl:call-template name="getName"/>
@@ -1220,12 +1346,13 @@
1220
1346
  <xsl:if test="ancestor-or-self::iso:annex">annex</xsl:if>
1221
1347
  </xsl:variable>
1222
1348
 
1223
- <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}">
1224
- <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
1349
+ <item id="{@id}" level="{$level}" section="{$section}" type="{$type}" root="{$root}" display="{$display}">
1350
+ <title>
1351
+ <xsl:apply-templates select="xalan:nodeset($title)" mode="contents_item"/>
1352
+ </title>
1353
+ <xsl:apply-templates mode="contents"/>
1225
1354
  </item>
1226
- <xsl:apply-templates mode="contents"/>
1227
- </xsl:if>
1228
-
1355
+ </xsl:if>
1229
1356
  </xsl:template>
1230
1357
 
1231
1358
 
@@ -1282,6 +1409,14 @@
1282
1409
  <fo:block>www.iso.org</fo:block>
1283
1410
  </fo:block> -->
1284
1411
 
1412
+ <xsl:template match="iso:copyright-statement/iso:clause[1]/iso:title">
1413
+ <fo:block margin-bottom="3mm">
1414
+ <fo:external-graphic src="{concat('data:image/png;base64,', normalize-space($Image-Attention))}" width="14mm" content-height="13mm" content-width="scale-to-fit" scaling="uniform" fox:alt-text="Image {@alt}"/>
1415
+ <!-- <fo:inline padding-left="6mm" font-size="12pt" font-weight="bold">COPYRIGHT PROTECTED DOCUMENT</fo:inline> -->
1416
+ <fo:inline padding-left="6mm" font-size="12pt" font-weight="bold"><xsl:apply-templates/></fo:inline>
1417
+ </fo:block>
1418
+ </xsl:template>
1419
+
1285
1420
  <xsl:template match="iso:copyright-statement//iso:p">
1286
1421
  <fo:block>
1287
1422
  <xsl:if test="preceding-sibling::iso:p">
@@ -1546,6 +1681,9 @@
1546
1681
  <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
1547
1682
  <fo:inline font-style="italic">
1548
1683
  <xsl:choose>
1684
+ <xsl:when test="iso:title[@type = 'main' and @language = $lang]">
1685
+ <xsl:value-of select="iso:title[@type = 'main' and @language = $lang]"/>
1686
+ </xsl:when>
1549
1687
  <xsl:when test="iso:title[@type = 'main' and @language = 'en']">
1550
1688
  <xsl:value-of select="iso:title[@type = 'main' and @language = 'en']"/>
1551
1689
  </xsl:when>
@@ -1665,6 +1803,9 @@
1665
1803
  <xsl:apply-templates select="iso:note"/>
1666
1804
  <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
1667
1805
  <xsl:choose>
1806
+ <xsl:when test="iso:title[@type = 'main' and @language = $lang]">
1807
+ <xsl:apply-templates select="iso:title[@type = 'main' and @language = $lang]"/>
1808
+ </xsl:when>
1668
1809
  <xsl:when test="iso:title[@type = 'main' and @language = 'en']">
1669
1810
  <xsl:apply-templates select="iso:title[@type = 'main' and @language = 'en']"/>
1670
1811
  </xsl:when>
@@ -1706,7 +1847,12 @@
1706
1847
 
1707
1848
  <xsl:template match="iso:admonition">
1708
1849
  <fo:block margin-bottom="12pt" font-weight="bold"> <!-- text-align="center" -->
1709
- <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(@type))"/>
1850
+ <xsl:variable name="type">
1851
+ <xsl:call-template name="getLocalizedString">
1852
+ <xsl:with-param name="key">admonition.<xsl:value-of select="@type"/></xsl:with-param>
1853
+ </xsl:call-template>
1854
+ </xsl:variable>
1855
+ <xsl:value-of select="java:toUpperCase(java:java.lang.String.new($type))"/>
1710
1856
  <xsl:text> — </xsl:text>
1711
1857
  <xsl:apply-templates/>
1712
1858
  </fo:block>
@@ -1987,6 +2133,12 @@
1987
2133
 
1988
2134
  </title-edition>
1989
2135
 
2136
+ <title-edition lang="fr">
2137
+
2138
+ <xsl:text>Édition </xsl:text>
2139
+
2140
+ </title-edition>
2141
+
1990
2142
 
1991
2143
  <title-toc lang="en">
1992
2144
 
@@ -1995,7 +2147,12 @@
1995
2147
 
1996
2148
 
1997
2149
  </title-toc>
1998
- <title-toc lang="fr">Sommaire</title-toc>
2150
+ <title-toc lang="fr">
2151
+
2152
+ <xsl:text>Sommaire</xsl:text>
2153
+
2154
+
2155
+ </title-toc>
1999
2156
 
2000
2157
  <title-toc lang="zh">Contents</title-toc>
2001
2158
 
@@ -2017,15 +2174,24 @@
2017
2174
  <xsl:text>Part #:</xsl:text>
2018
2175
 
2019
2176
 
2177
+
2020
2178
  </title-part>
2021
2179
  <title-part lang="fr">
2022
2180
 
2023
2181
  <xsl:text>Partie #:</xsl:text>
2024
2182
 
2025
2183
 
2184
+
2026
2185
  </title-part>
2027
2186
  <title-part lang="zh">第 # 部分:</title-part>
2028
2187
 
2188
+ <title-subpart lang="en">
2189
+
2190
+ </title-subpart>
2191
+ <title-subpart lang="fr">
2192
+
2193
+ </title-subpart>
2194
+
2029
2195
  <title-modified lang="en">modified</title-modified>
2030
2196
  <title-modified lang="fr">modifiée</title-modified>
2031
2197
 
@@ -2087,10 +2253,19 @@
2087
2253
 
2088
2254
  </xsl:variable><xsl:variable name="tab_zh"> </xsl:variable><xsl:template name="getTitle">
2089
2255
  <xsl:param name="name"/>
2090
- <xsl:variable name="lang">
2091
- <xsl:call-template name="getLang"/>
2256
+ <xsl:param name="lang"/>
2257
+ <xsl:variable name="lang_">
2258
+ <xsl:choose>
2259
+ <xsl:when test="$lang != ''">
2260
+ <xsl:value-of select="$lang"/>
2261
+ </xsl:when>
2262
+ <xsl:otherwise>
2263
+ <xsl:call-template name="getLang"/>
2264
+ </xsl:otherwise>
2265
+ </xsl:choose>
2092
2266
  </xsl:variable>
2093
- <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $lang]"/>
2267
+ <xsl:variable name="language" select="normalize-space($lang_)"/>
2268
+ <xsl:variable name="title_" select="$titles/*[local-name() = $name][@lang = $language]"/>
2094
2269
  <xsl:choose>
2095
2270
  <xsl:when test="normalize-space($title_) != ''">
2096
2271
  <xsl:value-of select="$title_"/>
@@ -2099,7 +2274,9 @@
2099
2274
  <xsl:value-of select="$titles/*[local-name() = $name][@lang = 'en']"/>
2100
2275
  </xsl:otherwise>
2101
2276
  </xsl:choose>
2102
- </xsl:template><xsl:variable name="lower">abcdefghijklmnopqrstuvwxyz</xsl:variable><xsl:variable name="upper">ABCDEFGHIJKLMNOPQRSTUVWXYZ</xsl:variable><xsl:variable name="en_chars" select="concat($lower,$upper,',.`1234567890-=~!@#$%^*()_+[]{}\|?/')"/><xsl:variable name="linebreak" select="'&#8232;'"/><xsl:attribute-set name="link-style">
2277
+ </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">
2278
+
2279
+ </xsl:attribute-set><xsl:attribute-set name="link-style">
2103
2280
 
2104
2281
  <xsl:attribute name="color">blue</xsl:attribute>
2105
2282
  <xsl:attribute name="text-decoration">underline</xsl:attribute>
@@ -2241,6 +2418,7 @@
2241
2418
 
2242
2419
 
2243
2420
 
2421
+
2244
2422
  </xsl:attribute-set><xsl:attribute-set name="appendix-style">
2245
2423
 
2246
2424
  <xsl:attribute name="font-size">12pt</xsl:attribute>
@@ -2289,6 +2467,7 @@
2289
2467
 
2290
2468
 
2291
2469
 
2470
+
2292
2471
  </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">
2293
2472
 
2294
2473
 
@@ -2490,6 +2669,10 @@
2490
2669
 
2491
2670
 
2492
2671
 
2672
+ <!-- <xsl:if test="$namespace = 'bipm'">
2673
+ <fo:block>&#xA0;</fo:block>
2674
+ </xsl:if> -->
2675
+
2493
2676
  <!-- $namespace = 'iso' or -->
2494
2677
 
2495
2678
 
@@ -2523,6 +2706,7 @@
2523
2706
  <xsl:with-param name="table" select="$simple-table"/>
2524
2707
  </xsl:call-template>
2525
2708
  </xsl:variable>
2709
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2526
2710
 
2527
2711
  <!-- <xsl:variable name="colwidths2">
2528
2712
  <xsl:call-template name="calculate-column-widths">
@@ -2543,11 +2727,16 @@
2543
2727
 
2544
2728
  <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
2545
2729
 
2730
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2546
2731
 
2547
2732
 
2733
+
2734
+
2735
+
2548
2736
 
2549
2737
 
2550
-
2738
+
2739
+
2551
2740
 
2552
2741
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
2553
2742
  <xsl:attribute name="margin-left">0mm</xsl:attribute>
@@ -2556,30 +2745,47 @@
2556
2745
 
2557
2746
 
2558
2747
 
2559
- <fo:table id="{@id}" table-layout="fixed" width="100%" margin-left="{$margin-left}mm" margin-right="{$margin-left}mm" table-omit-footer-at-break="true">
2748
+
2749
+
2750
+
2751
+ <xsl:variable name="table_attributes">
2752
+ <attribute name="table-layout">fixed</attribute>
2753
+ <attribute name="width">100%</attribute>
2754
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
2755
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
2560
2756
 
2561
- <xsl:attribute name="border">1.5pt solid black</xsl:attribute>
2757
+ <attribute name="border">1.5pt solid black</attribute>
2562
2758
  <xsl:if test="*[local-name()='thead']">
2563
- <xsl:attribute name="border-top">1pt solid black</xsl:attribute>
2759
+ <attribute name="border-top">1pt solid black</attribute>
2564
2760
  </xsl:if>
2565
2761
 
2566
2762
 
2567
2763
 
2568
2764
 
2569
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2570
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
2571
-
2572
-
2573
-
2574
-
2575
-
2576
-
2577
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2765
+ <attribute name="margin-left">0mm</attribute>
2766
+ <attribute name="margin-right">0mm</attribute>
2578
2767
 
2768
+
2769
+
2770
+
2579
2771
 
2772
+
2580
2773
 
2774
+ </xsl:variable>
2775
+
2776
+
2777
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
2581
2778
 
2779
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
2780
+ <xsl:attribute name="{@name}">
2781
+ <xsl:value-of select="."/>
2782
+ </xsl:attribute>
2783
+ </xsl:for-each>
2582
2784
 
2785
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
2786
+ <xsl:if test="$isNoteOrFnExist = 'true'">
2787
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2788
+ </xsl:if>
2583
2789
 
2584
2790
  <xsl:for-each select="xalan:nodeset($colwidths)//column">
2585
2791
  <xsl:choose>
@@ -2603,6 +2809,33 @@
2603
2809
 
2604
2810
  </fo:table>
2605
2811
 
2812
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
2813
+ <xsl:call-template name="insertTableFooterInSeparateTable">
2814
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
2815
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2816
+ </xsl:call-template>
2817
+ </xsl:for-each>
2818
+
2819
+ <!-- insert footer as table -->
2820
+ <!-- <fo:table>
2821
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
2822
+ <xsl:attribute name="{@name}">
2823
+ <xsl:value-of select="."/>
2824
+ </xsl:attribute>
2825
+ </xsl:for-each>
2826
+
2827
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2828
+ <xsl:choose>
2829
+ <xsl:when test=". = 1 or . = 0">
2830
+ <fo:table-column column-width="proportional-column-width(2)"/>
2831
+ </xsl:when>
2832
+ <xsl:otherwise>
2833
+ <fo:table-column column-width="proportional-column-width({.})"/>
2834
+ </xsl:otherwise>
2835
+ </xsl:choose>
2836
+ </xsl:for-each>
2837
+ </fo:table>-->
2838
+
2606
2839
 
2607
2840
 
2608
2841
 
@@ -2614,6 +2847,7 @@
2614
2847
 
2615
2848
  <xsl:attribute name="margin-bottom">0pt</xsl:attribute>
2616
2849
 
2850
+
2617
2851
  <xsl:apply-templates/>
2618
2852
  </fo:block>
2619
2853
  </xsl:if>
@@ -2669,6 +2903,13 @@
2669
2903
  <xsl:for-each select="xalan:nodeset($table)//tr">
2670
2904
  <xsl:variable name="td_text">
2671
2905
  <xsl:apply-templates select="td[$curr-col]" mode="td_text"/>
2906
+
2907
+ <!-- <xsl:if test="$namespace = 'bipm'">
2908
+ <xsl:for-each select="*[local-name()='td'][$curr-col]//*[local-name()='math']">
2909
+ <word><xsl:value-of select="normalize-space(.)"/></word>
2910
+ </xsl:for-each>
2911
+ </xsl:if> -->
2912
+
2672
2913
  </xsl:variable>
2673
2914
  <xsl:variable name="words">
2674
2915
  <xsl:variable name="string_with_added_zerospaces">
@@ -2728,6 +2969,9 @@
2728
2969
  <xsl:value-of select="*[local-name()='origin']/@citeas"/>
2729
2970
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
2730
2971
  <xsl:value-of select="@target"/>
2972
+ </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
2973
+ <xsl:variable name="math_text" select="normalize-space(.)"/>
2974
+ <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
2731
2975
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
2732
2976
  <xsl:param name="cols-count"/>
2733
2977
  <!-- font-weight="bold" -->
@@ -2736,7 +2980,7 @@
2736
2980
  <xsl:call-template name="table-header-title">
2737
2981
  <xsl:with-param name="cols-count" select="$cols-count"/>
2738
2982
  </xsl:call-template>
2739
-
2983
+
2740
2984
  <xsl:apply-templates/>
2741
2985
  </fo:table-header>
2742
2986
  </xsl:template><xsl:template name="table-header-title">
@@ -2761,6 +3005,13 @@
2761
3005
  </xsl:template><xsl:template match="*[local-name()='tfoot']"/><xsl:template match="*[local-name()='tfoot']" mode="process">
2762
3006
  <xsl:apply-templates/>
2763
3007
  </xsl:template><xsl:template name="insertTableFooter">
3008
+ <xsl:param name="cols-count"/>
3009
+ <xsl:if test="../*[local-name()='tfoot']">
3010
+ <fo:table-footer>
3011
+ <xsl:apply-templates select="../*[local-name()='tfoot']" mode="process"/>
3012
+ </fo:table-footer>
3013
+ </xsl:if>
3014
+ </xsl:template><xsl:template name="insertTableFooter2">
2764
3015
  <xsl:param name="cols-count"/>
2765
3016
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
2766
3017
  <xsl:if test="../*[local-name()='tfoot'] or $isNoteOrFnExist = 'true'">
@@ -2784,11 +3035,29 @@
2784
3035
  <!-- fn will be processed inside 'note' processing -->
2785
3036
 
2786
3037
 
3038
+
3039
+
3040
+
3041
+
2787
3042
  <!-- except gb -->
2788
3043
 
2789
3044
  <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
2790
3045
 
2791
3046
 
3047
+ <!-- show Note under table in preface (ex. abstract) sections -->
3048
+ <!-- empty, because notes show at page side in main sections -->
3049
+ <!-- <xsl:if test="$namespace = 'bipm'">
3050
+ <xsl:choose>
3051
+ <xsl:when test="ancestor::*[local-name()='preface']">
3052
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
3053
+ </xsl:when>
3054
+ <xsl:otherwise>
3055
+ <fo:block/>
3056
+ </xsl:otherwise>
3057
+ </xsl:choose>
3058
+ </xsl:if> -->
3059
+
3060
+
2792
3061
  <!-- horizontal row separator -->
2793
3062
 
2794
3063
 
@@ -2802,6 +3071,90 @@
2802
3071
  </fo:table-footer>
2803
3072
 
2804
3073
  </xsl:if>
3074
+ </xsl:template><xsl:template name="insertTableFooterInSeparateTable">
3075
+ <xsl:param name="table_attributes"/>
3076
+ <xsl:param name="colwidths"/>
3077
+
3078
+ <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3079
+
3080
+ <xsl:if test="$isNoteOrFnExist = 'true'">
3081
+
3082
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($colwidths)//column)"/>
3083
+
3084
+ <fo:table keep-with-previous="always">
3085
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
3086
+ <xsl:choose>
3087
+ <xsl:when test="@name = 'border-top'">
3088
+ <xsl:attribute name="{@name}">0pt solid black</xsl:attribute>
3089
+ </xsl:when>
3090
+ <xsl:when test="@name = 'border'">
3091
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
3092
+ <xsl:attribute name="border-top">0pt solid black</xsl:attribute>
3093
+ </xsl:when>
3094
+ <xsl:otherwise>
3095
+ <xsl:attribute name="{@name}"><xsl:value-of select="."/></xsl:attribute>
3096
+ </xsl:otherwise>
3097
+ </xsl:choose>
3098
+ </xsl:for-each>
3099
+
3100
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
3101
+ <xsl:choose>
3102
+ <xsl:when test=". = 1 or . = 0">
3103
+ <fo:table-column column-width="proportional-column-width(2)"/>
3104
+ </xsl:when>
3105
+ <xsl:otherwise>
3106
+ <fo:table-column column-width="proportional-column-width({.})"/>
3107
+ </xsl:otherwise>
3108
+ </xsl:choose>
3109
+ </xsl:for-each>
3110
+
3111
+ <fo:table-body>
3112
+ <fo:table-row>
3113
+ <fo:table-cell border="solid black 1pt" padding-left="1mm" padding-right="1mm" padding-top="1mm" number-columns-spanned="{$cols-count}">
3114
+
3115
+ <xsl:attribute name="border-top">solid black 0pt</xsl:attribute>
3116
+
3117
+
3118
+
3119
+ <!-- fn will be processed inside 'note' processing -->
3120
+
3121
+
3122
+
3123
+
3124
+
3125
+
3126
+
3127
+ <!-- except gb -->
3128
+
3129
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
3130
+
3131
+
3132
+ <!-- <xsl:if test="$namespace = 'bipm'">
3133
+ <xsl:choose>
3134
+ <xsl:when test="ancestor::*[local-name()='preface']">
3135
+ show Note under table in preface (ex. abstract) sections
3136
+ <xsl:apply-templates select="../*[local-name()='note']" mode="process"/>
3137
+ </xsl:when>
3138
+ <xsl:otherwise>
3139
+ empty, because notes show at page side in main sections
3140
+ <fo:block/>
3141
+ </xsl:otherwise>
3142
+ </xsl:choose>
3143
+ </xsl:if> -->
3144
+
3145
+
3146
+ <!-- horizontal row separator -->
3147
+
3148
+
3149
+ <!-- fn processing -->
3150
+ <xsl:call-template name="fn_display"/>
3151
+
3152
+ </fo:table-cell>
3153
+ </fo:table-row>
3154
+ </fo:table-body>
3155
+
3156
+ </fo:table>
3157
+ </xsl:if>
2805
3158
  </xsl:template><xsl:template match="*[local-name()='tbody']">
2806
3159
 
2807
3160
  <xsl:variable name="cols-count">
@@ -2904,8 +3257,12 @@
2904
3257
 
2905
3258
  </xsl:if>
2906
3259
 
2907
-
2908
-
3260
+
3261
+
3262
+
3263
+ <!-- <xsl:if test="$namespace = 'bipm'">
3264
+ <xsl:attribute name="height">8mm</xsl:attribute>
3265
+ </xsl:if> -->
2909
3266
 
2910
3267
  <xsl:apply-templates/>
2911
3268
  </fo:table-row>
@@ -2931,6 +3288,7 @@
2931
3288
 
2932
3289
 
2933
3290
 
3291
+
2934
3292
  <xsl:if test="@colspan">
2935
3293
  <xsl:attribute name="number-columns-spanned">
2936
3294
  <xsl:value-of select="@colspan"/>
@@ -2976,7 +3334,8 @@
2976
3334
  <xsl:attribute name="border">solid black 0</xsl:attribute>
2977
3335
  </xsl:if>
2978
3336
 
2979
-
3337
+
3338
+
2980
3339
 
2981
3340
 
2982
3341
 
@@ -2994,7 +3353,8 @@
2994
3353
  </xsl:attribute>
2995
3354
  </xsl:if>
2996
3355
  <xsl:call-template name="display-align"/>
2997
- <fo:block>
3356
+ <fo:block>
3357
+
2998
3358
  <xsl:apply-templates/>
2999
3359
  </fo:block>
3000
3360
  </fo:table-cell>
@@ -3009,14 +3369,17 @@
3009
3369
 
3010
3370
 
3011
3371
 
3372
+
3373
+
3012
3374
  <fo:inline padding-right="2mm">
3013
3375
 
3014
3376
 
3015
3377
 
3016
-
3378
+
3017
3379
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
3018
3380
 
3019
3381
  </fo:inline>
3382
+
3020
3383
  <xsl:apply-templates mode="process"/>
3021
3384
  </fo:block>
3022
3385
 
@@ -3043,6 +3406,7 @@
3043
3406
 
3044
3407
 
3045
3408
 
3409
+
3046
3410
  <fo:inline font-size="80%" padding-right="5mm" id="{@id}">
3047
3411
 
3048
3412
 
@@ -3052,12 +3416,15 @@
3052
3416
 
3053
3417
 
3054
3418
 
3419
+
3055
3420
  <xsl:value-of select="@reference"/>
3056
3421
 
3422
+
3057
3423
  </fo:inline>
3058
3424
  <fo:inline>
3059
3425
 
3060
- <xsl:apply-templates/>
3426
+ <!-- <xsl:apply-templates /> -->
3427
+ <xsl:copy-of select="./node()"/>
3061
3428
  </fo:inline>
3062
3429
  </fo:block>
3063
3430
  </xsl:if>
@@ -3094,7 +3461,20 @@
3094
3461
  <xsl:variable name="following_dl_colwidths">
3095
3462
  <xsl:if test="*[local-name() = 'dl']"><!-- if there is a 'dl', then set the same columns width as for 'dl' -->
3096
3463
  <xsl:variable name="html-table">
3097
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
3464
+ <xsl:variable name="doc_ns">
3465
+
3466
+ </xsl:variable>
3467
+ <xsl:variable name="ns">
3468
+ <xsl:choose>
3469
+ <xsl:when test="normalize-space($doc_ns) != ''">
3470
+ <xsl:value-of select="normalize-space($doc_ns)"/>
3471
+ </xsl:when>
3472
+ <xsl:otherwise>
3473
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
3474
+ </xsl:otherwise>
3475
+ </xsl:choose>
3476
+ </xsl:variable>
3477
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
3098
3478
  <xsl:element name="{$ns}:table">
3099
3479
  <xsl:for-each select="*[local-name() = 'dl'][1]">
3100
3480
  <tbody>
@@ -3159,7 +3539,8 @@
3159
3539
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
3160
3540
  </xsl:if>
3161
3541
 
3162
- <xsl:apply-templates/>
3542
+ <!-- <xsl:apply-templates /> -->
3543
+ <xsl:copy-of select="./node()"/>
3163
3544
  </fo:block>
3164
3545
  </fo:table-cell>
3165
3546
  </fo:table-row>
@@ -3184,9 +3565,12 @@
3184
3565
 
3185
3566
 
3186
3567
 
3568
+
3187
3569
  <fo:basic-link internal-destination="{@reference}_{ancestor::*[@id][1]/@id}" fox:alt-text="{@reference}"> <!-- @reference | ancestor::*[local-name()='clause'][1]/@id-->
3188
3570
 
3571
+
3189
3572
  <xsl:value-of select="@reference"/>
3573
+
3190
3574
  </fo:basic-link>
3191
3575
  </fo:inline>
3192
3576
  </xsl:template><xsl:template match="*[local-name()='fn']/*[local-name()='p']">
@@ -3194,7 +3578,11 @@
3194
3578
  <xsl:apply-templates/>
3195
3579
  </fo:inline>
3196
3580
  </xsl:template><xsl:template match="*[local-name()='dl']">
3197
- <fo:block-container margin-left="0mm">
3581
+ <fo:block-container>
3582
+
3583
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3584
+
3585
+
3198
3586
  <xsl:if test="parent::*[local-name() = 'note']">
3199
3587
  <xsl:attribute name="margin-left">
3200
3588
  <xsl:choose>
@@ -3204,8 +3592,11 @@
3204
3592
  </xsl:attribute>
3205
3593
 
3206
3594
  </xsl:if>
3207
- <fo:block-container margin-left="0mm">
3208
-
3595
+ <fo:block-container>
3596
+
3597
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
3598
+
3599
+
3209
3600
  <xsl:variable name="parent" select="local-name(..)"/>
3210
3601
 
3211
3602
  <xsl:variable name="key_iso">
@@ -3223,9 +3614,12 @@
3223
3614
  <xsl:attribute name="margin-bottom">0</xsl:attribute>
3224
3615
 
3225
3616
  <xsl:variable name="title-where">
3226
- <xsl:call-template name="getTitle">
3227
- <xsl:with-param name="name" select="'title-where'"/>
3228
- </xsl:call-template>
3617
+
3618
+ <xsl:call-template name="getLocalizedString">
3619
+ <xsl:with-param name="key">where</xsl:with-param>
3620
+ </xsl:call-template>
3621
+
3622
+
3229
3623
  </xsl:variable>
3230
3624
  <xsl:value-of select="$title-where"/><xsl:text> </xsl:text>
3231
3625
  <xsl:apply-templates select="*[local-name()='dt']/*"/>
@@ -3243,9 +3637,12 @@
3243
3637
 
3244
3638
 
3245
3639
  <xsl:variable name="title-where">
3246
- <xsl:call-template name="getTitle">
3247
- <xsl:with-param name="name" select="'title-where'"/>
3248
- </xsl:call-template>
3640
+
3641
+ <xsl:call-template name="getLocalizedString">
3642
+ <xsl:with-param name="key">where</xsl:with-param>
3643
+ </xsl:call-template>
3644
+
3645
+
3249
3646
  </xsl:variable>
3250
3647
  <xsl:value-of select="$title-where"/>
3251
3648
  </fo:block>
@@ -3259,9 +3656,12 @@
3259
3656
 
3260
3657
 
3261
3658
  <xsl:variable name="title-key">
3262
- <xsl:call-template name="getTitle">
3263
- <xsl:with-param name="name" select="'title-key'"/>
3264
- </xsl:call-template>
3659
+
3660
+ <xsl:call-template name="getLocalizedString">
3661
+ <xsl:with-param name="key">key</xsl:with-param>
3662
+ </xsl:call-template>
3663
+
3664
+
3265
3665
  </xsl:variable>
3266
3666
  <xsl:value-of select="$title-key"/>
3267
3667
  </fo:block>
@@ -3298,7 +3698,20 @@
3298
3698
  </xsl:choose>
3299
3699
  <!-- create virtual html table for dl/[dt and dd] -->
3300
3700
  <xsl:variable name="html-table">
3301
- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/>
3701
+ <xsl:variable name="doc_ns">
3702
+
3703
+ </xsl:variable>
3704
+ <xsl:variable name="ns">
3705
+ <xsl:choose>
3706
+ <xsl:when test="normalize-space($doc_ns) != ''">
3707
+ <xsl:value-of select="normalize-space($doc_ns)"/>
3708
+ </xsl:when>
3709
+ <xsl:otherwise>
3710
+ <xsl:value-of select="substring-before(name(/*), '-')"/>
3711
+ </xsl:otherwise>
3712
+ </xsl:choose>
3713
+ </xsl:variable>
3714
+ <!-- <xsl:variable name="ns" select="substring-before(name(/*), '-')"/> -->
3302
3715
  <xsl:element name="{$ns}:table">
3303
3716
  <tbody>
3304
3717
  <xsl:apply-templates mode="dl"/>
@@ -3444,6 +3857,7 @@
3444
3857
 
3445
3858
 
3446
3859
 
3860
+
3447
3861
  <xsl:apply-templates/>
3448
3862
  <!-- <xsl:if test="$namespace = 'gb'">
3449
3863
  <xsl:if test="ancestor::*[local-name()='formula']">
@@ -3510,18 +3924,18 @@
3510
3924
  </xsl:template><xsl:template match="*[local-name()='tt']">
3511
3925
  <fo:inline xsl:use-attribute-sets="tt-style">
3512
3926
  <xsl:variable name="_font-size">
3513
-
3514
-
3515
-
3927
+
3928
+
3929
+
3516
3930
 
3517
3931
 
3518
3932
  10
3519
3933
 
3520
3934
 
3521
3935
 
3522
-
3523
3936
 
3524
-
3937
+
3938
+
3525
3939
 
3526
3940
 
3527
3941
  </xsl:variable>
@@ -3825,7 +4239,18 @@
3825
4239
  <xsl:with-param name="previousRow" select="$newRow"/>
3826
4240
  </xsl:apply-templates>
3827
4241
  </xsl:template><xsl:template name="getLang">
3828
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
4242
+ <xsl:variable name="language_current" select="normalize-space(//*[local-name()='bibdata']//*[local-name()='language'][@current = 'true'])"/>
4243
+ <xsl:variable name="language">
4244
+ <xsl:choose>
4245
+ <xsl:when test="$language_current != ''">
4246
+ <xsl:value-of select="$language_current"/>
4247
+ </xsl:when>
4248
+ <xsl:otherwise>
4249
+ <xsl:value-of select="//*[local-name()='bibdata']//*[local-name()='language']"/>
4250
+ </xsl:otherwise>
4251
+ </xsl:choose>
4252
+ </xsl:variable>
4253
+
3829
4254
  <xsl:choose>
3830
4255
  <xsl:when test="$language = 'English'">en</xsl:when>
3831
4256
  <xsl:otherwise><xsl:value-of select="$language"/></xsl:otherwise>
@@ -3859,7 +4284,8 @@
3859
4284
  <xsl:value-of select="java:toUpperCase(java:java.lang.String.new(substring($str, 1, 1)))"/>
3860
4285
  <xsl:value-of select="substring($str, 2)"/>
3861
4286
  </xsl:template><xsl:template match="mathml:math">
3862
- <fo:inline font-family="STIX2Math">
4287
+ <fo:inline font-family="STIX Two Math"> <!-- -->
4288
+
3863
4289
  <xsl:variable name="mathml">
3864
4290
  <xsl:apply-templates select="." mode="mathml"/>
3865
4291
  </xsl:variable>
@@ -3942,10 +4368,14 @@
3942
4368
  </fo:inline>
3943
4369
  </xsl:template><xsl:template match="*[local-name() = 'modification']">
3944
4370
  <xsl:variable name="title-modified">
3945
- <xsl:call-template name="getTitle">
3946
- <xsl:with-param name="name" select="'title-modified'"/>
3947
- </xsl:call-template>
4371
+
4372
+ <xsl:call-template name="getLocalizedString">
4373
+ <xsl:with-param name="key">modified</xsl:with-param>
4374
+ </xsl:call-template>
4375
+
4376
+
3948
4377
  </xsl:variable>
4378
+
3949
4379
  <xsl:choose>
3950
4380
  <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3951
4381
  <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
@@ -3953,7 +4383,7 @@
3953
4383
  <xsl:apply-templates/>
3954
4384
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
3955
4385
  <fo:basic-link internal-destination="{@target}" fox:alt-text="{@target}" xsl:use-attribute-sets="xref-style">
3956
-
4386
+
3957
4387
  <xsl:apply-templates/>
3958
4388
  </fo:basic-link>
3959
4389
  </xsl:template><xsl:template match="*[local-name() = 'formula']" name="formula">
@@ -4006,6 +4436,8 @@
4006
4436
 
4007
4437
 
4008
4438
 
4439
+
4440
+
4009
4441
  <fo:inline xsl:use-attribute-sets="note-name-style">
4010
4442
  <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4011
4443
  </fo:inline>
@@ -4131,15 +4563,109 @@
4131
4563
 
4132
4564
  <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
4133
4565
  </fo:block>
4134
- </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">
4566
+ </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">
4135
4567
  <xsl:apply-templates mode="contents"/>
4136
4568
  <xsl:text> </xsl:text>
4137
- </xsl:template><xsl:template match="text()" mode="contents">
4569
+ </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">
4570
+ <xsl:apply-templates mode="bookmarks"/>
4571
+ <xsl:text> </xsl:text>
4572
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="contents" priority="2">
4138
4573
  <xsl:value-of select="."/>
4139
- </xsl:template><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
4574
+ </xsl:template><xsl:template match="*[local-name() = 'name']/text()" mode="bookmarks" priority="2">
4575
+ <xsl:value-of select="."/>
4576
+ </xsl:template><xsl:template match="node()" mode="contents">
4577
+ <xsl:apply-templates mode="contents"/>
4578
+ </xsl:template><xsl:template match="node()" mode="bookmarks">
4579
+ <xsl:apply-templates mode="bookmarks"/>
4580
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents">
4581
+ <xsl:apply-templates select="."/>
4582
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="bookmarks">
4583
+ <xsl:apply-templates mode="bookmarks"/>
4584
+ </xsl:template><xsl:template name="addBookmarks">
4585
+ <xsl:param name="contents"/>
4586
+ <xsl:if test="xalan:nodeset($contents)//item">
4587
+ <fo:bookmark-tree>
4588
+ <xsl:choose>
4589
+ <xsl:when test="xalan:nodeset($contents)/doc">
4590
+ <xsl:choose>
4591
+ <xsl:when test="count(xalan:nodeset($contents)/doc) &gt; 1">
4592
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
4593
+ <fo:bookmark internal-destination="{contents/item[1]/@id}" starting-state="hide">
4594
+ <fo:bookmark-title>
4595
+ <xsl:variable name="bookmark-title_">
4596
+ <xsl:call-template name="getLangVersion">
4597
+ <xsl:with-param name="lang" select="@lang"/>
4598
+ </xsl:call-template>
4599
+ </xsl:variable>
4600
+ <xsl:choose>
4601
+ <xsl:when test="normalize-space($bookmark-title_) != ''">
4602
+ <xsl:value-of select="normalize-space($bookmark-title_)"/>
4603
+ </xsl:when>
4604
+ <xsl:otherwise>
4605
+ <xsl:choose>
4606
+ <xsl:when test="@lang = 'en'">English</xsl:when>
4607
+ <xsl:when test="@lang = 'fr'">Français</xsl:when>
4608
+ <xsl:when test="@lang = 'de'">Deutsche</xsl:when>
4609
+ <xsl:otherwise><xsl:value-of select="@lang"/> version</xsl:otherwise>
4610
+ </xsl:choose>
4611
+ </xsl:otherwise>
4612
+ </xsl:choose>
4613
+ </fo:bookmark-title>
4614
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
4615
+ </fo:bookmark>
4616
+
4617
+ </xsl:for-each>
4618
+ </xsl:when>
4619
+ <xsl:otherwise>
4620
+ <xsl:for-each select="xalan:nodeset($contents)/doc">
4621
+ <xsl:apply-templates select="contents/item" mode="bookmark"/>
4622
+ </xsl:for-each>
4623
+ </xsl:otherwise>
4624
+ </xsl:choose>
4625
+ </xsl:when>
4626
+ <xsl:otherwise>
4627
+ <xsl:apply-templates select="xalan:nodeset($contents)/contents/item" mode="bookmark"/>
4628
+ </xsl:otherwise>
4629
+ </xsl:choose>
4630
+
4631
+
4632
+
4633
+
4634
+
4635
+
4636
+
4637
+
4638
+ </fo:bookmark-tree>
4639
+ </xsl:if>
4640
+ </xsl:template><xsl:template name="getLangVersion">
4641
+ <xsl:param name="lang"/>
4642
+ <xsl:choose>
4643
+ <xsl:when test="$lang = 'en'">
4644
+
4645
+
4646
+ </xsl:when>
4647
+ <xsl:when test="$lang = 'fr'">
4648
+
4649
+
4650
+ </xsl:when>
4651
+ <xsl:when test="$lang = 'de'">Deutsche</xsl:when>
4652
+ <xsl:otherwise><xsl:value-of select="$lang"/> version</xsl:otherwise>
4653
+ </xsl:choose>
4654
+ </xsl:template><xsl:template match="item" mode="bookmark">
4655
+ <fo:bookmark internal-destination="{@id}" starting-state="hide">
4656
+ <fo:bookmark-title>
4657
+ <xsl:if test="@section != ''">
4658
+ <xsl:value-of select="@section"/>
4659
+ <xsl:text> </xsl:text>
4660
+ </xsl:if>
4661
+ <xsl:value-of select="normalize-space(title)"/>
4662
+ </fo:bookmark-title>
4663
+ <xsl:apply-templates mode="bookmark"/>
4664
+ </fo:bookmark>
4665
+ </xsl:template><xsl:template match="title" mode="bookmark"/><xsl:template match="text()" mode="bookmark"/><xsl:template match="*[local-name() = 'figure']/*[local-name() = 'name'] | *[local-name() = 'image']/*[local-name() = 'name']" mode="presentation">
4140
4666
  <xsl:if test="normalize-space() != ''">
4141
4667
  <fo:block xsl:use-attribute-sets="figure-name-style">
4142
-
4668
+
4143
4669
  <xsl:apply-templates/>
4144
4670
  </fo:block>
4145
4671
  </xsl:if>
@@ -4194,7 +4720,7 @@
4194
4720
  <xsl:apply-templates/>
4195
4721
  </xsl:otherwise>
4196
4722
  </xsl:choose>
4197
- </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
4723
+ </xsl:template><xsl:template match="*[local-name() = 'fn']" mode="contents"/><xsl:template match="*[local-name() = 'fn']" mode="bookmarks"/><xsl:template match="*[local-name() = 'fn']" mode="contents_item"/><xsl:template match="*[local-name() = 'tab']" mode="contents_item">
4198
4724
  <xsl:text> </xsl:text>
4199
4725
  </xsl:template><xsl:template match="*[local-name() = 'strong']" mode="contents_item">
4200
4726
  <xsl:copy>
@@ -4576,9 +5102,14 @@
4576
5102
 
4577
5103
  <fo:inline>
4578
5104
 
4579
- <xsl:call-template name="getTitle">
4580
- <xsl:with-param name="name" select="'title-source'"/>
4581
- </xsl:call-template>
5105
+
5106
+
5107
+ <xsl:call-template name="getLocalizedString">
5108
+ <xsl:with-param name="key">source</xsl:with-param>
5109
+ </xsl:call-template>
5110
+
5111
+
5112
+
4582
5113
  <xsl:text>: </xsl:text>
4583
5114
  </fo:inline>
4584
5115
 
@@ -4727,9 +5258,12 @@
4727
5258
  </fo:block>
4728
5259
  </xsl:template><xsl:template match="*[local-name() = 'deprecates']">
4729
5260
  <xsl:variable name="title-deprecated">
4730
- <xsl:call-template name="getTitle">
4731
- <xsl:with-param name="name" select="'title-deprecated'"/>
4732
- </xsl:call-template>
5261
+
5262
+ <xsl:call-template name="getLocalizedString">
5263
+ <xsl:with-param name="key">deprecated</xsl:with-param>
5264
+ </xsl:call-template>
5265
+
5266
+
4733
5267
  </xsl:variable>
4734
5268
  <fo:block xsl:use-attribute-sets="deprecates-style">
4735
5269
  <xsl:value-of select="$title-deprecated"/>: <xsl:apply-templates/>
@@ -4776,6 +5310,7 @@
4776
5310
  </xsl:template><xsl:template match="*[local-name() = 'clause']">
4777
5311
  <fo:block>
4778
5312
  <xsl:call-template name="setId"/>
5313
+
4779
5314
  <xsl:apply-templates/>
4780
5315
  </fo:block>
4781
5316
  </xsl:template><xsl:template match="*[local-name() = 'definitions']">
@@ -4801,20 +5336,30 @@
4801
5336
  <!-- 0xA0 to space replacement -->
4802
5337
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),' ',' ')"/>
4803
5338
  </xsl:template><xsl:template match="*[local-name() = 'ul'] | *[local-name() = 'ol']">
4804
- <fo:block-container margin-left="0mm">
4805
- <xsl:if test="parent::*[local-name() = 'note']">
4806
- <xsl:attribute name="margin-left">
4807
- <xsl:choose>
4808
- <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
4809
- <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
4810
- </xsl:choose>
4811
- </xsl:attribute>
4812
-
4813
- </xsl:if>
4814
- <fo:block-container margin-left="0mm">
4815
- <xsl:apply-templates select="." mode="ul_ol"/>
4816
- </fo:block-container>
4817
- </fo:block-container>
5339
+ <xsl:choose>
5340
+ <xsl:when test="parent::*[local-name() = 'note']">
5341
+ <fo:block-container>
5342
+ <xsl:attribute name="margin-left">
5343
+ <xsl:choose>
5344
+ <xsl:when test="not(ancestor::*[local-name() = 'table'])"><xsl:value-of select="$note-body-indent"/></xsl:when>
5345
+ <xsl:otherwise><xsl:value-of select="$note-body-indent-table"/></xsl:otherwise>
5346
+ </xsl:choose>
5347
+ </xsl:attribute>
5348
+
5349
+
5350
+ <fo:block-container margin-left="0mm">
5351
+ <fo:block>
5352
+ <xsl:apply-templates select="." mode="ul_ol"/>
5353
+ </fo:block>
5354
+ </fo:block-container>
5355
+ </fo:block-container>
5356
+ </xsl:when>
5357
+ <xsl:otherwise>
5358
+ <fo:block>
5359
+ <xsl:apply-templates select="." mode="ul_ol"/>
5360
+ </fo:block>
5361
+ </xsl:otherwise>
5362
+ </xsl:choose>
4818
5363
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
4819
5364
  <!-- <row>
4820
5365
  <date>05-07-2013</date>
@@ -4987,6 +5532,7 @@
4987
5532
 
4988
5533
 
4989
5534
 
5535
+
4990
5536
 
4991
5537
  </xsl:variable>
4992
5538
  <xsl:choose>
@@ -5003,6 +5549,7 @@
5003
5549
  <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'organization']/*[local-name() = 'name']"/>
5004
5550
 
5005
5551
 
5552
+
5006
5553
  </dc:creator>
5007
5554
  <dc:description>
5008
5555
  <xsl:variable name="abstract">
@@ -5012,6 +5559,7 @@
5012
5559
 
5013
5560
 
5014
5561
 
5562
+
5015
5563
  </xsl:variable>
5016
5564
  <xsl:value-of select="normalize-space($abstract)"/>
5017
5565
  </dc:description>
@@ -5083,13 +5631,22 @@
5083
5631
  </xsl:template><xsl:template name="split">
5084
5632
  <xsl:param name="pText" select="."/>
5085
5633
  <xsl:param name="sep" select="','"/>
5634
+ <xsl:param name="normalize-space" select="'true'"/>
5086
5635
  <xsl:if test="string-length($pText) &gt;0">
5087
5636
  <item>
5088
- <xsl:value-of select="normalize-space(substring-before(concat($pText, ','), $sep))"/>
5637
+ <xsl:choose>
5638
+ <xsl:when test="$normalize-space = 'true'">
5639
+ <xsl:value-of select="normalize-space(substring-before(concat($pText, $sep), $sep))"/>
5640
+ </xsl:when>
5641
+ <xsl:otherwise>
5642
+ <xsl:value-of select="substring-before(concat($pText, $sep), $sep)"/>
5643
+ </xsl:otherwise>
5644
+ </xsl:choose>
5089
5645
  </item>
5090
5646
  <xsl:call-template name="split">
5091
5647
  <xsl:with-param name="pText" select="substring-after($pText, $sep)"/>
5092
5648
  <xsl:with-param name="sep" select="$sep"/>
5649
+ <xsl:with-param name="normalize-space" select="$normalize-space"/>
5093
5650
  </xsl:call-template>
5094
5651
  </xsl:if>
5095
5652
  </xsl:template><xsl:template name="getDocumentId">
@@ -5112,6 +5669,7 @@
5112
5669
 
5113
5670
 
5114
5671
 
5672
+
5115
5673
  </xsl:variable>
5116
5674
  <xsl:if test="$documentNS != $XSLNS">
5117
5675
  <xsl:message>[WARNING]: Document namespace: '<xsl:value-of select="$documentNS"/>' doesn't equal to xslt namespace '<xsl:value-of select="$XSLNS"/>'</xsl:message>
@@ -5137,4 +5695,40 @@
5137
5695
  </xsl:otherwise>
5138
5696
  </xsl:choose>
5139
5697
  </xsl:attribute>
5698
+ </xsl:template><xsl:template name="add-letter-spacing">
5699
+ <xsl:param name="text"/>
5700
+ <xsl:param name="letter-spacing" select="'0.15'"/>
5701
+ <xsl:if test="string-length($text) &gt; 0">
5702
+ <xsl:variable name="char" select="substring($text, 1, 1)"/>
5703
+ <fo:inline padding-right="{$letter-spacing}mm">
5704
+ <xsl:if test="$char = '®'">
5705
+ <xsl:attribute name="font-size">58%</xsl:attribute>
5706
+ <xsl:attribute name="baseline-shift">30%</xsl:attribute>
5707
+ </xsl:if>
5708
+ <xsl:value-of select="$char"/>
5709
+ </fo:inline>
5710
+ <xsl:call-template name="add-letter-spacing">
5711
+ <xsl:with-param name="text" select="substring($text, 2)"/>
5712
+ <xsl:with-param name="letter-spacing" select="$letter-spacing"/>
5713
+ </xsl:call-template>
5714
+ </xsl:if>
5715
+ </xsl:template><xsl:template name="repeat">
5716
+ <xsl:param name="char" select="'*'"/>
5717
+ <xsl:param name="count"/>
5718
+ <xsl:if test="$count &gt; 0">
5719
+ <xsl:value-of select="$char"/>
5720
+ <xsl:call-template name="repeat">
5721
+ <xsl:with-param name="char" select="$char"/>
5722
+ <xsl:with-param name="count" select="$count - 1"/>
5723
+ </xsl:call-template>
5724
+ </xsl:if>
5725
+ </xsl:template><xsl:template name="getLocalizedString">
5726
+ <xsl:param name="key"/>
5727
+
5728
+ <xsl:variable name="curr_lang">
5729
+ <xsl:call-template name="getLang"/>
5730
+ </xsl:variable>
5731
+
5732
+ <xsl:value-of select="/*/*[local-name() = 'localized-strings']/*[local-name() = 'localized-string'][@key = $key and @language = $curr_lang]"/>
5733
+
5140
5734
  </xsl:template></xsl:stylesheet>