metanorma-bipm 1.0.3 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -3,7 +3,7 @@
3
3
  </div>
4
4
 
5
5
  <div class="document-type-band" id="{{ doctype | downcase | replace: ' ', '-' }}-band">
6
- <p class="document-type">BIPM {{ doctype_display }}</p>
6
+ <p class="document-type">{{org_abbrev}} {{ doctype_display }}</p>
7
7
  </div>
8
8
 
9
9
 
@@ -35,6 +35,8 @@
35
35
  {% if partid_alt %}<span class="title-second">{{ partid_alt}}: {{ partsubtitle }}</span>{% endif %}
36
36
  {% if subparttitle %}<span class="title-first">{{ subparttitle }}</span><br/>{% endif %}
37
37
  {% if subpartsubtitle %}<span class="title-second">{{ subpartsubtitle }}</span><br/>{% endif %}
38
+ {% if provenancetitle %}<span class="title-first">{{ provenancetitle }}</span><br/>{% endif %}
39
+ {% if provenancesubtitle %}<span class="title-second">{{ provenancesubtitle }}</span><br/>{% endif %}
38
40
  {% if appendixid %}<span class="title-first">{{ appendixid}}: {{ appendixtitle }}</span><br/>{% endif %}
39
41
  {% if appendixid_alt %}<span class="title-second">{{ appendixid_alt}}: {{ appendixsubtitle }}</span>{% endif %}
40
42
  {% if annexid %}<span class="title-first">{{ annexid}}: {{ annextitle }}</span><br/>{% endif %}
@@ -82,7 +84,7 @@
82
84
 
83
85
  <div class="WordSection11">
84
86
  <div class="coverpage-stage-block" >
85
- <span class="coverpage-stage" id="{{ doctype | replace: ' ', '-' | downcase }}">BIPM {{ doctype_display }}</span>
87
+ <span class="coverpage-stage" id="{{ doctype | replace: ' ', '-' | downcase }}">{{org_abbrev}} {{ doctype_display }}</span>
86
88
  </div>
87
89
 
88
90
  <div class="coverpage-stage-block" >
@@ -116,6 +116,13 @@ a.FootnoteRef + a.FootnoteRef:before {
116
116
  content: ", ";
117
117
  vertical-align: super; }
118
118
 
119
+ .addition {
120
+ color: blue; }
121
+
122
+ .deletion {
123
+ color: red;
124
+ text-decoration: line-through; }
125
+
119
126
  #brochure-band {
120
127
  background-color: #0AC442; }
121
128
 
@@ -4,7 +4,16 @@ see: see
4
4
  see_also: see also
5
5
  clause: Chapter
6
6
  subclause: Section
7
+ clause_jcgm: Clause
8
+ subclause_jcgm: Clause
7
9
  formula: Equation
8
10
  inequality: Inequality
9
11
  bibliography: References
10
12
  index: Index
13
+ norm_with_refs_pref:
14
+ The following referenced documents are indispensable for the application of this document.
15
+ For dated references, only the edition cited applies.
16
+ For undated references, the latest edition of the referenced
17
+ document (including any amendments) applies.
18
+ all_rights_reserved: All rights reserved
19
+ table_of_contents: Contents
@@ -4,6 +4,8 @@ see: voir
4
4
  see_also: voir aussi
5
5
  clause: chapître
6
6
  subclause: section
7
+ clause_jcgm: Article
8
+ subclause_jcgm: Article
7
9
  formula: équation
8
10
  inequality: inégalité
9
11
  bibliography: Références
@@ -34,3 +36,7 @@ stage_dict:
34
36
  draft-development: projet-de-développement
35
37
  in-force: en-vigeur
36
38
  retired: retiré
39
+ norm_with_refs_pref:
40
+ Les documents suivants cités dans le texte sont indispensables pour l'application de ce document. Pour les références datées, seule l’édition citée s’applique. Pour les références non datées, la dernière édition du document de référence s’applique (y compris les éventuels amendements).
41
+ all_rights_reserved: Tous droits réservés
42
+ table_of_contents: Table des matières
@@ -9,8 +9,12 @@ module IsoDoc
9
9
  end
10
10
 
11
11
  def index(docxml)
12
- return unless docxml.at(ns("//index"))
13
- i = docxml.root.add_child "<clause type='index' #{add_id}><title>#{@i18n.index}</title></clause>"
12
+ unless docxml.at(ns("//index"))
13
+ docxml.xpath(ns("//indexsect")).each { |i| i.remove }
14
+ return
15
+ end
16
+ i = docxml.at(ns("//indexsect")) ||
17
+ docxml.root.add_child("<indexsect #{add_id}><title>#{@i18n.index}</title></indexsect>").first
14
18
  index = sort_indexterms(docxml.xpath(ns("//index")), docxml.xpath(ns("//index-xref[@also = 'false']")),
15
19
  docxml.xpath(ns("//index-xref[@also = 'true']")))
16
20
  index1(docxml, i, index)
@@ -18,13 +22,14 @@ module IsoDoc
18
22
 
19
23
  def index1(docxml, i, index)
20
24
  index.keys.sort.each do |k|
21
- c = i.first.add_child "<clause #{add_id}><title>#{k}</title><ul></ul></clause>"
25
+ c = i.add_child "<clause #{add_id}><title>#{k}</title><ul></ul></clause>"
22
26
  words = index[k].keys.each_with_object({}) { |w, v| v[sortable(w).downcase] = w }
23
27
  words.keys.localize(@lang.to_sym).sort.to_a.each do |w|
24
28
  c.first.at(ns("./ul")).add_child index_entries(words, index[k], w)
25
29
  end
26
30
  end
27
- @xrefs.bookmark_anchor_names(docxml.xpath(ns(@xrefs.sections_xpath)))
31
+ docxml.xpath(ns("//indexsect//xref")).each { |x| x.children.remove }
32
+ @xrefs.bookmark_anchor_names(docxml)
28
33
  end
29
34
 
30
35
  def sortable(s)
@@ -4,11 +4,11 @@
4
4
 
5
5
  <xsl:param name="svg_images"/>
6
6
  <xsl:variable name="images" select="document($svg_images)"/>
7
+ <xsl:param name="basepath"/>
7
8
 
8
9
  <!-- <item id="#">N_page</item> -->
9
10
  <!-- param for second pass -->
10
11
  <xsl:param name="external_index"/><!-- path to index xml, generated on 1st pass, based on FOP Intermediate Format -->
11
- <xsl:variable name="index" select="document($external_index)"/>
12
12
 
13
13
 
14
14
 
@@ -16,7 +16,18 @@
16
16
 
17
17
 
18
18
 
19
- <xsl:variable name="align_cross_elements_">clause note title terms term termsource</xsl:variable>
19
+ <xsl:variable name="align_cross_elements_default">clause</xsl:variable>
20
+ <xsl:variable name="align_cross_elements_doc" select="normalize-space((//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:ext/jcgm:parallel-align-element)"/>
21
+ <xsl:variable name="align_cross_elements_">
22
+ <xsl:choose>
23
+ <xsl:when test="$align_cross_elements_doc != ''">
24
+ <xsl:value-of select="$align_cross_elements_doc"/>
25
+ </xsl:when>
26
+ <xsl:otherwise>
27
+ <xsl:value-of select="$align_cross_elements_default"/>
28
+ </xsl:otherwise>
29
+ </xsl:choose>
30
+ </xsl:variable>
20
31
  <xsl:variable name="align_cross_elements">
21
32
  <xsl:text>#</xsl:text><xsl:value-of select="translate(normalize-space($align_cross_elements_), ' ', '#')"/><xsl:text>#</xsl:text>
22
33
  </xsl:variable>
@@ -34,20 +45,35 @@
34
45
  <xsl:copy-of select="$doc_first_step2"/>
35
46
  </xsl:if>
36
47
  </xsl:variable>
37
- <xsl:variable name="doc_second">
48
+ <xsl:variable name="docs_slave">
38
49
  <xsl:if test="*[local-name()='metanorma-collection']">
39
- <xsl:variable name="doc_first_step1">
40
- <xsl:apply-templates select="(/*[local-name()='metanorma-collection']//*[contains(local-name(), '-standard')])[2]" mode="flatxml_step1">
41
- <xsl:with-param name="num" select="'second'"/>
42
- </xsl:apply-templates>
43
- </xsl:variable>
44
- <xsl:variable name="doc_first_step2">
45
- <xsl:apply-templates select="xalan:nodeset($doc_first_step1)" mode="flatxml_step2"/>
46
- </xsl:variable>
47
- <xsl:copy-of select="$doc_first_step2"/>
50
+ <xsl:for-each select="(/*[local-name()='metanorma-collection']//*[contains(local-name(), '-standard')])[position() &gt; 1]">
51
+ <xsl:variable name="doc_first_step1">
52
+ <xsl:apply-templates select="." mode="flatxml_step1">
53
+ <xsl:with-param name="num" select="'slave'"/>
54
+ </xsl:apply-templates>
55
+ </xsl:variable>
56
+ <xsl:variable name="doc_first_step2">
57
+ <xsl:apply-templates select="xalan:nodeset($doc_first_step1)" mode="flatxml_step2"/>
58
+ </xsl:variable>
59
+ <xsl:copy-of select="$doc_first_step2"/>
60
+ </xsl:for-each>
48
61
  </xsl:if>
49
62
  </xsl:variable>
50
-
63
+
64
+ <xsl:variable name="page_width">172</xsl:variable>
65
+ <xsl:variable name="column_gap">8</xsl:variable>
66
+ <xsl:variable name="docs_count">
67
+ <xsl:choose>
68
+ <xsl:when test="/*[local-name()='metanorma-collection']">
69
+ <xsl:value-of select="count(/*[local-name()='metanorma-collection']//*[contains(local-name(), '-standard')])"/>
70
+ </xsl:when>
71
+ <xsl:otherwise>1</xsl:otherwise>
72
+ </xsl:choose>
73
+ </xsl:variable>
74
+ <!-- (page_width - column_gap)/n_columns = column_width -->
75
+ <!-- example: for two-column layout: 82mm 8mm 82mm -->
76
+ <xsl:variable name="column_width" select="($page_width - $column_gap) div $docs_count"/>
51
77
 
52
78
  <xsl:variable name="debug">false</xsl:variable>
53
79
  <xsl:variable name="pageWidth" select="'210mm'"/>
@@ -82,7 +108,8 @@
82
108
  <xsl:call-template name="processPrefaceSectionsDefault_Contents"/>
83
109
  <xsl:call-template name="processMainSectionsDefault_Contents"/>
84
110
  <!-- Index -->
85
- <xsl:apply-templates select="//jcgm:clause[@type = 'index']" mode="contents"/>
111
+ <!-- <xsl:apply-templates select="//jcgm:clause[@type = 'index']" mode="contents"/> -->
112
+ <xsl:apply-templates select="//jcgm:indexsect" mode="contents"/>
86
113
  </contents>
87
114
  </doc>
88
115
  </xsl:for-each>
@@ -105,7 +132,8 @@
105
132
 
106
133
  <!-- add id to xref and split xref with @to into two xref -->
107
134
  <xsl:variable name="current_document_index_id">
108
- <xsl:apply-templates select=".//jcgm:clause[@type = 'index']" mode="index_add_id"/>
135
+ <!-- <xsl:apply-templates select=".//jcgm:clause[@type = 'index']" mode="index_add_id"/> -->
136
+ <xsl:apply-templates select=".//jcgm:indexsect" mode="index_add_id"/>
109
137
  </xsl:variable>
110
138
 
111
139
  <xsl:variable name="current_document_index">
@@ -123,8 +151,6 @@
123
151
  </xsl:for-each>
124
152
 
125
153
  </xsl:variable>
126
-
127
- <xsl:variable name="dash" select="'–'"/>
128
154
 
129
155
 
130
156
  <xsl:variable name="lang">
@@ -173,7 +199,9 @@
173
199
  </fo:page-sequence-master>
174
200
  </fo:layout-master-set>
175
201
 
176
- <xsl:call-template name="addPDFUAmeta"/>
202
+ <fo:declarations>
203
+ <xsl:call-template name="addPDFUAmeta"/>
204
+ </fo:declarations>
177
205
 
178
206
  <xsl:call-template name="addBookmarks">
179
207
  <xsl:with-param name="contents" select="$contents"/>
@@ -186,7 +214,7 @@
186
214
  <xsl:call-template name="printEdition"/>
187
215
  <xsl:text>  </xsl:text>
188
216
  <xsl:call-template name="convertDate">
189
- <xsl:with-param name="date" select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:version/jcgm:revision-date"/>
217
+ <xsl:with-param name="date" select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:date[@type = 'published']/jcgm:on"/>
190
218
  </xsl:call-template>
191
219
  </fo:block>
192
220
  <!-- Example © JCGM 2009 -->
@@ -200,13 +228,16 @@
200
228
  <fo:flow flow-name="xsl-region-body">
201
229
  <xsl:call-template name="insert_Logo-BIPM-Metro"/>
202
230
  <fo:block-container font-weight="bold">
203
- <fo:block font-size="16.5pt" space-after="24.5mm">
231
+ <fo:block font-size="16.5pt">
204
232
  <xsl:value-of select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:ext/jcgm:editorialgroup/jcgm:committee/@acronym"/>
205
233
  <xsl:text> </xsl:text>
206
234
  <xsl:value-of select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:docnumber"/>
207
235
  <fo:inline font-weight="normal">:</fo:inline>
208
236
  <xsl:value-of select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:copyright/jcgm:from"/>
209
237
  </fo:block>
238
+ <fo:block font-size="13pt" font-weight="normal" space-after="19.5mm">
239
+ <xsl:value-of select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@type = 'provenance']"/>
240
+ </fo:block>
210
241
  <fo:block border-bottom="1pt solid black"> </fo:block>
211
242
  <fo:block font-size="16.5pt" margin-left="-0.5mm" padding-top="3.5mm" space-after="7mm" margin-right="7mm" line-height="105%">
212
243
  <xsl:apply-templates select="(//jcgm:bipm-standard)[1]/jcgm:bibdata/jcgm:title[@language = $lang and @type = 'main']" mode="title"/>
@@ -444,32 +475,32 @@
444
475
  </xsl:variable> -->
445
476
 
446
477
  <!-- doc_first=<xsl:copy-of select="$doc_first"/>
447
- doc_second=<xsl:copy-of select="$doc_second"/> -->
478
+ docs_slave=<xsl:copy-of select="$docs_slave"/> -->
448
479
 
449
- <!-- <xsl:apply-templates select="xalan:nodeset($doc_first)/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="two_columns"/> -->
450
- <xsl:apply-templates select="xalan:nodeset($doc_first)/*/*[local-name()='sections']/*[local-name()='section_scope']/*" mode="two_columns"/>
480
+ <!-- <xsl:apply-templates select="xalan:nodeset($doc_first)/*/*[local-name()='sections']/*[local-name()='clause'][@type='scope']" mode="multi_columns"/> -->
481
+ <xsl:apply-templates select="xalan:nodeset($doc_first)/*/*[local-name()='sections']/*[local-name()='section_scope']/*" mode="multi_columns"/>
451
482
 
452
483
  <!-- Normative references -->
453
- <xsl:apply-templates select="xalan:nodeset($doc_first)/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="two_columns"/>
484
+ <xsl:apply-templates select="xalan:nodeset($doc_first)/*/*[local-name()='bibliography']/*[local-name()='references'][@normative='true']" mode="multi_columns"/>
454
485
  <!-- Terms and definitions -->
455
- <xsl:apply-templates select="xalan:nodeset($doc_first)/*/*[local-name()='sections']/*[local-name()='section_terms']/*" mode="two_columns"/>
486
+ <xsl:apply-templates select="xalan:nodeset($doc_first)/*/*[local-name()='sections']/*[local-name()='section_terms']/*" mode="multi_columns"/>
456
487
 
457
488
  <!-- <xsl:apply-templates select="xalan:nodeset($doc_first)/*/*[local-name()='sections']/*[local-name()='terms'] |
458
489
  xalan:nodeset($doc_first)/*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='terms']] |
459
490
  xalan:nodeset($doc_first)/*/*[local-name()='sections']/*[local-name()='definitions'] |
460
- xalan:nodeset($doc_first)/*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]" mode="two_columns"/> -->
491
+ xalan:nodeset($doc_first)/*/*[local-name()='sections']/*[local-name()='clause'][.//*[local-name()='definitions']]" mode="multi_columns"/> -->
461
492
 
462
493
  <!-- Another main sections -->
463
494
  <!-- <xsl:apply-templates select="xalan:nodeset($doc_first)/*/*[local-name()='sections']/*[local-name() != 'terms' and
464
495
  local-name() != 'definitions' and
465
496
  not(@type='scope') and
466
497
  not(local-name() = 'clause' and .//*[local-name()='terms']) and
467
- not(local-name() = 'clause' and .//*[local-name()='definitions'])]" mode="two_columns"/> -->
468
- <xsl:apply-templates select="xalan:nodeset($doc_first)/*/*[local-name()='sections']/*[local-name() != 'section_terms' and local-name() != 'section_scope']" mode="two_columns"/>
498
+ not(local-name() = 'clause' and .//*[local-name()='definitions'])]" mode="multi_columns"/> -->
499
+ <xsl:apply-templates select="xalan:nodeset($doc_first)/*/*[local-name()='sections']/*[local-name() != 'section_terms' and local-name() != 'section_scope']" mode="multi_columns"/>
469
500
 
470
- <xsl:apply-templates select="xalan:nodeset($doc_first)/*/*[local-name()='annex']" mode="two_columns"/>
501
+ <xsl:apply-templates select="xalan:nodeset($doc_first)/*/*[local-name()='annex']" mode="multi_columns"/>
471
502
  <!-- Bibliography -->
472
- <xsl:apply-templates select="xalan:nodeset($doc_first)/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="two_columns"/>
503
+ <xsl:apply-templates select="xalan:nodeset($doc_first)/*/*[local-name()='bibliography']/*[local-name()='references'][not(@normative='true')]" mode="multi_columns"/>
473
504
 
474
505
 
475
506
  </xsl:otherwise>
@@ -484,7 +515,8 @@
484
515
 
485
516
  <!-- indexes=<xsl:copy-of select="$indexes"/> -->
486
517
  <!-- Index -->
487
- <xsl:apply-templates select="xalan:nodeset($indexes)/doc//jcgm:clause[@type = 'index']" mode="index"/>
518
+ <!-- <xsl:apply-templates select="xalan:nodeset($indexes)/doc//jcgm:clause[@type = 'index']" mode="index" /> -->
519
+ <xsl:apply-templates select="xalan:nodeset($indexes)/doc//jcgm:indexsect" mode="index"/>
488
520
 
489
521
  </fo:root>
490
522
  </xsl:template>
@@ -517,6 +549,7 @@
517
549
  <xsl:variable name="type">
518
550
  <xsl:choose>
519
551
  <xsl:when test="@type = 'index'">index</xsl:when>
552
+ <xsl:when test="local-name() = 'indexsect'">index</xsl:when>
520
553
  <xsl:otherwise><xsl:value-of select="local-name()"/></xsl:otherwise>
521
554
  </xsl:choose>
522
555
  </xsl:variable>
@@ -568,7 +601,7 @@
568
601
 
569
602
  <xsl:template name="getListItemFormat">
570
603
  <xsl:choose>
571
- <xsl:when test="local-name(..) = 'ul' and ../ancestor::bipm:ul">−</xsl:when> <!-- &#x2212; - minus sign. &#x2014; - dash -->
604
+ <xsl:when test="local-name(..) = 'ul' and ../ancestor::jcgm:ul">−</xsl:when> <!-- &#x2212; - minus sign. &#x2014; - dash -->
572
605
  <xsl:when test="local-name(..) = 'ul'">—</xsl:when> <!-- &#x2014; dash -->
573
606
  <xsl:otherwise> <!-- for ordered lists -->
574
607
  <xsl:variable name="start_value">
@@ -638,7 +671,7 @@
638
671
  </xsl:choose>
639
672
  </xsl:attribute>
640
673
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
641
- <xsl:if test="ancestor::*[@first or @second]">
674
+ <xsl:if test="ancestor::*[@first or @slave]">
642
675
  <!-- JCGM two column layout -->
643
676
  <xsl:attribute name="widows">1</xsl:attribute>
644
677
  <xsl:attribute name="orphans">1</xsl:attribute>
@@ -729,21 +762,30 @@
729
762
  </xsl:if>
730
763
  </xsl:variable>
731
764
  <xsl:value-of select="$docidentifier"/>
732
- <xsl:apply-templates select="*[local-name()='note']"/>
733
- <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
734
- <fo:inline font-style="italic">
735
- <xsl:choose>
736
- <xsl:when test="*[local-name()='title'][@type = 'main' and @language = $lang]">
737
- <xsl:value-of select="*[local-name()='title'][@type = 'main' and @language = $lang]"/>
738
- </xsl:when>
739
- <xsl:when test="*[local-name()='title'][@type = 'main' and @language = 'en']">
740
- <xsl:value-of select="*[local-name()='title'][@type = 'main' and @language = 'en']"/>
741
- </xsl:when>
742
- <xsl:otherwise>
743
- <xsl:value-of select="*[local-name()='title']"/>
744
- </xsl:otherwise>
745
- </xsl:choose>
746
- </fo:inline>
765
+
766
+ <xsl:choose>
767
+ <xsl:when test="*[local-name()='formattedref']">
768
+ <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
769
+ <xsl:apply-templates select="*[local-name()='formattedref']"/>
770
+ </xsl:when>
771
+ <xsl:otherwise>
772
+ <xsl:apply-templates select="*[local-name()='note']"/>
773
+ <xsl:if test="normalize-space($docidentifier) != ''">, </xsl:if>
774
+ <fo:inline font-style="italic">
775
+ <xsl:choose>
776
+ <xsl:when test="*[local-name()='title'][@type = 'main' and @language = $lang]">
777
+ <xsl:value-of select="*[local-name()='title'][@type = 'main' and @language = $lang]"/>
778
+ </xsl:when>
779
+ <xsl:when test="*[local-name()='title'][@type = 'main' and @language = 'en']">
780
+ <xsl:value-of select="*[local-name()='title'][@type = 'main' and @language = 'en']"/>
781
+ </xsl:when>
782
+ <xsl:otherwise>
783
+ <xsl:value-of select="*[local-name()='title']"/>
784
+ </xsl:otherwise>
785
+ </xsl:choose>
786
+ </fo:inline>
787
+ </xsl:otherwise>
788
+ </xsl:choose>
747
789
  </fo:block>
748
790
  </xsl:template>
749
791
 
@@ -769,6 +811,42 @@
769
811
  </fo:footnote>
770
812
  </xsl:template>
771
813
 
814
+
815
+ <!--
816
+ <fn reference="1">
817
+ <p id="_8e5cf917-f75a-4a49-b0aa-1714cb6cf954">Formerly denoted as 15 % (m/m).</p>
818
+ </fn>
819
+ -->
820
+ <xsl:template match="jcgm:title//jcgm:fn | jcgm:name//jcgm:fn | jcgm:p/jcgm:fn[not(ancestor::jcgm:table)] | jcgm:p/*/jcgm:fn[not(ancestor::jcgm:table)] | jcgm:sourcecode/jcgm:fn[not(ancestor::jcgm:table)]" priority="2" name="fn">
821
+ <fo:footnote keep-with-previous.within-line="always">
822
+ <xsl:variable name="number">
823
+ <xsl:number count="jcgm:fn[not(ancestor::jcgm:table)]" level="any"/>
824
+ </xsl:variable>
825
+ <xsl:variable name="gen_id" select="generate-id()"/>
826
+ <xsl:variable name="lang" select="ancestor::jcgm:bipm-standard/*[local-name()='bibdata']//*[local-name()='language'][@current = 'true']"/>
827
+ <fo:inline font-size="65%" keep-with-previous.within-line="always" vertical-align="super">
828
+ <fo:basic-link internal-destination="{$lang}_footnote_{@reference}_{$number}_{$gen_id}" fox:alt-text="footnote {@reference}">
829
+ <xsl:value-of select="$number"/>
830
+ </fo:basic-link>
831
+ </fo:inline>
832
+ <fo:footnote-body>
833
+ <fo:block font-size="9pt" margin-bottom="12pt" font-weight="normal" text-indent="0" start-indent="0" line-height="124%" text-align="justify">
834
+ <fo:inline id="{$lang}_footnote_{@reference}_{$number}_{$gen_id}" keep-with-next.within-line="always" font-size="60%" vertical-align="super" padding-right="1mm"> <!-- baseline-shift="30%" padding-right="3mm" font-size="60%" alignment-baseline="hanging" -->
835
+ <xsl:value-of select="$number "/>
836
+ </fo:inline>
837
+ <xsl:for-each select="jcgm:p">
838
+ <xsl:apply-templates/>
839
+ </xsl:for-each>
840
+ </fo:block>
841
+ </fo:footnote-body>
842
+ </fo:footnote>
843
+ </xsl:template>
844
+
845
+ <xsl:template match="jcgm:fn/jcgm:p">
846
+ <fo:block>
847
+ <xsl:apply-templates/>
848
+ </fo:block>
849
+ </xsl:template>
772
850
 
773
851
 
774
852
  <xsl:template match="*[local-name()='ul'] | *[local-name()='ol']" mode="ul_ol">
@@ -944,13 +1022,97 @@
944
1022
  <xsl:apply-templates select="." mode="mathml"/>
945
1023
  </xsl:variable>
946
1024
  <fo:instream-foreign-object fox:alt-text="Math">
1025
+ <xsl:if test="local-name(../..) = 'formula'">
1026
+ <xsl:attribute name="width">95%</xsl:attribute>
1027
+ <xsl:attribute name="content-height">100%</xsl:attribute>
1028
+ <xsl:attribute name="content-width">scale-down-to-fit</xsl:attribute>
1029
+ <xsl:attribute name="scaling">uniform</xsl:attribute>
1030
+ </xsl:if>
947
1031
  <!-- <xsl:copy-of select="."/> -->
948
1032
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
949
1033
  </fo:instream-foreign-object>
950
1034
  </fo:inline>
951
1035
  </xsl:template>
952
1036
 
1037
+ <!-- for chemical expressions, when prefix superscripted -->
1038
+ <xsl:template match="mathml:msup[count(*) = 2 and count(mathml:mrow) = 2]/mathml:mrow[1][count(*) = 1 and mathml:mtext and (mathml:mtext/text() = '' or not(mathml:mtext/text()))]/mathml:mtext" mode="mathml" priority="2">
1039
+ <mathml:mspace height="1ex"/>
1040
+ </xsl:template>
1041
+ <xsl:template match="mathml:msup[count(*) = 2 and count(mathml:mrow) = 2]/mathml:mrow[1][count(*) = 1 and mathml:mtext and (mathml:mtext/text() = ' ' or mathml:mtext/text() = ' ')]/mathml:mtext" mode="mathml" priority="2">
1042
+ <mathml:mspace width="1ex" height="1ex"/>
1043
+ </xsl:template>
1044
+
1045
+ <!-- set height for sup -->
1046
+ <!-- <xsl:template match="mathml:msup[count(*) = 2 and count(mathml:mrow) = 2]/mathml:mrow[1][count(*) = 1 and mathml:mtext and (mathml:mtext/text() != '' and mathml:mtext/text() != ' ' and mathml:mtext/text() != '&#xa0;')]/mathml:mtext" mode="mtext"> -->
1047
+ <xsl:template match="mathml:msup[count(*) = 2 and count(mathml:mrow) = 2]/mathml:mrow[1][count(*) = 1]/*" mode="mathml" priority="2">
1048
+ <xsl:copy>
1049
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
1050
+ </xsl:copy>
1051
+ <!-- <xsl:copy-of select="."/> -->
1052
+ <mathml:mspace height="1.47ex"/>
1053
+ </xsl:template>
1054
+
1055
+ <!-- set script minimal font-size -->
1056
+ <xsl:template match="mathml:math" mode="mathml" priority="2">
1057
+ <xsl:copy>
1058
+ <xsl:apply-templates select="@*" mode="mathml"/>
1059
+ <mathml:mstyle scriptminsize="6pt">
1060
+ <xsl:apply-templates select="node()" mode="mathml"/>
1061
+ </mathml:mstyle>
1062
+ </xsl:copy>
1063
+ </xsl:template>
1064
+
1065
+ <!-- issue 'over bar above equation with sub' fixing -->
1066
+ <xsl:template match="mathml:msub/mathml:mrow[1][mathml:mover and count(following-sibling::*) = 1 and following-sibling::mathml:mrow]" mode="mathml" priority="2">
1067
+ <mathml:mstyle>
1068
+ <xsl:copy-of select="."/>
1069
+ </mathml:mstyle>
1070
+ </xsl:template>
1071
+
1072
+ <!-- Decrease space between ()
1073
+ from:
1074
+ <mfenced open="(" close=")">
1075
+ <mrow>
1076
+ <mtext>Cu</mtext>
1077
+ </mrow>
1078
+ </mfenced>
1079
+ to:
1080
+ <mrow>
1081
+ <mtext>(Cu)</mtext>
1082
+ </mrow> -->
1083
+ <xsl:template match="mathml:mfenced[count(*) = 1 and *[count(*) = 1] and */*[count(*) = 0]] | mathml:mfenced[count(*) = 1 and *[count(*) = 1] and */*[count(*) = 1] and */*/*[count(*) = 0]]" mode="mathml" priority="2">
1084
+ <xsl:apply-templates mode="mathml"/>
1085
+ </xsl:template>
1086
+
1087
+ <xsl:template match="mathml:mfenced[count(*) = 1]/*[count(*) = 1]/*[count(*) = 0] | mathml:mfenced[count(*) = 1]/*[count(*) = 1]/*[count(*) = 1]/*[count(*) = 0]" mode="mathml" priority="2"> <!-- [not(following-sibling::*) and not(preceding-sibling::*)] -->
1088
+ <xsl:copy>
1089
+ <xsl:apply-templates select="@*" mode="mathml"/>
1090
+ <xsl:value-of select="ancestor::mathml:mfenced/@open"/>
1091
+ <xsl:value-of select="."/>
1092
+ <xsl:value-of select="ancestor::mathml:mfenced/@close"/>
1093
+ </xsl:copy>
1094
+ </xsl:template>
953
1095
 
1096
+ <!-- Decrease height of / and | -->
1097
+ <xsl:template match="mathml:mo[normalize-space(text()) = '/' or normalize-space(text()) = '|']" mode="mathml" priority="2">
1098
+ <xsl:copy>
1099
+ <xsl:apply-templates select="@*" mode="mathml"/>
1100
+ <xsl:if test="not(@stretchy)">
1101
+ <xsl:attribute name="stretchy">false</xsl:attribute>
1102
+ </xsl:if>
1103
+ <xsl:apply-templates mode="mathml"/>
1104
+ </xsl:copy>
1105
+ </xsl:template>
1106
+
1107
+ <xsl:template match="mathml:mi[string-length(normalize-space()) &gt; 1]" mode="mathml" priority="2">
1108
+ <xsl:if test="preceding-sibling::* and preceding-sibling::*[1][not(local-name() = 'mfenced' or local-name() = 'mo')]">
1109
+ <mathml:mspace width="0.3em"/>
1110
+ </xsl:if>
1111
+ <xsl:copy-of select="."/>
1112
+ <xsl:if test="following-sibling::* and following-sibling::*[1][not(local-name() = 'mfenced' or local-name() = 'mo')]">
1113
+ <mathml:mspace width="0.3em"/>
1114
+ </xsl:if>
1115
+ </xsl:template>
954
1116
 
955
1117
  <xsl:template match="*[local-name()='admonition']">
956
1118
  <fo:block margin-bottom="12pt" font-weight="bold"> <!-- text-align="center" -->
@@ -966,6 +1128,17 @@
966
1128
  </xsl:template>
967
1129
 
968
1130
 
1131
+ <xsl:template match="*[local-name()='td' or local-name()='th']/*[local-name()='formula']/*[local-name()='stem']" priority="2">
1132
+ <fo:block>
1133
+ <xsl:if test="ancestor::*[local-name()='td' or local-name()='th'][1][@align]">
1134
+ <xsl:attribute name="text-align">
1135
+ <xsl:value-of select="ancestor::*[local-name()='td' or local-name()='th'][1]/@align"/>
1136
+ </xsl:attribute>
1137
+ </xsl:if>
1138
+ <xsl:apply-templates/>
1139
+ </fo:block>
1140
+ </xsl:template>
1141
+
969
1142
  <xsl:template match="*[local-name()='formula']/*[local-name()='stem']">
970
1143
  <fo:block margin-top="6pt" margin-bottom="12pt">
971
1144
  <fo:table table-layout="fixed" width="100%">
@@ -1113,6 +1286,7 @@
1113
1286
  <!-- skip 0 section without subsections -->
1114
1287
  <xsl:when test="@level = 2"><xsl:value-of select="$margin-left * 1.6"/>mm</xsl:when>
1115
1288
  <xsl:when test="@level &gt;= 3"><xsl:value-of select="$margin-left * 1.8"/>mm</xsl:when>
1289
+ <xsl:when test="@level = 1 and @type = 'annex' and @section != ''"><xsl:value-of select="$margin-left + string-length(@section) * 1.7"/>mm</xsl:when>
1116
1290
  <xsl:when test="@section != ''"><xsl:value-of select="$margin-left"/>mm</xsl:when>
1117
1291
  <xsl:otherwise>0mm</xsl:otherwise>
1118
1292
  </xsl:choose>
@@ -1203,6 +1377,7 @@
1203
1377
  <xsl:variable name="font-size">
1204
1378
  <xsl:choose>
1205
1379
  <xsl:when test="ancestor::jcgm:preface">15pt</xsl:when>
1380
+ <xsl:when test="parent::jcgm:annex">15pt</xsl:when>
1206
1381
  <xsl:when test="../@inline-header = 'true' or @inline-header = 'true'">10.5pt</xsl:when>
1207
1382
  <xsl:when test="$level = 2">11.5pt</xsl:when>
1208
1383
  <xsl:when test="$level &gt;= 3">10.5pt</xsl:when>
@@ -1234,6 +1409,8 @@
1234
1409
  <xsl:attribute name="space-after">
1235
1410
  <xsl:choose>
1236
1411
  <xsl:when test="ancestor::jcgm:preface">12pt</xsl:when>
1412
+ <xsl:when test="parent::jcgm:annex">30pt</xsl:when>
1413
+ <xsl:when test="following-sibling::*[1][local-name() = 'admitted']">0pt</xsl:when>
1237
1414
  <!-- <xsl:otherwise>12pt</xsl:otherwise> -->
1238
1415
  <xsl:otherwise>12pt</xsl:otherwise>
1239
1416
  </xsl:choose>
@@ -1247,6 +1424,10 @@
1247
1424
  </xsl:choose>
1248
1425
  </xsl:attribute>
1249
1426
  </xsl:if>
1427
+ <xsl:if test="parent::jcgm:annex">
1428
+ <xsl:attribute name="text-align">center</xsl:attribute>
1429
+ <xsl:attribute name="line-height">130%</xsl:attribute>
1430
+ </xsl:if>
1250
1431
  <xsl:apply-templates/>
1251
1432
  </xsl:element>
1252
1433
 
@@ -1263,41 +1444,43 @@
1263
1444
  <xsl:param name="font-size" select="'65%'"/>
1264
1445
  <xsl:param name="baseline-shift" select="'30%'"/>
1265
1446
  <xsl:param name="curr_lang" select="'fr'"/>
1266
- <fo:inline>
1267
- <xsl:variable name="title-edition">
1268
- <xsl:call-template name="getTitle">
1269
- <xsl:with-param name="name" select="'title-edition'"/>
1270
- <xsl:with-param name="lang" select="$curr_lang"/>
1271
- </xsl:call-template>
1272
- </xsl:variable>
1273
- <xsl:value-of select="."/>
1274
- <fo:inline font-size="{$font-size}" baseline-shift="{$baseline-shift}">
1275
- <xsl:if test="$curr_lang = 'en'">
1276
- <xsl:attribute name="baseline-shift">0%</xsl:attribute>
1277
- <xsl:attribute name="font-size">100%</xsl:attribute>
1278
- </xsl:if>
1279
- <xsl:choose>
1280
- <xsl:when test="$curr_lang = 'fr'">
1281
- <xsl:choose>
1282
- <xsl:when test=". = '1'">re</xsl:when>
1283
- <xsl:otherwise>e</xsl:otherwise>
1284
- </xsl:choose>
1285
- </xsl:when>
1286
- <xsl:otherwise>
1287
- <xsl:choose>
1288
- <xsl:when test=". = '1'">st</xsl:when>
1289
- <xsl:when test=". = '2'">nd</xsl:when>
1290
- <xsl:when test=". = '3'">rd</xsl:when>
1291
- <xsl:otherwise>th</xsl:otherwise>
1292
- </xsl:choose>
1293
- </xsl:otherwise>
1294
- </xsl:choose>
1295
-
1447
+ <xsl:if test="normalize-space (.) != '1'">
1448
+ <fo:inline>
1449
+ <xsl:variable name="title-edition">
1450
+ <xsl:call-template name="getTitle">
1451
+ <xsl:with-param name="name" select="'title-edition'"/>
1452
+ <xsl:with-param name="lang" select="$curr_lang"/>
1453
+ </xsl:call-template>
1454
+ </xsl:variable>
1455
+ <xsl:value-of select="."/>
1456
+ <fo:inline font-size="{$font-size}" baseline-shift="{$baseline-shift}">
1457
+ <xsl:if test="$curr_lang = 'en'">
1458
+ <xsl:attribute name="baseline-shift">0%</xsl:attribute>
1459
+ <xsl:attribute name="font-size">100%</xsl:attribute>
1460
+ </xsl:if>
1461
+ <xsl:choose>
1462
+ <xsl:when test="$curr_lang = 'fr'">
1463
+ <xsl:choose>
1464
+ <xsl:when test=". = '1'">re</xsl:when>
1465
+ <xsl:otherwise>e</xsl:otherwise>
1466
+ </xsl:choose>
1467
+ </xsl:when>
1468
+ <xsl:otherwise>
1469
+ <xsl:choose>
1470
+ <xsl:when test=". = '1'">st</xsl:when>
1471
+ <xsl:when test=". = '2'">nd</xsl:when>
1472
+ <xsl:when test=". = '3'">rd</xsl:when>
1473
+ <xsl:otherwise>th</xsl:otherwise>
1474
+ </xsl:choose>
1475
+ </xsl:otherwise>
1476
+ </xsl:choose>
1477
+
1478
+ </fo:inline>
1479
+ <xsl:text> </xsl:text>
1480
+ <xsl:value-of select="java:toLowerCase(java:java.lang.String.new($title-edition))"/>
1481
+ <xsl:text/>
1296
1482
  </fo:inline>
1297
- <xsl:text> </xsl:text>
1298
- <xsl:value-of select="java:toLowerCase(java:java.lang.String.new($title-edition))"/>
1299
- <xsl:text/>
1300
- </fo:inline>
1483
+ </xsl:if>
1301
1484
  </xsl:template>
1302
1485
 
1303
1486
 
@@ -1305,177 +1488,58 @@
1305
1488
  <!-- Index processing -->
1306
1489
  <!-- =================== -->
1307
1490
 
1308
- <xsl:template match="@*|node()" mode="index_add_id">
1309
- <xsl:copy>
1310
- <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
1311
- </xsl:copy>
1312
- </xsl:template>
1491
+ <!-- <xsl:template match="jcgm:clause[@type = 'index']" />
1492
+ <xsl:template match="jcgm:clause[@type = 'index']" mode="index"> -->
1493
+ <xsl:template match="jcgm:indexsect"/>
1494
+ <xsl:template match="jcgm:indexsect" mode="index">
1313
1495
 
1314
- <xsl:template match="jcgm:xref" mode="index_add_id">
1315
- <xsl:variable name="id">
1316
- <xsl:call-template name="generateIndexXrefId"/>
1317
- </xsl:variable>
1318
- <xsl:copy> <!-- add id to xref -->
1319
- <xsl:apply-templates select="@*" mode="index_add_id"/>
1320
- <xsl:attribute name="id">
1321
- <xsl:value-of select="$id"/>
1322
- </xsl:attribute>
1323
- <xsl:apply-templates mode="index_add_id"/>
1324
- </xsl:copy>
1325
- <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
1326
- <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
1327
- <xsl:if test="@to">
1328
- <xsl:value-of select="$dash"/>
1329
- <xsl:copy>
1330
- <xsl:copy-of select="@*"/>
1331
- <xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
1332
- <xsl:attribute name="id">
1333
- <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
1334
- </xsl:attribute>
1335
- <xsl:apply-templates mode="index_add_id"/>
1336
- </xsl:copy>
1337
- </xsl:if>
1338
- </xsl:template>
1339
-
1340
- <xsl:template match="@*|node()" mode="index_update">
1341
- <xsl:copy>
1342
- <xsl:apply-templates select="@*|node()" mode="index_update"/>
1343
- </xsl:copy>
1344
- </xsl:template>
1345
-
1346
- <xsl:template match="jcgm:clause[@type = 'index']//jcgm:li" mode="index_update">
1347
- <xsl:copy>
1348
- <xsl:apply-templates select="@*" mode="index_update"/>
1349
- <xsl:apply-templates select="node()[1]" mode="process_li_element"/>
1350
- </xsl:copy>
1351
- </xsl:template>
1352
-
1353
- <xsl:template match="jcgm:clause[@type = 'index']//jcgm:li/node()" mode="process_li_element" priority="2">
1354
- <xsl:param name="element"/>
1355
- <xsl:param name="remove" select="'false'"/>
1356
- <!-- <node></node> -->
1357
- <xsl:choose>
1358
- <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
1359
- <!-- skip text (i.e. remove it) and process next element -->
1360
- <!-- [removed_<xsl:value-of select="."/>] -->
1361
- <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
1362
- </xsl:when>
1363
- <xsl:when test="self::text()">
1364
- <xsl:value-of select="."/>
1365
- <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
1366
- </xsl:when>
1367
- <xsl:when test="self::* and local-name(.) = 'xref'">
1368
- <xsl:variable name="id" select="@id"/>
1369
- <xsl:variable name="page" select="$index//item[@id = $id]"/>
1370
- <xsl:variable name="id_next" select="following-sibling::jcgm:xref[1]/@id"/>
1371
- <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
1372
-
1373
- <xsl:variable name="id_prev" select="preceding-sibling::jcgm:xref[1]/@id"/>
1374
- <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
1375
-
1496
+ <fo:page-sequence master-reference="document-jcgm" force-page-count="no-force">
1497
+ <xsl:variable name="header-title">
1376
1498
  <xsl:choose>
1377
- <!-- 2nd pass -->
1378
- <!-- if page is equal to page for next and page is not the end of range -->
1379
- <xsl:when test="$page != '' and $page_next != '' and $page = $page_next and not(contains($page, '_to'))"> <!-- case: 12, 12-14 -->
1380
- <!-- skip element (i.e. remove it) and remove next text ',' -->
1381
- <!-- [removed_xref] -->
1382
-
1383
- <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
1384
- <xsl:with-param name="remove">true</xsl:with-param>
1385
- </xsl:apply-templates>
1499
+ <xsl:when test="./jcgm:title[1]/*[local-name() = 'tab']">
1500
+ <xsl:apply-templates select="./jcgm:title[1]/*[local-name() = 'tab'][1]/following-sibling::node()" mode="header"/>
1386
1501
  </xsl:when>
1387
-
1388
- <xsl:when test="$page != '' and $page_prev != '' and $page = $page_prev and contains($page_prev, '_to')"> <!-- case: 12-14, 14, ... -->
1389
- <!-- remove xref -->
1390
- <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
1391
- <xsl:with-param name="remove">true</xsl:with-param>
1392
- </xsl:apply-templates>
1393
- </xsl:when>
1394
-
1395
1502
  <xsl:otherwise>
1396
- <xsl:copy-of select="."/>
1397
- <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
1503
+ <xsl:apply-templates select="./jcgm:title[1]" mode="header"/>
1398
1504
  </xsl:otherwise>
1399
1505
  </xsl:choose>
1400
- </xsl:when>
1401
- <xsl:when test="self::* and local-name(.) = 'ul'">
1402
- <!-- ul -->
1403
- <xsl:apply-templates select="." mode="index_update"/>
1404
- </xsl:when>
1405
- <xsl:otherwise>
1406
- <xsl:copy-of select="."/>
1407
- <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
1408
- </xsl:otherwise>
1409
- </xsl:choose>
1410
- </xsl:template>
1411
-
1412
-
1413
- <xsl:template name="generateIndexXrefId">
1414
- <xsl:variable name="level" select="count(ancestor::jcgm:ul)"/>
1415
- <!-- <xsl:variable name="parent_ul_id" select="generate-id(ancestor::jcgm:ul[1])"/>
1416
- <xsl:variable name="item_number" select="count(ancestor::jcgm:li[ancestor::jcgm:ul[generate-id() = $parent_ul_id]])"/> -->
1417
- <xsl:variable name="docid">
1418
- <xsl:call-template name="getDocumentId"/>
1419
- </xsl:variable>
1420
- <xsl:variable name="item_number">
1421
- <xsl:number count="jcgm:li[ancestor::jcgm:clause[@type = 'index']]" level="any"/>
1422
- </xsl:variable>
1423
- <xsl:variable name="xref_number"><xsl:number count="jcgm:xref"/></xsl:variable>
1424
- <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
1425
- </xsl:template>
1426
-
1427
- <xsl:template match="jcgm:clause[@type = 'index']"/>
1428
- <xsl:template match="jcgm:clause[@type = 'index']" mode="index">
1429
-
1430
- <fo:page-sequence master-reference="document-jcgm" force-page-count="no-force">
1506
+ </xsl:variable>
1431
1507
 
1432
1508
  <xsl:call-template name="insertHeaderFooter"/>
1433
1509
 
1434
1510
  <fo:flow flow-name="xsl-region-body">
1435
- <fo:block id="{@id}">
1436
- <xsl:apply-templates/>
1511
+ <fo:block id="{@id}" span="all">
1512
+ <xsl:apply-templates select="jcgm:title"/>
1513
+ </fo:block>
1514
+ <fo:block>
1515
+ <xsl:apply-templates select="*[not(local-name() = 'title')]"/>
1437
1516
  </fo:block>
1438
1517
  </fo:flow>
1439
1518
  </fo:page-sequence>
1440
1519
  </xsl:template>
1441
1520
 
1442
- <xsl:template match="jcgm:clause[@type = 'index']/jcgm:title" priority="4">
1521
+ <!-- <xsl:template match="jcgm:clause[@type = 'index']/jcgm:title" priority="4"> -->
1522
+ <xsl:template match="jcgm:indexsect/jcgm:title" priority="4">
1443
1523
  <fo:block font-weight="bold" span="all">
1444
1524
  <!-- Index -->
1445
1525
  <xsl:apply-templates/>
1446
1526
  </fo:block>
1447
1527
  </xsl:template>
1448
1528
 
1449
- <xsl:template match="jcgm:clause[@type = 'index']/jcgm:clause" priority="4">
1450
- <xsl:apply-templates/>
1451
- <fo:block>
1452
- <xsl:if test="following-sibling::jcgm:clause">
1453
- <fo:block> </fo:block>
1454
- </xsl:if>
1455
- </fo:block>
1456
- </xsl:template>
1457
-
1458
- <xsl:template match="jcgm:clause[@type = 'index']/jcgm:clause/jcgm:title" priority="4">
1529
+
1530
+ <!-- <xsl:template match="jcgm:clause[@type = 'index']/jcgm:clause/jcgm:title" priority="4"> -->
1531
+ <xsl:template match="jcgm:indexsect/jcgm:clause/jcgm:title" priority="4">
1459
1532
  <!-- Letter A, B, C, ... -->
1460
1533
  <fo:block font-weight="bold" margin-left="25mm" keep-with-next="always">
1461
1534
  <xsl:apply-templates/>
1462
1535
  </fo:block>
1463
1536
  </xsl:template>
1464
1537
 
1465
- <xsl:template match="jcgm:clause[@type = 'index']//jcgm:ul" priority="4">
1538
+ <!-- <xsl:template match="jcgm:clause[@type = 'index']//jcgm:ul" priority="4"> -->
1539
+ <xsl:template match="jcgm:indexsect//jcgm:ul" priority="4">
1466
1540
  <xsl:apply-templates/>
1467
1541
  </xsl:template>
1468
-
1469
- <xsl:template match="jcgm:clause[@type = 'index']//jcgm:li" priority="4">
1470
- <xsl:variable name="level" select="count(ancestor::jcgm:ul)"/>
1471
- <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
1472
- <xsl:apply-templates/>
1473
- </fo:block>
1474
- </xsl:template>
1475
-
1476
- <xsl:template match="jcgm:bookmark">
1477
- <fo:inline id="{@id}"/>
1478
- </xsl:template>
1542
+
1479
1543
 
1480
1544
  <!-- =================== -->
1481
1545
  <!-- End of Index processing -->
@@ -1504,16 +1568,18 @@
1504
1568
  <!-- Two columns layout -->
1505
1569
  <!-- =================== -->
1506
1570
 
1507
- <!-- <xsl:template match="*[@first]/*[local-name()='sections']//*[not(@cross-align) or not(@cross-align='true')]" mode="two_columns"/> -->
1571
+ <!-- <xsl:template match="*[@first]/*[local-name()='sections']//*[not(@cross-align) or not(@cross-align='true')]" mode="multi_columns"/> -->
1508
1572
 
1509
- <xsl:template match="*[@first]/*[local-name()='sections']//*[local-name() = 'cross-align'] | *[@first]/*[local-name()='annex']//*[local-name() = 'cross-align']" mode="two_columns">
1573
+ <xsl:template match="*[@first]/*[local-name()='sections']//*[local-name() = 'cross-align'] | *[@first]/*[local-name()='annex']//*[local-name() = 'cross-align']" mode="multi_columns">
1510
1574
  <xsl:variable name="element-number" select="@element-number"/>
1511
1575
  <fo:block>
1512
1576
  <xsl:copy-of select="@keep-with-next"/>
1513
1577
  <fo:table table-layout="fixed" width="100%">
1514
- <fo:table-column column-width="82mm"/>
1515
- <fo:table-column column-width="8mm"/>
1516
- <fo:table-column column-width="82mm"/>
1578
+ <fo:table-column column-width="{$column_width}mm"/>
1579
+ <xsl:for-each select="xalan:nodeset($docs_slave)/*">
1580
+ <fo:table-column column-width="{$column_gap}mm"/>
1581
+ <fo:table-column column-width="{$column_width}mm"/>
1582
+ </xsl:for-each>
1517
1583
  <fo:table-body>
1518
1584
  <fo:table-row>
1519
1585
  <fo:table-cell>
@@ -1524,17 +1590,22 @@
1524
1590
  </fo:block>
1525
1591
  <fo:block font-size="1pt"/>
1526
1592
  </fo:table-cell>
1527
- <fo:table-cell>
1528
- <fo:block/>
1529
- </fo:table-cell>
1530
- <fo:table-cell>
1531
- <fo:block font-size="1pt" keep-with-next="always"/>
1532
- <fo:block>
1533
- <xsl:copy-of select="@keep-with-next"/>
1534
- <xsl:apply-templates select="xalan:nodeset($doc_second)//*[local-name() = 'cross-align' and @element-number=$element-number]"/>
1535
- </fo:block>
1536
- <fo:block font-size="1pt"/>
1537
- </fo:table-cell>
1593
+ <xsl:variable name="keep-with-next" select="@keep-with-next"/>
1594
+ <xsl:for-each select="xalan:nodeset($docs_slave)/*">
1595
+ <fo:table-cell>
1596
+ <fo:block/>
1597
+ </fo:table-cell>
1598
+ <fo:table-cell>
1599
+ <fo:block font-size="1pt" keep-with-next="always"/>
1600
+ <fo:block>
1601
+ <xsl:if test="$keep-with-next != ''">
1602
+ <xsl:attribute name="keep-with-next"><xsl:value-of select="$keep-with-next"/></xsl:attribute>
1603
+ </xsl:if>
1604
+ <xsl:apply-templates select=".//*[local-name() = 'cross-align' and @element-number=$element-number]"/>
1605
+ </fo:block>
1606
+ <fo:block font-size="1pt"/>
1607
+ </fo:table-cell>
1608
+ </xsl:for-each>
1538
1609
  </fo:table-row>
1539
1610
  </fo:table-body>
1540
1611
  </fo:table>
@@ -1545,37 +1616,41 @@
1545
1616
  <xsl:apply-templates/>
1546
1617
  </xsl:template>
1547
1618
 
1548
- <!-- no display table/figure from second document if common=true or span=true -->
1549
- <xsl:template match="*[@second]//*[local-name()='table'][@common = 'true']" priority="2"/>
1550
- <xsl:template match="*[@second]//*[local-name()='table'][@span = 'true']" priority="2"/>
1551
- <xsl:template match="*[@second]//*[local-name()='figure'][@common = 'true']" priority="2"/>
1552
- <xsl:template match="*[@second]//*[local-name()='figure'][@span = 'true']" priority="2"/>
1619
+ <!-- no display table/figure from slave documents if @multilingual-rendering="common" or @multilingual-rendering = 'all-columns' -->
1620
+ <xsl:template match="*[@slave]//*[local-name()='table'][@multilingual-rendering= 'common']" priority="2"/>
1621
+ <xsl:template match="*[@slave]//*[local-name()='table'][@multilingual-rendering = 'all-columns']" priority="2"/>
1622
+ <xsl:template match="*[@slave]//*[local-name()='figure'][@multilingual-rendering = 'common']" priority="2"/>
1623
+ <xsl:template match="*[@slave]//*[local-name()='figure'][@multilingual-rendering = 'all-columns']" priority="2"/>
1553
1624
 
1554
- <!-- for table and figure with @common='true' -->
1625
+ <!-- for table and figure with @multilingual-rendering="common" -->
1555
1626
  <!-- display only element from first document -->
1556
- <xsl:template match="*[@first]//*[local-name() = 'cross-align'][@common = 'true']" mode="two_columns">
1627
+ <xsl:template match="*[@first]//*[local-name() = 'cross-align'][@multilingual-rendering = 'common']" mode="multi_columns">
1557
1628
  <fo:block>
1558
1629
  <xsl:apply-templates/>
1559
1630
  </fo:block>
1560
1631
  </xsl:template>
1561
1632
 
1562
- <!-- for table and figure with @span='true' -->
1563
- <!-- display element from first document, then (after) from second one -->
1564
- <xsl:template match="*[@first]//*[local-name() = 'cross-align'][@span = 'true']" mode="two_columns">
1633
+ <!-- for table and figure with @multilingual-rendering = 'all-columns' -->
1634
+ <!-- display element from first document, then (after) from 2nd one, then 3rd, etc. -->
1635
+ <xsl:template match="*[@first]//*[local-name() = 'cross-align'][@multilingual-rendering = 'all-columns']" mode="multi_columns">
1565
1636
  <xsl:variable name="element-number" select="@element-number"/>
1566
1637
  <fo:block>
1567
1638
  <xsl:apply-templates/>
1568
1639
  <fo:block> </fo:block>
1569
1640
  <xsl:choose>
1570
- <xsl:when test="local-name(*[@span = 'true']) = 'table'">
1571
- <xsl:for-each select="xalan:nodeset($doc_second)//*[local-name() = 'table' and @element-number=$element-number]">
1641
+ <xsl:when test="local-name(*[@multilingual-rendering = 'all-columns']) = 'table'">
1642
+ <xsl:for-each select="xalan:nodeset($docs_slave)/*">
1643
+ <xsl:for-each select=".//*[local-name() = 'table' and @element-number=$element-number]">
1572
1644
  <xsl:call-template name="table"/>
1573
1645
  </xsl:for-each>
1646
+ </xsl:for-each>
1574
1647
  </xsl:when>
1575
- <xsl:when test="local-name(*[@span = 'true']) = 'figure'">
1576
- <xsl:for-each select="xalan:nodeset($doc_second)//*[local-name() = 'figure' and @element-number=$element-number]">
1648
+ <xsl:when test="local-name(*[@multilingual-rendering = 'all-columns']) = 'figure'">
1649
+ <xsl:for-each select="xalan:nodeset($docs_slave)/*">
1650
+ <xsl:for-each select=".//*[local-name() = 'figure' and @element-number=$element-number]">
1577
1651
  <xsl:call-template name="figure"/>
1578
1652
  </xsl:for-each>
1653
+ </xsl:for-each>
1579
1654
  </xsl:when>
1580
1655
  </xsl:choose>
1581
1656
  </fo:block>
@@ -1583,19 +1658,26 @@
1583
1658
 
1584
1659
  <!-- =========== -->
1585
1660
  <!-- References -->
1586
- <xsl:template match="*[@first]//*[local-name()='references'][@normative='true']" mode="two_columns">
1587
- <fo:block font-size="1pt" keep-with-next="always"><fo:inline id="{@id}"/> <fo:inline id="{xalan:nodeset($doc_second)//*[local-name()='references'][@normative='true']/@id}"/></fo:block>
1588
- <xsl:apply-templates mode="two_columns"/>
1661
+ <xsl:template match="*[@first]//*[local-name()='references'][@normative='true']" mode="multi_columns">
1662
+ <fo:block font-size="1pt" keep-with-next="always">
1663
+ <fo:inline id="{@id}"/>
1664
+ <xsl:for-each select="xalan:nodeset($docs_slave)/*">
1665
+ <fo:inline id="{.//*[local-name()='references'][@normative='true']/@id}"/>
1666
+ </xsl:for-each>
1667
+ </fo:block>
1668
+ <xsl:apply-templates mode="multi_columns"/>
1589
1669
  </xsl:template>
1590
1670
 
1591
- <xsl:template match="*[@first]//*[local-name()='references'][@normative='true']/*" mode="two_columns">
1671
+ <xsl:template match="*[@first]//*[local-name()='references'][@normative='true']/*" mode="multi_columns">
1592
1672
  <xsl:variable name="number_"><xsl:number count="*"/></xsl:variable>
1593
1673
  <xsl:variable name="number" select="number(normalize-space($number_))"/>
1594
1674
  <fo:block>
1595
1675
  <fo:table table-layout="fixed" width="100%">
1596
- <fo:table-column column-width="82mm"/>
1597
- <fo:table-column column-width="8mm"/>
1598
- <fo:table-column column-width="82mm"/>
1676
+ <fo:table-column column-width="{$column_width}mm"/>
1677
+ <xsl:for-each select="xalan:nodeset($docs_slave)/*">
1678
+ <fo:table-column column-width="{$column_gap}mm"/>
1679
+ <fo:table-column column-width="{$column_width}mm"/>
1680
+ </xsl:for-each>
1599
1681
  <fo:table-body>
1600
1682
  <fo:table-row>
1601
1683
  <fo:table-cell>
@@ -1603,51 +1685,63 @@
1603
1685
  <xsl:apply-templates select="."/>
1604
1686
  <fo:block font-size="1pt"/>
1605
1687
  </fo:table-cell>
1606
- <fo:table-cell>
1607
- <fo:block/>
1608
- </fo:table-cell>
1609
- <fo:table-cell>
1610
- <fo:block>
1611
- <fo:block font-size="1pt"/>
1612
- <xsl:apply-templates select="(xalan:nodeset($doc_second)//*[local-name()='references'][@normative='true']/*)[$number]"/>
1613
- <fo:block font-size="1pt"/>
1614
- </fo:block>
1615
- </fo:table-cell>
1688
+
1689
+ <xsl:for-each select="xalan:nodeset($docs_slave)/*">
1690
+ <fo:table-cell>
1691
+ <fo:block/>
1692
+ </fo:table-cell>
1693
+ <fo:table-cell>
1694
+ <fo:block>
1695
+ <fo:block font-size="1pt"/>
1696
+ <xsl:apply-templates select="(.//*[local-name()='references'][@normative='true']/*)[$number]"/>
1697
+ <fo:block font-size="1pt"/>
1698
+ </fo:block>
1699
+ </fo:table-cell>
1700
+ </xsl:for-each>
1616
1701
  </fo:table-row>
1617
1702
  </fo:table-body>
1618
1703
  </fo:table>
1619
1704
  </fo:block>
1620
1705
  </xsl:template>
1621
1706
 
1622
- <xsl:template match="*[@first]//*[local-name()='references'][not(@normative='true')]" mode="two_columns">
1707
+ <xsl:template match="*[@first]//*[local-name()='references'][not(@normative='true')]" mode="multi_columns">
1623
1708
  <fo:block break-after="page"/>
1624
- <fo:block font-size="1pt"><fo:inline id="{@id}"/><fo:inline id="{xalan:nodeset($doc_second)//*[local-name()='references'][not(@normative='true')]/@id}"/></fo:block>
1625
- <xsl:apply-templates mode="two_columns"/>
1709
+ <fo:block font-size="1pt"><fo:inline id="{@id}"/>
1710
+ <xsl:for-each select="xalan:nodeset($docs_slave)/*">
1711
+ <fo:inline id="{.//*[local-name()='references'][not(@normative='true')]/@id}"/>
1712
+ </xsl:for-each>
1713
+ </fo:block>
1714
+ <xsl:apply-templates mode="multi_columns"/>
1626
1715
  </xsl:template>
1627
1716
 
1628
- <xsl:template match="*[@first]//*[local-name()='references'][not(@normative='true')]/*" mode="two_columns">
1717
+ <xsl:template match="*[@first]//*[local-name()='references'][not(@normative='true')]/*" mode="multi_columns">
1629
1718
  <xsl:variable name="number_"><xsl:number count="*"/></xsl:variable>
1630
1719
  <xsl:variable name="number" select="number(normalize-space($number_))"/>
1631
1720
  <fo:block>
1632
1721
  <fo:table table-layout="fixed" width="100%">
1633
- <fo:table-column column-width="82mm"/>
1634
- <fo:table-column column-width="8mm"/>
1635
- <fo:table-column column-width="82mm"/>
1722
+ <fo:table-column column-width="{$column_width}mm"/>
1723
+ <xsl:for-each select="xalan:nodeset($docs_slave)/*">
1724
+ <fo:table-column column-width="{$column_gap}mm"/>
1725
+ <fo:table-column column-width="{$column_width}mm"/>
1726
+ </xsl:for-each>
1636
1727
  <fo:table-body>
1637
1728
  <fo:table-row>
1638
1729
  <fo:table-cell>
1639
1730
  <xsl:apply-templates select="."/>
1640
1731
  <fo:block font-size="1pt"/>
1641
1732
  </fo:table-cell>
1642
- <fo:table-cell>
1643
- <fo:block/>
1644
- </fo:table-cell>
1645
- <fo:table-cell>
1646
- <fo:block>
1647
- <xsl:apply-templates select="(xalan:nodeset($doc_second)//*[local-name()='references'][not(@normative='true')]/*)[$number]"/>
1648
- <fo:block font-size="1pt"/>
1649
- </fo:block>
1650
- </fo:table-cell>
1733
+
1734
+ <xsl:for-each select="xalan:nodeset($docs_slave)/*">
1735
+ <fo:table-cell>
1736
+ <fo:block/>
1737
+ </fo:table-cell>
1738
+ <fo:table-cell>
1739
+ <fo:block>
1740
+ <xsl:apply-templates select="(.//*[local-name()='references'][not(@normative='true')]/*)[$number]"/>
1741
+ <fo:block font-size="1pt"/>
1742
+ </fo:block>
1743
+ </fo:table-cell>
1744
+ </xsl:for-each>
1651
1745
  </fo:table-row>
1652
1746
  </fo:table-body>
1653
1747
  </fo:table>
@@ -1655,12 +1749,16 @@
1655
1749
  </xsl:template>
1656
1750
  <!-- End of References -->
1657
1751
 
1658
- <xsl:template match="*[@first]//*[local-name()='annex']" mode="two_columns">
1752
+ <xsl:template match="*[@first]//*[local-name()='annex']" mode="multi_columns">
1659
1753
  <xsl:variable name="number_"><xsl:number/></xsl:variable>
1660
1754
  <xsl:variable name="number" select="number(normalize-space($number_))"/>
1661
1755
  <fo:block break-after="page"/>
1662
- <fo:block font-size="1pt"><fo:inline id="{@id}"/><fo:inline id="{(xalan:nodeset($doc_second)//*[local-name()='annex'])[$number]/@id}"/></fo:block>
1663
- <xsl:apply-templates mode="two_columns"/>
1756
+ <fo:block font-size="1pt"><fo:inline id="{@id}"/>
1757
+ <xsl:for-each select="xalan:nodeset($docs_slave)/*">
1758
+ <fo:inline id="{(.//*[local-name()='annex'])[$number]/@id}"/>
1759
+ </xsl:for-each>
1760
+ </fo:block>
1761
+ <xsl:apply-templates mode="multi_columns"/>
1664
1762
  </xsl:template>
1665
1763
 
1666
1764
  <!-- =================== -->
@@ -1865,7 +1963,7 @@
1865
1963
  Elements that should be aligned:
1866
1964
  - name of element presents in field align-cross-elements="clause note"
1867
1965
  - marked with attribute name
1868
- - table/figure with attribute common="true" or span="true"
1966
+ - table/figure with attribute @multilingual-rendering = 'common' or @multilingual-rendering = 'all-columns'
1869
1967
  - marked with attribute cross-align
1870
1968
  -->
1871
1969
  <xsl:template name="isCrossAligned">
@@ -1874,10 +1972,10 @@
1874
1972
  <!-- if element`s name is presents in array align_cross_elements -->
1875
1973
  <xsl:when test="contains($align_cross_elements, concat('#',$element_name,'#'))">true</xsl:when>
1876
1974
  <!-- if element has attribute name/bookmark -->
1877
- <xsl:when test="normalize-space(@name) != ''">true</xsl:when>
1878
- <xsl:when test="($element_name = 'table' or $element_name = 'figure') and (@common = 'true' or @span = 'true')">true</xsl:when>
1975
+ <xsl:when test="normalize-space(@name) != '' and @multilingual-rendering = 'name'">true</xsl:when>
1976
+ <xsl:when test="($element_name = 'table' or $element_name = 'figure') and (@multilingual-rendering = 'common' or @multilingual-rendering = 'all-columns')">true</xsl:when>
1879
1977
  <!-- element marked as cross-align -->
1880
- <xsl:when test="@cross-align='true'">true</xsl:when>
1978
+ <xsl:when test="@multilingual-rendering='parallel'">true</xsl:when>
1881
1979
  <xsl:otherwise>false</xsl:otherwise>
1882
1980
  </xsl:choose>
1883
1981
  </xsl:template>
@@ -1887,7 +1985,7 @@
1887
1985
  <xsl:variable name="element-number">
1888
1986
  <xsl:choose>
1889
1987
  <!-- if name set, then use it -->
1890
- <xsl:when test="@name"><xsl:value-of select="@name"/></xsl:when>
1988
+ <xsl:when test="@name and @multilingual-rendering = 'name'"><xsl:value-of select="@name"/></xsl:when>
1891
1989
  <xsl:otherwise>
1892
1990
  <xsl:for-each select="ancestor-or-self::*[ancestor-or-self::*[local-name() = 'sections' or local-name() = 'annex']]">
1893
1991
  <xsl:value-of select="local-name()"/>
@@ -1918,13 +2016,12 @@
1918
2016
  </xsl:copy>
1919
2017
  </xsl:template>
1920
2018
 
1921
- <!-- enclose elements after table/figure with common=true and span=true in a separate element cross-align -->
1922
- <xsl:template match="*[@common='true' or @span='true']" mode="flatxml_step2" priority="2">
2019
+ <!-- enclose elements after table/figure with @multilingual-rendering = 'common' and @multilingual-rendering = 'all-columns' in a separate element cross-align -->
2020
+ <xsl:template match="*[@multilingual-rendering = 'common' or @multilingual-rendering = 'all-columns']" mode="flatxml_step2" priority="2">
1923
2021
  <xsl:variable name="curr_id" select="generate-id()"/>
1924
2022
  <xsl:element name="cross-align" namespace="https://www.metanorma.org/ns/bipm">
1925
2023
  <xsl:copy-of select="@element-number"/>
1926
- <xsl:copy-of select="@common"/>
1927
- <xsl:copy-of select="@span"/>
2024
+ <xsl:copy-of select="@multilingual-rendering"/>
1928
2025
  <xsl:copy-of select="."/>
1929
2026
  </xsl:element>
1930
2027
  <xsl:if test="following-sibling::*[(not(@cross-align) or not(@cross-align='true')) and preceding-sibling::*[@cross-align='true'][1][generate-id() = $curr_id]]">
@@ -1950,8 +2047,7 @@
1950
2047
  <xsl:if test="local-name() = 'title'">
1951
2048
  <xsl:copy-of select="@keep-with-next"/>
1952
2049
  </xsl:if>
1953
- <xsl:copy-of select="@common"/>
1954
- <xsl:copy-of select="@span"/>
2050
+ <xsl:copy-of select="@multilingual-rendering"/>
1955
2051
  <xsl:copy-of select="."/>
1956
2052
 
1957
2053
  <!-- copy next elements until next element with cross-align=true -->
@@ -2259,6 +2355,7 @@
2259
2355
 
2260
2356
 
2261
2357
 
2358
+
2262
2359
  </xsl:attribute-set><xsl:attribute-set name="termexample-name-style">
2263
2360
 
2264
2361
 
@@ -2384,15 +2481,12 @@
2384
2481
  </xsl:attribute-set><xsl:attribute-set name="quote-style">
2385
2482
 
2386
2483
 
2387
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
2388
- <xsl:attribute name="margin-left">12mm</xsl:attribute>
2389
- <xsl:attribute name="margin-right">12mm</xsl:attribute>
2390
-
2391
2484
 
2392
2485
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
2393
2486
  <xsl:attribute name="margin-left">12mm</xsl:attribute>
2394
2487
  <xsl:attribute name="margin-right">12mm</xsl:attribute>
2395
2488
  <xsl:attribute name="font-style">italic</xsl:attribute>
2489
+ <xsl:attribute name="text-align">justify</xsl:attribute>
2396
2490
 
2397
2491
 
2398
2492
 
@@ -2483,7 +2577,9 @@
2483
2577
 
2484
2578
  </xsl:attribute-set><xsl:attribute-set name="admitted-style">
2485
2579
 
2486
-
2580
+
2581
+ <xsl:attribute name="font-weight">bold</xsl:attribute>
2582
+
2487
2583
  </xsl:attribute-set><xsl:attribute-set name="deprecates-style">
2488
2584
 
2489
2585
  </xsl:attribute-set><xsl:attribute-set name="definition-style">
@@ -2491,6 +2587,12 @@
2491
2587
 
2492
2588
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2493
2589
 
2590
+ </xsl:attribute-set><xsl:attribute-set name="add-style">
2591
+ <xsl:attribute name="color">red</xsl:attribute>
2592
+ <xsl:attribute name="text-decoration">underline</xsl:attribute>
2593
+ </xsl:attribute-set><xsl:attribute-set name="del-style">
2594
+ <xsl:attribute name="color">red</xsl:attribute>
2595
+ <xsl:attribute name="text-decoration">line-through</xsl:attribute>
2494
2596
  </xsl:attribute-set><xsl:template name="processPrefaceSectionsDefault_Contents">
2495
2597
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='abstract']" mode="contents"/>
2496
2598
  <xsl:apply-templates select="/*/*[local-name()='preface']/*[local-name()='foreword']" mode="contents"/>
@@ -2536,204 +2638,238 @@
2536
2638
  <xsl:call-template name="add-zero-spaces-java"/>
2537
2639
  </xsl:template><xsl:template match="*[local-name()='table']" name="table">
2538
2640
 
2539
- <xsl:variable name="simple-table">
2540
- <xsl:call-template name="getSimpleTable"/>
2541
- </xsl:variable>
2641
+ <xsl:variable name="table">
2542
2642
 
2543
-
2544
-
2545
-
2546
-
2547
- <!-- <xsl:if test="$namespace = 'bipm'">
2548
- <fo:block>&#xA0;</fo:block>
2549
- </xsl:if> -->
2550
-
2551
- <!-- $namespace = 'iso' or -->
2552
-
2553
-
2643
+ <xsl:variable name="simple-table">
2644
+ <xsl:call-template name="getSimpleTable"/>
2645
+ </xsl:variable>
2554
2646
 
2555
2647
 
2556
-
2557
- <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
2558
-
2559
- <!-- <xsl:variable name="cols-count">
2560
- <xsl:choose>
2561
- <xsl:when test="*[local-name()='thead']">
2562
- <xsl:call-template name="calculate-columns-numbers">
2563
- <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
2564
- </xsl:call-template>
2565
- </xsl:when>
2566
- <xsl:otherwise>
2567
- <xsl:call-template name="calculate-columns-numbers">
2568
- <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
2569
- </xsl:call-template>
2570
- </xsl:otherwise>
2571
- </xsl:choose>
2572
- </xsl:variable> -->
2573
- <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
2574
- <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
2575
-
2576
-
2577
-
2578
- <xsl:variable name="colwidths">
2579
- <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
2580
- <xsl:call-template name="calculate-column-widths">
2581
- <xsl:with-param name="cols-count" select="$cols-count"/>
2582
- <xsl:with-param name="table" select="$simple-table"/>
2583
- </xsl:call-template>
2584
- </xsl:if>
2585
- </xsl:variable>
2586
- <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2587
-
2588
- <!-- <xsl:variable name="colwidths2">
2589
- <xsl:call-template name="calculate-column-widths">
2590
- <xsl:with-param name="cols-count" select="$cols-count"/>
2591
- </xsl:call-template>
2592
- </xsl:variable> -->
2593
-
2594
- <!-- cols-count=<xsl:copy-of select="$cols-count"/>
2595
- colwidthsNew=<xsl:copy-of select="$colwidths"/>
2596
- colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
2597
-
2598
- <xsl:variable name="margin-left">
2599
- <xsl:choose>
2600
- <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
2601
- <xsl:otherwise>0</xsl:otherwise>
2602
- </xsl:choose>
2603
- </xsl:variable>
2604
-
2605
- <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
2606
2648
 
2607
- <xsl:attribute name="font-size">10pt</xsl:attribute>
2608
2649
 
2609
2650
 
2610
-
2611
-
2612
-
2651
+ <!-- <xsl:if test="$namespace = 'bipm'">
2652
+ <fo:block>&#xA0;</fo:block>
2653
+ </xsl:if> -->
2613
2654
 
2655
+ <!-- $namespace = 'iso' or -->
2614
2656
 
2615
-
2657
+
2616
2658
 
2659
+
2617
2660
 
2618
- <xsl:attribute name="margin-top">12pt</xsl:attribute>
2619
- <xsl:attribute name="margin-left">0mm</xsl:attribute>
2620
- <xsl:attribute name="margin-right">0mm</xsl:attribute>
2621
- <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
2661
+ <xsl:variable name="cols-count" select="count(xalan:nodeset($simple-table)//tr[1]/td)"/>
2622
2662
 
2663
+ <!-- <xsl:variable name="cols-count">
2664
+ <xsl:choose>
2665
+ <xsl:when test="*[local-name()='thead']">
2666
+ <xsl:call-template name="calculate-columns-numbers">
2667
+ <xsl:with-param name="table-row" select="*[local-name()='thead']/*[local-name()='tr'][1]"/>
2668
+ </xsl:call-template>
2669
+ </xsl:when>
2670
+ <xsl:otherwise>
2671
+ <xsl:call-template name="calculate-columns-numbers">
2672
+ <xsl:with-param name="table-row" select="*[local-name()='tbody']/*[local-name()='tr'][1]"/>
2673
+ </xsl:call-template>
2674
+ </xsl:otherwise>
2675
+ </xsl:choose>
2676
+ </xsl:variable> -->
2677
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/> -->
2678
+ <!-- cols-count2=<xsl:copy-of select="$cols-count2"/> -->
2623
2679
 
2624
2680
 
2625
2681
 
2682
+ <xsl:variable name="colwidths">
2683
+ <xsl:if test="not(*[local-name()='colgroup']/*[local-name()='col'])">
2684
+ <xsl:call-template name="calculate-column-widths">
2685
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2686
+ <xsl:with-param name="table" select="$simple-table"/>
2687
+ </xsl:call-template>
2688
+ </xsl:if>
2689
+ </xsl:variable>
2690
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
2626
2691
 
2692
+ <!-- <xsl:variable name="colwidths2">
2693
+ <xsl:call-template name="calculate-column-widths">
2694
+ <xsl:with-param name="cols-count" select="$cols-count"/>
2695
+ </xsl:call-template>
2696
+ </xsl:variable> -->
2627
2697
 
2628
- <xsl:variable name="table_attributes">
2629
- <attribute name="table-layout">fixed</attribute>
2630
- <attribute name="width">
2631
- <xsl:choose>
2632
- <xsl:when test="@width"><xsl:value-of select="@width"/></xsl:when>
2633
- <xsl:otherwise>100%</xsl:otherwise>
2634
- </xsl:choose>
2635
- </attribute>
2636
- <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
2637
- <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
2698
+ <!-- cols-count=<xsl:copy-of select="$cols-count"/>
2699
+ colwidthsNew=<xsl:copy-of select="$colwidths"/>
2700
+ colwidthsOld=<xsl:copy-of select="$colwidths2"/>z -->
2701
+
2702
+ <xsl:variable name="margin-left">
2703
+ <xsl:choose>
2704
+ <xsl:when test="sum(xalan:nodeset($colwidths)//column) &gt; 75">15</xsl:when>
2705
+ <xsl:otherwise>0</xsl:otherwise>
2706
+ </xsl:choose>
2707
+ </xsl:variable>
2708
+
2709
+ <fo:block-container margin-left="-{$margin-left}mm" margin-right="-{$margin-left}mm">
2638
2710
 
2639
- <attribute name="border">1.5pt solid black</attribute>
2640
- <xsl:if test="*[local-name()='thead']">
2641
- <attribute name="border-top">1pt solid black</attribute>
2642
- </xsl:if>
2711
+ <xsl:attribute name="font-size">10pt</xsl:attribute>
2643
2712
 
2644
2713
 
2714
+
2715
+
2716
+
2645
2717
 
2646
2718
 
2647
- <attribute name="margin-left">0mm</attribute>
2648
- <attribute name="margin-right">0mm</attribute>
2719
+
2649
2720
 
2650
-
2651
-
2652
-
2653
2721
 
2654
-
2722
+ <xsl:attribute name="margin-top">12pt</xsl:attribute>
2723
+ <xsl:attribute name="margin-left">0mm</xsl:attribute>
2724
+ <xsl:attribute name="margin-right">0mm</xsl:attribute>
2725
+ <xsl:attribute name="margin-bottom">8pt</xsl:attribute>
2655
2726
 
2656
- </xsl:variable>
2657
-
2658
-
2659
- <fo:table id="{@id}" table-omit-footer-at-break="true">
2660
2727
 
2661
- <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
2662
- <xsl:attribute name="{@name}">
2663
- <xsl:value-of select="."/>
2664
- </xsl:attribute>
2728
+
2729
+
2730
+
2731
+ <xsl:variable name="table_width">
2732
+ <!-- for centered table always 100% (@width will be set for middle/second cell of outer table) -->
2733
+ 100%
2734
+
2735
+
2736
+ </xsl:variable>
2737
+
2738
+ <xsl:variable name="table_attributes">
2739
+ <attribute name="table-layout">fixed</attribute>
2740
+ <attribute name="width"><xsl:value-of select="normalize-space($table_width)"/></attribute>
2741
+ <attribute name="margin-left"><xsl:value-of select="$margin-left"/>mm</attribute>
2742
+ <attribute name="margin-right"><xsl:value-of select="$margin-left"/>mm</attribute>
2743
+
2744
+ <attribute name="border">1.5pt solid black</attribute>
2745
+ <xsl:if test="*[local-name()='thead']">
2746
+ <attribute name="border-top">1pt solid black</attribute>
2747
+ </xsl:if>
2748
+
2749
+
2750
+
2751
+
2752
+ <attribute name="margin-left">0mm</attribute>
2753
+ <attribute name="margin-right">0mm</attribute>
2754
+
2755
+
2756
+
2757
+
2758
+
2759
+
2760
+
2761
+ </xsl:variable>
2762
+
2763
+
2764
+ <fo:table id="{@id}" table-omit-footer-at-break="true">
2765
+
2766
+ <xsl:for-each select="xalan:nodeset($table_attributes)/attribute">
2767
+ <xsl:attribute name="{@name}">
2768
+ <xsl:value-of select="."/>
2769
+ </xsl:attribute>
2770
+ </xsl:for-each>
2771
+
2772
+ <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
2773
+ <xsl:if test="$isNoteOrFnExist = 'true'">
2774
+ <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2775
+ </xsl:if>
2776
+
2777
+ <xsl:choose>
2778
+ <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2779
+ <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
2780
+ <fo:table-column column-width="{@width}"/>
2781
+ </xsl:for-each>
2782
+ </xsl:when>
2783
+ <xsl:otherwise>
2784
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2785
+ <xsl:choose>
2786
+ <xsl:when test=". = 1 or . = 0">
2787
+ <fo:table-column column-width="proportional-column-width(2)"/>
2788
+ </xsl:when>
2789
+ <xsl:otherwise>
2790
+ <fo:table-column column-width="proportional-column-width({.})"/>
2791
+ </xsl:otherwise>
2792
+ </xsl:choose>
2793
+ </xsl:for-each>
2794
+ </xsl:otherwise>
2795
+ </xsl:choose>
2796
+
2797
+ <xsl:choose>
2798
+ <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
2799
+ <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2800
+ </xsl:when>
2801
+ <xsl:otherwise>
2802
+ <xsl:apply-templates/>
2803
+ </xsl:otherwise>
2804
+ </xsl:choose>
2805
+
2806
+ </fo:table>
2807
+
2808
+ <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
2809
+ <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
2810
+ <xsl:call-template name="insertTableFooterInSeparateTable">
2811
+ <xsl:with-param name="table_attributes" select="$table_attributes"/>
2812
+ <xsl:with-param name="colwidths" select="$colwidths"/>
2813
+ <xsl:with-param name="colgroup" select="$colgroup"/>
2814
+ </xsl:call-template>
2665
2815
  </xsl:for-each>
2666
2816
 
2667
- <xsl:variable name="isNoteOrFnExist" select="./*[local-name()='note'] or .//*[local-name()='fn'][local-name(..) != 'name']"/>
2668
- <xsl:if test="$isNoteOrFnExist = 'true'">
2669
- <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
2670
- </xsl:if>
2817
+ <!-- insert footer as table -->
2818
+ <!-- <fo:table>
2819
+ <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
2820
+ <xsl:attribute name="{@name}">
2821
+ <xsl:value-of select="."/>
2822
+ </xsl:attribute>
2823
+ </xsl:for-each>
2824
+
2825
+ <xsl:for-each select="xalan:nodeset($colwidths)//column">
2826
+ <xsl:choose>
2827
+ <xsl:when test=". = 1 or . = 0">
2828
+ <fo:table-column column-width="proportional-column-width(2)"/>
2829
+ </xsl:when>
2830
+ <xsl:otherwise>
2831
+ <fo:table-column column-width="proportional-column-width({.})"/>
2832
+ </xsl:otherwise>
2833
+ </xsl:choose>
2834
+ </xsl:for-each>
2835
+ </fo:table>-->
2836
+
2837
+
2838
+
2839
+
2840
+
2841
+ </fo:block-container>
2842
+ </xsl:variable>
2843
+
2844
+
2845
+
2846
+ <xsl:choose>
2847
+ <xsl:when test="@width">
2848
+
2849
+ <!-- centered table when table name is centered (see table-name-style) -->
2850
+
2851
+ <fo:table table-layout="fixed" width="100%">
2852
+ <fo:table-column column-width="proportional-column-width(1)"/>
2853
+ <fo:table-column column-width="{@width}"/>
2854
+ <fo:table-column column-width="proportional-column-width(1)"/>
2855
+ <fo:table-body>
2856
+ <fo:table-row>
2857
+ <fo:table-cell column-number="2">
2858
+ <fo:block><xsl:copy-of select="$table"/></fo:block>
2859
+ </fo:table-cell>
2860
+ </fo:table-row>
2861
+ </fo:table-body>
2862
+ </fo:table>
2671
2863
 
2672
- <xsl:choose>
2673
- <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
2674
- <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
2675
- <fo:table-column column-width="{@width}"/>
2676
- </xsl:for-each>
2677
- </xsl:when>
2678
- <xsl:otherwise>
2679
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
2680
- <xsl:choose>
2681
- <xsl:when test=". = 1 or . = 0">
2682
- <fo:table-column column-width="proportional-column-width(2)"/>
2683
- </xsl:when>
2684
- <xsl:otherwise>
2685
- <fo:table-column column-width="proportional-column-width({.})"/>
2686
- </xsl:otherwise>
2687
- </xsl:choose>
2688
- </xsl:for-each>
2689
- </xsl:otherwise>
2690
- </xsl:choose>
2691
2864
 
2692
- <xsl:choose>
2693
- <xsl:when test="not(*[local-name()='tbody']) and *[local-name()='thead']">
2694
- <xsl:apply-templates select="*[local-name()='thead']" mode="process_tbody"/>
2695
- </xsl:when>
2696
- <xsl:otherwise>
2697
- <xsl:apply-templates/>
2698
- </xsl:otherwise>
2699
- </xsl:choose>
2700
2865
 
2701
- </fo:table>
2702
-
2703
- <xsl:variable name="colgroup" select="*[local-name()='colgroup']"/>
2704
- <xsl:for-each select="*[local-name()='tbody']"><!-- select context to tbody -->
2705
- <xsl:call-template name="insertTableFooterInSeparateTable">
2706
- <xsl:with-param name="table_attributes" select="$table_attributes"/>
2707
- <xsl:with-param name="colwidths" select="$colwidths"/>
2708
- <xsl:with-param name="colgroup" select="$colgroup"/>
2709
- </xsl:call-template>
2710
- </xsl:for-each>
2711
-
2712
- <!-- insert footer as table -->
2713
- <!-- <fo:table>
2714
- <xsl:for-each select="xalan::nodeset($table_attributes)/attribute">
2715
- <xsl:attribute name="{@name}">
2716
- <xsl:value-of select="."/>
2717
- </xsl:attribute>
2718
- </xsl:for-each>
2719
2866
 
2720
- <xsl:for-each select="xalan:nodeset($colwidths)//column">
2721
- <xsl:choose>
2722
- <xsl:when test=". = 1 or . = 0">
2723
- <fo:table-column column-width="proportional-column-width(2)"/>
2724
- </xsl:when>
2725
- <xsl:otherwise>
2726
- <fo:table-column column-width="proportional-column-width({.})"/>
2727
- </xsl:otherwise>
2728
- </xsl:choose>
2729
- </xsl:for-each>
2730
- </fo:table>-->
2731
-
2732
-
2733
-
2734
-
2735
-
2736
- </fo:block-container>
2867
+ </xsl:when>
2868
+ <xsl:otherwise>
2869
+ <xsl:copy-of select="$table"/>
2870
+ </xsl:otherwise>
2871
+ </xsl:choose>
2872
+
2737
2873
  </xsl:template><xsl:template match="*[local-name()='table']/*[local-name() = 'name']"/><xsl:template match="*[local-name()='table']/*[local-name() = 'name']" mode="presentation">
2738
2874
  <xsl:if test="normalize-space() != ''">
2739
2875
  <fo:block xsl:use-attribute-sets="table-name-style">
@@ -2863,7 +2999,15 @@
2863
2999
  </xsl:template><xsl:template match="*[local-name()='link']" mode="td_text">
2864
3000
  <xsl:value-of select="@target"/>
2865
3001
  </xsl:template><xsl:template match="*[local-name()='math']" mode="td_text">
2866
- <xsl:variable name="math_text" select="normalize-space(.)"/>
3002
+ <xsl:variable name="mathml">
3003
+ <xsl:for-each select="*">
3004
+ <xsl:if test="local-name() != 'unit' and local-name() != 'prefix' and local-name() != 'dimension' and local-name() != 'quantity'">
3005
+ <xsl:copy-of select="."/>
3006
+ </xsl:if>
3007
+ </xsl:for-each>
3008
+ </xsl:variable>
3009
+
3010
+ <xsl:variable name="math_text" select="normalize-space(xalan:nodeset($mathml))"/>
2867
3011
  <xsl:value-of select="translate($math_text, ' ', '#')"/><!-- mathml images as one 'word' without spaces -->
2868
3012
  </xsl:template><xsl:template match="*[local-name()='table2']"/><xsl:template match="*[local-name()='thead']"/><xsl:template match="*[local-name()='thead']" mode="process">
2869
3013
  <xsl:param name="cols-count"/>
@@ -3640,7 +3784,7 @@
3640
3784
  <xsl:with-param name="table" select="$html-table"/>
3641
3785
  </xsl:call-template>
3642
3786
  </xsl:variable>
3643
- <!-- colwidths=<xsl:value-of select="$colwidths"/> -->
3787
+ <!-- colwidths=<xsl:copy-of select="$colwidths"/> -->
3644
3788
  <xsl:variable name="maxlength_dt">
3645
3789
  <xsl:call-template name="getMaxLength_dt"/>
3646
3790
  </xsl:variable>
@@ -3669,13 +3813,22 @@
3669
3813
  </xsl:when>
3670
3814
  <xsl:otherwise>
3671
3815
  <xsl:choose>
3816
+ <!-- to set width check most wide chars like `W` -->
3672
3817
  <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 2"> <!-- if dt contains short text like t90, a, etc -->
3673
- <fo:table-column column-width="5%"/>
3674
- <fo:table-column column-width="95%"/>
3818
+ <fo:table-column column-width="7%"/>
3819
+ <fo:table-column column-width="93%"/>
3820
+ </xsl:when>
3821
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like ABC, etc -->
3822
+ <fo:table-column column-width="15%"/>
3823
+ <fo:table-column column-width="85%"/>
3824
+ </xsl:when>
3825
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 7"> <!-- if dt contains short text like ABCDEF, etc -->
3826
+ <fo:table-column column-width="20%"/>
3827
+ <fo:table-column column-width="80%"/>
3675
3828
  </xsl:when>
3676
- <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 5"> <!-- if dt contains short text like t90, a, etc -->
3677
- <fo:table-column column-width="10%"/>
3678
- <fo:table-column column-width="90%"/>
3829
+ <xsl:when test="normalize-space($maxlength_dt) != '' and number($maxlength_dt) &lt;= 10"> <!-- if dt contains short text like ABCDEFEF, etc -->
3830
+ <fo:table-column column-width="25%"/>
3831
+ <fo:table-column column-width="75%"/>
3679
3832
  </xsl:when>
3680
3833
  <!-- <xsl:when test="xalan:nodeset($colwidths)/column[1] div xalan:nodeset($colwidths)/column[2] &gt; 1.7">
3681
3834
  <fo:table-column column-width="60%"/>
@@ -3891,8 +4044,16 @@
3891
4044
  <fo:inline text-decoration="underline">
3892
4045
  <xsl:apply-templates/>
3893
4046
  </fo:inline>
4047
+ </xsl:template><xsl:template match="*[local-name()='add']">
4048
+ <fo:inline xsl:use-attribute-sets="add-style">
4049
+ <xsl:apply-templates/>
4050
+ </fo:inline>
3894
4051
  </xsl:template><xsl:template match="*[local-name()='del']">
3895
- <fo:inline font-size="10pt" color="red" text-decoration="line-through">
4052
+ <fo:inline xsl:use-attribute-sets="del-style">
4053
+ <xsl:apply-templates/>
4054
+ </fo:inline>
4055
+ </xsl:template><xsl:template match="*[local-name()='hi']">
4056
+ <fo:inline background-color="yellow">
3896
4057
  <xsl:apply-templates/>
3897
4058
  </fo:inline>
3898
4059
  </xsl:template><xsl:template match="text()[ancestor::*[local-name()='smallcap']]">
@@ -3984,6 +4145,10 @@
3984
4145
  <xsl:param name="text" select="."/>
3985
4146
  <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
3986
4147
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| )','$1​')"/>
4148
+ </xsl:template><xsl:template name="add-zero-spaces-link-java">
4149
+ <xsl:param name="text" select="."/>
4150
+ <!-- add zero-width space (#x200B) after characters: dash, dot, colon, equal, underscore, em dash, thin space -->
4151
+ <xsl:value-of select="java:replaceAll(java:java.lang.String.new($text),'(-|\.|:|=|_|—| |,)','$1​')"/>
3987
4152
  </xsl:template><xsl:template name="add-zero-spaces">
3988
4153
  <xsl:param name="text" select="."/>
3989
4154
  <xsl:variable name="zero-space-after-chars">-</xsl:variable>
@@ -4231,6 +4396,7 @@
4231
4396
  <xsl:apply-templates select="." mode="mathml"/>
4232
4397
  </xsl:variable>
4233
4398
  <fo:instream-foreign-object fox:alt-text="Math">
4399
+
4234
4400
  <!-- <xsl:copy-of select="."/> -->
4235
4401
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
4236
4402
  </fo:instream-foreign-object>
@@ -4244,7 +4410,12 @@
4244
4410
  <!-- replace start and end spaces to non-break space -->
4245
4411
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
4246
4412
  </xsl:copy>
4247
- </xsl:template><xsl:template match="*[local-name()='localityStack']"/><xsl:template match="*[local-name()='link']" name="link">
4413
+ </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
4414
+ <xsl:copy>
4415
+ <xsl:apply-templates select="@*|node()" mode="mathml"/>
4416
+ </xsl:copy>
4417
+ <mathml:mspace width="0.5ex"/>
4418
+ </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">
4248
4419
  <xsl:variable name="target">
4249
4420
  <xsl:choose>
4250
4421
  <xsl:when test="starts-with(normalize-space(@target), 'mailto:')">
@@ -4265,7 +4436,10 @@
4265
4436
  <fo:basic-link external-destination="{@target}" fox:alt-text="{@target}">
4266
4437
  <xsl:choose>
4267
4438
  <xsl:when test="normalize-space(.) = ''">
4268
- <xsl:value-of select="$target"/>
4439
+ <!-- <xsl:value-of select="$target"/> -->
4440
+ <xsl:call-template name="add-zero-spaces-link-java">
4441
+ <xsl:with-param name="text" select="$target"/>
4442
+ </xsl:call-template>
4269
4443
  </xsl:when>
4270
4444
  <xsl:otherwise>
4271
4445
  <xsl:apply-templates/>
@@ -4275,8 +4449,6 @@
4275
4449
  </xsl:otherwise>
4276
4450
  </xsl:choose>
4277
4451
  </fo:inline>
4278
- </xsl:template><xsl:template match="*[local-name()='bookmark']">
4279
- <fo:inline id="{@id}"/>
4280
4452
  </xsl:template><xsl:template match="*[local-name()='appendix']">
4281
4453
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-style">
4282
4454
  <xsl:apply-templates select="*[local-name()='title']" mode="process"/>
@@ -4485,27 +4657,43 @@
4485
4657
  <fo:block id="{@id}">
4486
4658
  <xsl:apply-templates/>
4487
4659
  </fo:block>
4660
+ <xsl:apply-templates select="*[local-name() = 'name']" mode="presentation"/>
4488
4661
  </xsl:template><xsl:template match="*[local-name() = 'figure'][@class = 'pseudocode']//*[local-name() = 'p']">
4489
4662
  <fo:block xsl:use-attribute-sets="figure-pseudocode-p-style">
4490
4663
  <xsl:apply-templates/>
4491
4664
  </fo:block>
4492
4665
  </xsl:template><xsl:template match="*[local-name() = 'image']">
4493
- <fo:block xsl:use-attribute-sets="image-style">
4494
-
4495
-
4496
- <xsl:variable name="src">
4497
- <xsl:choose>
4498
- <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
4499
- <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
4500
- </xsl:when>
4501
- <xsl:otherwise>
4502
- <xsl:value-of select="@src"/>
4503
- </xsl:otherwise>
4504
- </xsl:choose>
4505
- </xsl:variable>
4506
-
4507
- <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
4508
- </fo:block>
4666
+ <xsl:choose>
4667
+ <xsl:when test="ancestor::*[local-name() = 'title']">
4668
+ <fo:inline padding-left="1mm" padding-right="1mm">
4669
+ <xsl:variable name="src">
4670
+ <xsl:call-template name="image_src"/>
4671
+ </xsl:variable>
4672
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" vertical-align="middle"/>
4673
+ </fo:inline>
4674
+ </xsl:when>
4675
+ <xsl:otherwise>
4676
+ <fo:block xsl:use-attribute-sets="image-style">
4677
+
4678
+ <xsl:variable name="src">
4679
+ <xsl:call-template name="image_src"/>
4680
+ </xsl:variable>
4681
+ <fo:external-graphic src="{$src}" fox:alt-text="Image {@alt}" xsl:use-attribute-sets="image-graphic-style"/>
4682
+ </fo:block>
4683
+ </xsl:otherwise>
4684
+ </xsl:choose>
4685
+ </xsl:template><xsl:template name="image_src">
4686
+ <xsl:choose>
4687
+ <xsl:when test="@mimetype = 'image/svg+xml' and $images/images/image[@id = current()/@id]">
4688
+ <xsl:value-of select="$images/images/image[@id = current()/@id]/@src"/>
4689
+ </xsl:when>
4690
+ <xsl:when test="not(starts-with(@src, 'data:'))">
4691
+ <xsl:value-of select="concat('url(file:',$basepath, @src, ')')"/>
4692
+ </xsl:when>
4693
+ <xsl:otherwise>
4694
+ <xsl:value-of select="@src"/>
4695
+ </xsl:otherwise>
4696
+ </xsl:choose>
4509
4697
  </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">
4510
4698
  <xsl:apply-templates mode="contents"/>
4511
4699
  <xsl:text> </xsl:text>
@@ -4738,6 +4926,8 @@
4738
4926
  <xsl:copy>
4739
4927
  <xsl:apply-templates mode="contents_item"/>
4740
4928
  </xsl:copy>
4929
+ </xsl:template><xsl:template match="*[local-name() = 'stem']" mode="contents_item">
4930
+ <xsl:copy-of select="."/>
4741
4931
  </xsl:template><xsl:template match="*[local-name() = 'br']" mode="contents_item">
4742
4932
  <xsl:text> </xsl:text>
4743
4933
  </xsl:template><xsl:template match="*[local-name()='sourcecode']" name="sourcecode">
@@ -5022,8 +5212,8 @@
5022
5212
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
5023
5213
 
5024
5214
  <xsl:variable name="element">
5025
- block
5026
-
5215
+
5216
+ inline
5027
5217
  <xsl:if test=".//*[local-name() = 'table']">block</xsl:if>
5028
5218
  </xsl:variable>
5029
5219
 
@@ -5066,9 +5256,15 @@
5066
5256
  </xsl:choose>
5067
5257
 
5068
5258
  </xsl:template><xsl:template match="*[local-name() = 'example']/*[local-name() = 'p']">
5069
-
5259
+ <xsl:variable name="num"><xsl:number/></xsl:variable>
5070
5260
  <xsl:variable name="element">
5071
- block
5261
+
5262
+
5263
+ <xsl:choose>
5264
+ <xsl:when test="$num = 1">inline</xsl:when>
5265
+ <xsl:otherwise>block</xsl:otherwise>
5266
+ </xsl:choose>
5267
+
5072
5268
 
5073
5269
  </xsl:variable>
5074
5270
  <xsl:choose>
@@ -5144,11 +5340,23 @@
5144
5340
  </xsl:if>
5145
5341
  </xsl:if>
5146
5342
 
5343
+
5344
+ <xsl:if test="not(*)">
5345
+ <xsl:attribute name="space-after">12pt</xsl:attribute>
5346
+ </xsl:if>
5347
+
5147
5348
  <fo:block-container margin-left="0mm">
5148
5349
 
5149
5350
  <fo:block xsl:use-attribute-sets="quote-style">
5150
5351
  <!-- <xsl:apply-templates select=".//*[local-name() = 'p']"/> -->
5151
- <xsl:apply-templates select="./*[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
5352
+
5353
+ <xsl:if test="ancestor::*[local-name() = 'boilerplate']">
5354
+ <xsl:attribute name="margin-left">7mm</xsl:attribute>
5355
+ <xsl:attribute name="margin-right">7mm</xsl:attribute>
5356
+ <xsl:attribute name="font-style">normal</xsl:attribute>
5357
+ </xsl:if>
5358
+
5359
+ <xsl:apply-templates select="./node()[not(local-name() = 'author') and not(local-name() = 'source')]"/> <!-- process all nested nodes, except author and source -->
5152
5360
  </fo:block>
5153
5361
  <xsl:if test="*[local-name() = 'author'] or *[local-name() = 'source']">
5154
5362
  <fo:block xsl:use-attribute-sets="quote-source-style">
@@ -5171,29 +5379,47 @@
5171
5379
  <xsl:text>— </xsl:text>
5172
5380
  <xsl:apply-templates/>
5173
5381
  </xsl:template><xsl:template match="*[local-name() = 'eref']">
5174
- <fo:inline xsl:use-attribute-sets="eref-style">
5175
- <xsl:if test="@type = 'footnote'">
5176
-
5177
- <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
5178
- <xsl:attribute name="font-size">80%</xsl:attribute>
5179
- <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
5180
- <xsl:attribute name="vertical-align">super</xsl:attribute>
5181
-
5182
-
5183
- </xsl:if>
5184
-
5185
- <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
5186
-
5187
- <xsl:if test="@type = 'inline'">
5188
-
5189
-
5190
-
5191
- </xsl:if>
5192
-
5193
-
5194
- <xsl:apply-templates/>
5195
- </fo:basic-link>
5196
- </fo:inline>
5382
+
5383
+ <xsl:variable name="bibitemid">
5384
+ <xsl:choose>
5385
+ <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
5386
+ <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
5387
+ <xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
5388
+ </xsl:choose>
5389
+ </xsl:variable>
5390
+
5391
+ <xsl:choose>
5392
+ <xsl:when test="normalize-space($bibitemid) != ''">
5393
+ <fo:inline xsl:use-attribute-sets="eref-style">
5394
+ <xsl:if test="@type = 'footnote'">
5395
+
5396
+ <xsl:attribute name="keep-together.within-line">always</xsl:attribute>
5397
+ <xsl:attribute name="font-size">80%</xsl:attribute>
5398
+ <xsl:attribute name="keep-with-previous.within-line">always</xsl:attribute>
5399
+ <xsl:attribute name="vertical-align">super</xsl:attribute>
5400
+
5401
+
5402
+ </xsl:if>
5403
+
5404
+ <fo:basic-link internal-destination="{@bibitemid}" fox:alt-text="{@citeas}">
5405
+ <xsl:if test="normalize-space(@citeas) = ''">
5406
+ <xsl:attribute name="fox:alt-text"><xsl:value-of select="."/></xsl:attribute>
5407
+ </xsl:if>
5408
+ <xsl:if test="@type = 'inline'">
5409
+
5410
+
5411
+
5412
+ </xsl:if>
5413
+
5414
+ <xsl:apply-templates/>
5415
+ </fo:basic-link>
5416
+
5417
+ </fo:inline>
5418
+ </xsl:when>
5419
+ <xsl:otherwise>
5420
+ <fo:inline><xsl:apply-templates/></fo:inline>
5421
+ </xsl:otherwise>
5422
+ </xsl:choose>
5197
5423
  </xsl:template><xsl:template match="*[local-name() = 'tab']">
5198
5424
  <!-- zero-space char -->
5199
5425
  <xsl:variable name="depth">
@@ -5376,6 +5602,153 @@
5376
5602
  </fo:block>
5377
5603
  </xsl:otherwise>
5378
5604
  </xsl:choose>
5605
+ </xsl:template><xsl:variable name="index" select="document($external_index)"/><xsl:variable name="dash" select="'–'"/><xsl:variable name="bookmark_in_fn">
5606
+ <xsl:for-each select="//*[local-name() = 'bookmark'][ancestor::*[local-name() = 'fn']]">
5607
+ <bookmark><xsl:value-of select="@id"/></bookmark>
5608
+ </xsl:for-each>
5609
+ </xsl:variable><xsl:template match="@*|node()" mode="index_add_id">
5610
+ <xsl:copy>
5611
+ <xsl:apply-templates select="@*|node()" mode="index_add_id"/>
5612
+ </xsl:copy>
5613
+ </xsl:template><xsl:template match="*[local-name() = 'xref']" mode="index_add_id">
5614
+ <xsl:variable name="id">
5615
+ <xsl:call-template name="generateIndexXrefId"/>
5616
+ </xsl:variable>
5617
+ <xsl:copy> <!-- add id to xref -->
5618
+ <xsl:apply-templates select="@*" mode="index_add_id"/>
5619
+ <xsl:attribute name="id">
5620
+ <xsl:value-of select="$id"/>
5621
+ </xsl:attribute>
5622
+ <xsl:apply-templates mode="index_add_id"/>
5623
+ </xsl:copy>
5624
+ <!-- split <xref target="bm1" to="End" pagenumber="true"> to two xref:
5625
+ <xref target="bm1" pagenumber="true"> and <xref target="End" pagenumber="true"> -->
5626
+ <xsl:if test="@to">
5627
+ <xsl:value-of select="$dash"/>
5628
+ <xsl:copy>
5629
+ <xsl:copy-of select="@*"/>
5630
+ <xsl:attribute name="target"><xsl:value-of select="@to"/></xsl:attribute>
5631
+ <xsl:attribute name="id">
5632
+ <xsl:value-of select="$id"/><xsl:text>_to</xsl:text>
5633
+ </xsl:attribute>
5634
+ <xsl:apply-templates mode="index_add_id"/>
5635
+ </xsl:copy>
5636
+ </xsl:if>
5637
+ </xsl:template><xsl:template match="@*|node()" mode="index_update">
5638
+ <xsl:copy>
5639
+ <xsl:apply-templates select="@*|node()" mode="index_update"/>
5640
+ </xsl:copy>
5641
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" mode="index_update">
5642
+ <xsl:copy>
5643
+ <xsl:apply-templates select="@*" mode="index_update"/>
5644
+ <xsl:apply-templates select="node()[1]" mode="process_li_element"/>
5645
+ </xsl:copy>
5646
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']/node()" mode="process_li_element" priority="2">
5647
+ <xsl:param name="element"/>
5648
+ <xsl:param name="remove" select="'false'"/>
5649
+ <xsl:param name="target"/>
5650
+ <!-- <node></node> -->
5651
+ <xsl:choose>
5652
+ <xsl:when test="self::text() and (normalize-space(.) = ',' or normalize-space(.) = $dash) and $remove = 'true'">
5653
+ <!-- skip text (i.e. remove it) and process next element -->
5654
+ <!-- [removed_<xsl:value-of select="."/>] -->
5655
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
5656
+ <xsl:with-param name="target"><xsl:value-of select="$target"/></xsl:with-param>
5657
+ </xsl:apply-templates>
5658
+ </xsl:when>
5659
+ <xsl:when test="self::text()">
5660
+ <xsl:value-of select="."/>
5661
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
5662
+ </xsl:when>
5663
+ <xsl:when test="self::* and local-name(.) = 'xref'">
5664
+ <xsl:variable name="id" select="@id"/>
5665
+ <xsl:variable name="page" select="$index//item[@id = $id]"/>
5666
+ <xsl:variable name="id_next" select="following-sibling::*[local-name() = 'xref'][1]/@id"/>
5667
+ <xsl:variable name="page_next" select="$index//item[@id = $id_next]"/>
5668
+
5669
+ <xsl:variable name="id_prev" select="preceding-sibling::*[local-name() = 'xref'][1]/@id"/>
5670
+ <xsl:variable name="page_prev" select="$index//item[@id = $id_prev]"/>
5671
+
5672
+ <xsl:choose>
5673
+ <!-- 2nd pass -->
5674
+ <!-- if page is equal to page for next and page is not the end of range -->
5675
+ <xsl:when test="$page != '' and $page_next != '' and $page = $page_next and not(contains($page, '_to'))"> <!-- case: 12, 12-14 -->
5676
+ <!-- skip element (i.e. remove it) and remove next text ',' -->
5677
+ <!-- [removed_xref] -->
5678
+
5679
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
5680
+ <xsl:with-param name="remove">true</xsl:with-param>
5681
+ <xsl:with-param name="target">
5682
+ <xsl:choose>
5683
+ <xsl:when test="$target != ''"><xsl:value-of select="$target"/></xsl:when>
5684
+ <xsl:otherwise><xsl:value-of select="@target"/></xsl:otherwise>
5685
+ </xsl:choose>
5686
+ </xsl:with-param>
5687
+ </xsl:apply-templates>
5688
+ </xsl:when>
5689
+
5690
+ <xsl:when test="$page != '' and $page_prev != '' and $page = $page_prev and contains($page_prev, '_to')"> <!-- case: 12-14, 14, ... -->
5691
+ <!-- remove xref -->
5692
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element">
5693
+ <xsl:with-param name="remove">true</xsl:with-param>
5694
+ </xsl:apply-templates>
5695
+ </xsl:when>
5696
+
5697
+ <xsl:otherwise>
5698
+ <xsl:apply-templates select="." mode="xref_copy">
5699
+ <xsl:with-param name="target" select="$target"/>
5700
+ </xsl:apply-templates>
5701
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
5702
+ </xsl:otherwise>
5703
+ </xsl:choose>
5704
+ </xsl:when>
5705
+ <xsl:when test="self::* and local-name(.) = 'ul'">
5706
+ <!-- ul -->
5707
+ <xsl:apply-templates select="." mode="index_update"/>
5708
+ </xsl:when>
5709
+ <xsl:otherwise>
5710
+ <xsl:apply-templates select="." mode="xref_copy">
5711
+ <xsl:with-param name="target" select="$target"/>
5712
+ </xsl:apply-templates>
5713
+ <xsl:apply-templates select="following-sibling::node()[1]" mode="process_li_element"/>
5714
+ </xsl:otherwise>
5715
+ </xsl:choose>
5716
+ </xsl:template><xsl:template match="@*|node()" mode="xref_copy">
5717
+ <xsl:param name="target"/>
5718
+ <xsl:copy>
5719
+ <xsl:apply-templates select="@*" mode="xref_copy"/>
5720
+ <xsl:if test="$target != '' and not(xalan:nodeset($bookmark_in_fn)//bookmark[. = $target])">
5721
+ <xsl:attribute name="target"><xsl:value-of select="$target"/></xsl:attribute>
5722
+ </xsl:if>
5723
+ <xsl:apply-templates select="node()" mode="xref_copy"/>
5724
+ </xsl:copy>
5725
+ </xsl:template><xsl:template name="generateIndexXrefId">
5726
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
5727
+
5728
+ <xsl:variable name="docid">
5729
+ <xsl:call-template name="getDocumentId"/>
5730
+ </xsl:variable>
5731
+ <xsl:variable name="item_number">
5732
+ <xsl:number count="*[local-name() = 'li'][ancestor::*[local-name() = 'indexsect']]" level="any"/>
5733
+ </xsl:variable>
5734
+ <xsl:variable name="xref_number"><xsl:number count="*[local-name() = 'xref']"/></xsl:variable>
5735
+ <xsl:value-of select="concat($docid, '_', $item_number, '_', $xref_number)"/> <!-- $level, '_', -->
5736
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']/*[local-name() = 'clause']" priority="4">
5737
+ <xsl:apply-templates/>
5738
+ <fo:block>
5739
+ <xsl:if test="following-sibling::*[local-name() = 'clause']">
5740
+ <fo:block> </fo:block>
5741
+ </xsl:if>
5742
+ </fo:block>
5743
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'ul']" priority="4">
5744
+ <xsl:apply-templates/>
5745
+ </xsl:template><xsl:template match="*[local-name() = 'indexsect']//*[local-name() = 'li']" priority="4">
5746
+ <xsl:variable name="level" select="count(ancestor::*[local-name() = 'ul'])"/>
5747
+ <fo:block start-indent="{5 * $level}mm" text-indent="-5mm">
5748
+ <xsl:apply-templates/>
5749
+ </fo:block>
5750
+ </xsl:template><xsl:template match="*[local-name() = 'bookmark']" name="bookmark">
5751
+ <fo:inline id="{@id}" font-size="1pt"/>
5379
5752
  </xsl:template><xsl:template match="*[local-name() = 'errata']">
5380
5753
  <!-- <row>
5381
5754
  <date>05-07-2013</date>
@@ -5563,7 +5936,7 @@
5563
5936
  <xsl:param name="charDelim" select="', '"/>
5564
5937
  <xsl:choose>
5565
5938
  <xsl:when test="$sorting = 'true' or $sorting = 'yes'">
5566
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
5939
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
5567
5940
  <xsl:sort data-type="text" order="ascending"/>
5568
5941
  <xsl:call-template name="insertKeyword">
5569
5942
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
@@ -5572,7 +5945,7 @@
5572
5945
  </xsl:for-each>
5573
5946
  </xsl:when>
5574
5947
  <xsl:otherwise>
5575
- <xsl:for-each select="/*/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
5948
+ <xsl:for-each select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']//*[local-name() = 'keyword']">
5576
5949
  <xsl:call-template name="insertKeyword">
5577
5950
  <xsl:with-param name="charAtEnd" select="$charAtEnd"/>
5578
5951
  <xsl:with-param name="charDelim" select="$charDelim"/>
@@ -5589,65 +5962,68 @@
5589
5962
  <xsl:otherwise><xsl:value-of select="$charAtEnd"/></xsl:otherwise>
5590
5963
  </xsl:choose>
5591
5964
  </xsl:template><xsl:template name="addPDFUAmeta">
5592
- <fo:declarations>
5593
- <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
5594
- <pdf:dictionary type="normal" key="ViewerPreferences">
5595
- <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
5596
- </pdf:dictionary>
5597
- </pdf:catalog>
5598
- <x:xmpmeta xmlns:x="adobe:ns:meta/">
5599
- <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
5600
- <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
5601
- <!-- Dublin Core properties go here -->
5602
- <dc:title>
5603
- <xsl:variable name="title">
5965
+ <xsl:variable name="lang">
5966
+ <xsl:call-template name="getLang"/>
5967
+ </xsl:variable>
5968
+ <pdf:catalog xmlns:pdf="http://xmlgraphics.apache.org/fop/extensions/pdf">
5969
+ <pdf:dictionary type="normal" key="ViewerPreferences">
5970
+ <pdf:boolean key="DisplayDocTitle">true</pdf:boolean>
5971
+ </pdf:dictionary>
5972
+ </pdf:catalog>
5973
+ <x:xmpmeta xmlns:x="adobe:ns:meta/">
5974
+ <rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
5975
+ <rdf:Description xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pdf="http://ns.adobe.com/pdf/1.3/" rdf:about="">
5976
+ <!-- Dublin Core properties go here -->
5977
+ <dc:title>
5978
+ <xsl:variable name="title">
5979
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
5604
5980
 
5605
- <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = 'en' and @type = 'main']"/>
5606
5981
 
5607
5982
 
5983
+ <xsl:value-of select="*[local-name() = 'title'][@language = $lang and @type = 'part']"/>
5984
+
5608
5985
 
5609
5986
 
5610
5987
 
5611
- </xsl:variable>
5612
- <xsl:choose>
5613
- <xsl:when test="normalize-space($title) != ''">
5614
- <xsl:value-of select="$title"/>
5615
- </xsl:when>
5616
- <xsl:otherwise>
5617
- <xsl:text> </xsl:text>
5618
- </xsl:otherwise>
5619
- </xsl:choose>
5620
- </dc:title>
5621
- <dc:creator>
5988
+ </xsl:for-each>
5989
+ </xsl:variable>
5990
+ <xsl:choose>
5991
+ <xsl:when test="normalize-space($title) != ''">
5992
+ <xsl:value-of select="$title"/>
5993
+ </xsl:when>
5994
+ <xsl:otherwise>
5995
+ <xsl:text> </xsl:text>
5996
+ </xsl:otherwise>
5997
+ </xsl:choose>
5998
+ </dc:title>
5999
+ <dc:creator>
6000
+ <xsl:for-each select="(//*[contains(local-name(), '-standard')])[1]/*[local-name() = 'bibdata']">
5622
6001
 
5623
- <xsl:value-of select="/*/*[local-name() = 'bibdata']/*[local-name() = 'contributor'][*[local-name() = 'role']/@type='author']/*[local-name() = 'organization']/*[local-name() = 'name']"/>
5624
6002
 
6003
+ <xsl:value-of select="normalize-space(*[local-name() = 'ext']/*[local-name() = 'editorialgroup']/*[local-name() = 'committee'])"/>
5625
6004
 
5626
6005
 
5627
- </dc:creator>
5628
- <dc:description>
5629
- <xsl:variable name="abstract">
5630
-
5631
- <xsl:copy-of select="/*/*[local-name() = 'bibliography']/*[local-name() = 'references']/*[local-name() = 'bibitem']/*[local-name() = 'abstract']//text()"/>
5632
-
5633
-
5634
-
5635
-
5636
-
5637
- </xsl:variable>
5638
- <xsl:value-of select="normalize-space($abstract)"/>
5639
- </dc:description>
5640
- <pdf:Keywords>
5641
- <xsl:call-template name="insertKeywords"/>
5642
- </pdf:Keywords>
5643
- </rdf:Description>
5644
- <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
5645
- <!-- XMP properties go here -->
5646
- <xmp:CreatorTool/>
5647
- </rdf:Description>
5648
- </rdf:RDF>
5649
- </x:xmpmeta>
5650
- </fo:declarations>
6006
+ </xsl:for-each>
6007
+ </dc:creator>
6008
+ <dc:description>
6009
+ <xsl:variable name="abstract">
6010
+
6011
+
6012
+ <xsl:value-of select="//*[contains(local-name(), '-standard')]/*[local-name() = 'bibdata']/*[local-name() = 'title'][@language = $lang and @type = 'main']"/>
6013
+
6014
+ </xsl:variable>
6015
+ <xsl:value-of select="normalize-space($abstract)"/>
6016
+ </dc:description>
6017
+ <pdf:Keywords>
6018
+ <xsl:call-template name="insertKeywords"/>
6019
+ </pdf:Keywords>
6020
+ </rdf:Description>
6021
+ <rdf:Description xmlns:xmp="http://ns.adobe.com/xap/1.0/" rdf:about="">
6022
+ <!-- XMP properties go here -->
6023
+ <xmp:CreatorTool/>
6024
+ </rdf:Description>
6025
+ </rdf:RDF>
6026
+ </x:xmpmeta>
5651
6027
  </xsl:template><xsl:template name="getId">
5652
6028
  <xsl:choose>
5653
6029
  <xsl:when test="../@id">