metanorma-itu 1.3.8 → 1.3.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 905aebce52ca9a56c5466fc2fe1c22cf92188793e85c770b457f9830b57e14c0
4
- data.tar.gz: 1478bfc5779683236193015af66b722ac84530895bf3841e82876b9a274a1e27
3
+ metadata.gz: 12737ac0ba4d8fd85515b4c370ccab8fe12d1ab51f3c5fedcec3c42e72dbd925
4
+ data.tar.gz: d8994b2ddb5d16f89c52a61d6f4eb273149febc6789dfc1df9a65cfcafeee1a0
5
5
  SHA512:
6
- metadata.gz: 5c447f563caadce73d2adf9c98774486d3bd9489c8cb21b9cebfde6f2e666c2ec0ab8bcad063067861f122032a3fa6a31fed834e7ecdf5242ced08f5015355f8
7
- data.tar.gz: 2030ca3837828d3087e64cc37557a8dee346ac471b3e361932e7be4eb19d58f92c6c4851f925b48faf1f0ebe7efc36cd2c5b1341d7a0f28b9cbac4d68679af22
6
+ metadata.gz: f185faea621b1a4c0ed692c4683b15a14fe8b5ca5aaddd173b16db1d6d61eb9cbf355de886cbdcf90acb97a4cacb2178a9842f6c8d0d83c66e10310fd6bb6d03
7
+ data.tar.gz: d9b414079f9642a01ef663bc8f86c9770cc7031ec813dd4d4f5505532a2cdf6699be23ff3e1b7a7952967d72517e2ca199bc8f532fc10b659a39da96503a00f7
@@ -17,13 +17,13 @@ module Asciidoctor
17
17
  { language: lang, format: "text/plain", type: type }
18
18
  end
19
19
 
20
- def title_english(node, xml)
21
- a = node.attr("title") || node.attr("title-en")
22
- xml.title **attr_code(title_attr("main")) do |t|
20
+ def title_defaultlang(node, xml)
21
+ a = node.attr("title") || node.attr("title-#{@lang}")
22
+ xml.title **attr_code(title_attr("main", @lang)) do |t|
23
23
  t << (Metanorma::Utils::asciidoc_sub(a) || node.title)
24
24
  end
25
- if a = node.attr("annextitle") || node.attr("annextitle-en")
26
- xml.title **attr_code(title_attr("annex")) do |t|
25
+ if a = node.attr("annextitle") || node.attr("annextitle-#{@lang}")
26
+ xml.title **attr_code(title_attr("annex", @lang)) do |t|
27
27
  t << Metanorma::Utils::asciidoc_sub(a)
28
28
  end
29
29
  end
@@ -32,7 +32,7 @@ module Asciidoctor
32
32
  def title_otherlangs(node, xml)
33
33
  node.attributes.each do |k, v|
34
34
  next unless /^(annex)?title-(?<lang>.+)$/ =~ k
35
- next if lang == "en"
35
+ next if lang == @lang
36
36
 
37
37
  type = /^annex/.match?(k) ? "annex" : "main"
38
38
  xml.title **attr_code(title_attr(type, lang)) do |t|
@@ -42,16 +42,17 @@ module Asciidoctor
42
42
  end
43
43
 
44
44
  def title(node, xml)
45
- super
45
+ title_defaultlang(node, xml)
46
+ title_otherlangs(node, xml)
46
47
  %w(subtitle amendment-title corrigendum-title).each do |t|
47
- other_title_english(node, xml, t)
48
+ other_title_defaultlang(node, xml, t)
48
49
  other_title_otherlangs(node, xml, t)
49
50
  end
50
51
  end
51
52
 
52
- def other_title_english(node, xml, type)
53
- a = node.attr(type) || node.attr("#{type}-en")
54
- xml.title **attr_code(title_attr(type.sub(/-title/, ""))) do |t|
53
+ def other_title_defaultlang(node, xml, type)
54
+ a = node.attr(type) || node.attr("#{type}-#{@lang}")
55
+ xml.title **attr_code(title_attr(type.sub(/-title/, ""), @lang)) do |t|
55
56
  t << Metanorma::Utils::asciidoc_sub(a)
56
57
  end
57
58
  end
@@ -59,7 +60,7 @@ module Asciidoctor
59
60
  def other_title_otherlangs(node, xml, type)
60
61
  node.attributes.each do |k, v|
61
62
  next unless m = /^#{type}-(?<lang>.+)$/.match(k)
62
- next if m[:lang] == "en"
63
+ next if m[:lang] == @lang
63
64
 
64
65
  xml.title **attr_code(title_attr(type.sub(/-title/, ""),
65
66
  m[:lang])) do |t|
@@ -84,30 +85,23 @@ module Asciidoctor
84
85
  def metadata_committee1(node, xml, suffix)
85
86
  xml.editorialgroup do |a|
86
87
  a.bureau ( node.attr("bureau#{suffix}") || "T")
87
- if node.attr("group#{suffix}")
88
- a.group **attr_code(type: node.attr("grouptype#{suffix}")) do |g|
89
- metadata_committee2(node, g, suffix, "")
90
- end
91
- end
92
- if node.attr("subgroup#{suffix}")
93
- a.subgroup **attr_code(type: node.attr("subgrouptype#{suffix}")) do |g|
94
- metadata_committee2(node, g, suffix, "sub")
95
- end
96
- end
97
- if node.attr("workgroup#{suffix}")
98
- a.workgroup **attr_code(type: node.attr("workgrouptype#{suffix}")) do |g|
99
- metadata_committee2(node, g, suffix, "work")
88
+ ["", "sub", "work"].each do |p|
89
+ next unless node.attr("#{p}group#{suffix}")
90
+
91
+ type = node.attr("#{p}grouptype#{suffix}")
92
+ a.send "#{p}group", **attr_code(type: type) do |g|
93
+ metadata_committee2(node, g, suffix, p)
100
94
  end
101
95
  end
102
96
  end
103
97
  end
104
98
 
105
- def metadata_committee2(node, g, suffix, prefix)
106
- g.name node.attr("#{prefix}group#{suffix}")
99
+ def metadata_committee2(node, group, suffix, prefix)
100
+ group.name node.attr("#{prefix}group#{suffix}")
107
101
  node.attr("#{prefix}groupacronym#{suffix}") and
108
- g.acronym node.attr("#{prefix}groupacronym#{suffix}")
102
+ group.acronym node.attr("#{prefix}groupacronym#{suffix}")
109
103
  if node.attr("#{prefix}groupyearstart#{suffix}")
110
- g.period do |p|
104
+ group.period do |p|
111
105
  p.start node.attr("#{prefix}groupyearstart#{suffix}")
112
106
  node.attr("#{prefix}groupacronym#{suffix}") and
113
107
  p.end node.attr("#{prefix}groupyearend#{suffix}")
@@ -134,9 +128,11 @@ module Asciidoctor
134
128
 
135
129
  def itu_id1(node, lang)
136
130
  bureau = node.attr("bureau") || "T"
137
- id = doctype(node) == "service-publication" ?
138
- @i18n.annex_to_itu_ob_abbrev.sub(/%/, node.attr("docnumber")) :
139
- "ITU-#{bureau} #{node.attr('docnumber')}"
131
+ id = if doctype(node) == "service-publication"
132
+ @i18n.annex_to_itu_ob_abbrev.sub(/%/, node.attr("docnumber"))
133
+ else
134
+ "ITU-#{bureau} #{node.attr('docnumber')}"
135
+ end
140
136
  id + (lang ? "-#{ITULANG[@lang]}" : "")
141
137
  end
142
138
 
@@ -165,16 +161,16 @@ module Asciidoctor
165
161
  def metadata_series(node, xml)
166
162
  node.attr("series") and
167
163
  xml.series **{ type: "main" } do |s|
168
- s.title node.attr("series")
169
- end
164
+ s.title node.attr("series")
165
+ end
170
166
  node.attr("series1") and
171
167
  xml.series **{ type: "secondary" } do |s|
172
- s.title node.attr("series1")
173
- end
168
+ s.title node.attr("series1")
169
+ end
174
170
  node.attr("series2") and
175
171
  xml.series **{ type: "tertiary" } do |s|
176
- s.title node.attr("series2")
177
- end
172
+ s.title node.attr("series2")
173
+ end
178
174
  end
179
175
 
180
176
  def metadata_recommendationstatus(node, xml)
@@ -222,9 +218,9 @@ module Asciidoctor
222
218
  end
223
219
  end
224
220
 
225
- def metadata_meeting_date(a, xml)
221
+ def metadata_meeting_date(val, xml)
226
222
  xml.meeting_date do |m|
227
- d = a.split("/")
223
+ d = val.split("/")
228
224
  if d.size > 1
229
225
  m.from d[0]
230
226
  m.to d[1]
@@ -234,9 +230,9 @@ module Asciidoctor
234
230
  end
235
231
  end
236
232
 
237
- def personal_role(node, c, suffix)
233
+ def personal_role(node, contrib, suffix)
238
234
  if node.attr("role#{suffix}")&.downcase == "rapporteur"
239
- c.role "raporteur", **{ type: "editor" }
235
+ contrib.role "raporteur", **{ type: "editor" }
240
236
  else
241
237
  super
242
238
  end
@@ -64,9 +64,9 @@
64
64
  <optional>
65
65
  <ref name="label"/>
66
66
  </optional>
67
- <optional>
67
+ <zeroOrMore>
68
68
  <ref name="subject"/>
69
- </optional>
69
+ </zeroOrMore>
70
70
  <zeroOrMore>
71
71
  <ref name="reqinherit"/>
72
72
  </zeroOrMore>
@@ -80,6 +80,7 @@
80
80
  <ref name="verification"/>
81
81
  <ref name="import"/>
82
82
  <ref name="description"/>
83
+ <ref name="component"/>
83
84
  </choice>
84
85
  </zeroOrMore>
85
86
  <optional>
@@ -105,12 +106,16 @@
105
106
  </define>
106
107
  <define name="subject">
107
108
  <element name="subject">
108
- <text/>
109
+ <oneOrMore>
110
+ <ref name="TextElement"/>
111
+ </oneOrMore>
109
112
  </element>
110
113
  </define>
111
114
  <define name="reqinherit">
112
115
  <element name="inherit">
113
- <text/>
116
+ <oneOrMore>
117
+ <ref name="TextElement"/>
118
+ </oneOrMore>
114
119
  </element>
115
120
  </define>
116
121
  <define name="measurementtarget">
@@ -138,6 +143,12 @@
138
143
  <ref name="RequirementSubpart"/>
139
144
  </element>
140
145
  </define>
146
+ <define name="component">
147
+ <element name="component">
148
+ <attribute name="class"/>
149
+ <ref name="RequirementSubpart"/>
150
+ </element>
151
+ </define>
141
152
  <define name="reqt_references">
142
153
  <element name="references">
143
154
  <oneOrMore>
@@ -1891,7 +1891,7 @@
1891
1891
  </xsl:choose>
1892
1892
  </xsl:variable>
1893
1893
  <xsl:element name="{$element-name}">
1894
- <xsl:attribute name="font-family">Courier</xsl:attribute>
1894
+ <xsl:attribute name="font-family">Courier New</xsl:attribute>
1895
1895
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1896
1896
  <xsl:if test="local-name(..) != 'dt' and not(ancestor::itu:dd) and not(ancestor::itu:title)">
1897
1897
  <xsl:attribute name="text-align">center</xsl:attribute>
@@ -2505,7 +2505,7 @@
2505
2505
 
2506
2506
 
2507
2507
 
2508
- <xsl:attribute name="font-family">Courier</xsl:attribute>
2508
+ <xsl:attribute name="font-family">Courier New</xsl:attribute>
2509
2509
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
2510
2510
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2511
2511
 
@@ -2589,6 +2589,7 @@
2589
2589
 
2590
2590
 
2591
2591
 
2592
+
2592
2593
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2593
2594
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
2594
2595
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -3070,6 +3071,8 @@
3070
3071
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
3071
3072
  </xsl:if>
3072
3073
 
3074
+
3075
+
3073
3076
  <xsl:choose>
3074
3077
  <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
3075
3078
  <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
@@ -3357,9 +3360,9 @@
3357
3360
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
3358
3361
  <xsl:with-param name="continued">true</xsl:with-param>
3359
3362
  </xsl:apply-templates>
3360
- <xsl:for-each select="ancestor::*[local-name()='table'][1]">
3361
- <xsl:call-template name="fn_name_display"/>
3362
- </xsl:for-each>
3363
+
3364
+
3365
+
3363
3366
 
3364
3367
  </fo:table-cell>
3365
3368
  </fo:table-row>
@@ -3445,7 +3448,11 @@
3445
3448
 
3446
3449
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3447
3450
 
3448
- <xsl:if test="$isNoteOrFnExist = 'true'">
3451
+ <xsl:variable name="isNoteOrFnExistShowAfterTable">
3452
+
3453
+ </xsl:variable>
3454
+
3455
+ <xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'">
3449
3456
 
3450
3457
  <xsl:variable name="cols-count">
3451
3458
  <xsl:choose>
@@ -3603,6 +3610,19 @@
3603
3610
 
3604
3611
  </fo:table-body>
3605
3612
 
3613
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
3614
+ <xsl:choose>
3615
+ <xsl:when test="substring-after(., '—') != ''">
3616
+ <xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
3617
+ </xsl:when>
3618
+ <xsl:otherwise>
3619
+ <xsl:value-of select="."/>
3620
+ </xsl:otherwise>
3621
+ </xsl:choose>
3622
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
3623
+ <xsl:apply-templates mode="presentation_name"/>
3624
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
3625
+ <xsl:apply-templates select="."/>
3606
3626
  </xsl:template><xsl:template match="*[local-name()='tr']">
3607
3627
  <xsl:variable name="parent-name" select="local-name(..)"/>
3608
3628
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
@@ -3801,18 +3821,12 @@
3801
3821
  <xsl:apply-templates/>
3802
3822
  </xsl:template><xsl:template name="fn_display">
3803
3823
  <xsl:variable name="references">
3824
+
3804
3825
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
3805
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
3806
-
3807
- <xsl:if test="ancestor::*[local-name()='preface']">
3808
- <xsl:attribute name="preface">true</xsl:attribute>
3809
- </xsl:if>
3810
-
3811
-
3812
- <xsl:apply-templates/>
3813
- </fn>
3826
+ <xsl:call-template name="create_fn"/>
3814
3827
  </xsl:for-each>
3815
3828
  </xsl:variable>
3829
+
3816
3830
  <xsl:for-each select="xalan:nodeset($references)//fn">
3817
3831
  <xsl:variable name="reference" select="@reference"/>
3818
3832
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
@@ -3860,6 +3874,16 @@
3860
3874
  </fo:block>
3861
3875
  </xsl:if>
3862
3876
  </xsl:for-each>
3877
+ </xsl:template><xsl:template name="create_fn">
3878
+ <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
3879
+
3880
+ <xsl:if test="ancestor::*[local-name()='preface']">
3881
+ <xsl:attribute name="preface">true</xsl:attribute>
3882
+ </xsl:if>
3883
+
3884
+
3885
+ <xsl:apply-templates/>
3886
+ </fn>
3863
3887
  </xsl:template><xsl:template name="fn_name_display">
3864
3888
  <!-- <xsl:variable name="references">
3865
3889
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
@@ -4880,19 +4904,6 @@
4880
4904
  <!-- replace start and end spaces to non-break space -->
4881
4905
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
4882
4906
  </xsl:copy>
4883
- </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
4884
- <xsl:copy>
4885
- <xsl:apply-templates select="@*|node()" mode="mathml"/>
4886
- </xsl:copy>
4887
- <xsl:choose>
4888
- <!-- if in msub, then don't add space -->
4889
- <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
4890
- <!-- if next char in digit, don't add space -->
4891
- <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
4892
- <xsl:otherwise>
4893
- <mathml:mspace width="0.5ex"/>
4894
- </xsl:otherwise>
4895
- </xsl:choose>
4896
4907
  </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">
4897
4908
  <xsl:variable name="target">
4898
4909
  <xsl:choose>
@@ -6080,7 +6091,19 @@
6080
6091
  </fo:inline>
6081
6092
  </xsl:if>
6082
6093
  </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
6083
- <fo:inline><xsl:apply-templates/></fo:inline>
6094
+ <xsl:variable name="element">inline
6095
+
6096
+ </xsl:variable>
6097
+ <xsl:choose>
6098
+ <xsl:when test="contains($element, 'block')">
6099
+ <fo:block xsl:use-attribute-sets="example-p-style">
6100
+ <xsl:apply-templates/>
6101
+ </fo:block>
6102
+ </xsl:when>
6103
+ <xsl:otherwise>
6104
+ <fo:inline><xsl:apply-templates/></fo:inline>
6105
+ </xsl:otherwise>
6106
+ </xsl:choose>
6084
6107
  </xsl:template><xsl:template match="*[local-name() = 'example']">
6085
6108
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
6086
6109
 
@@ -6657,7 +6680,6 @@
6657
6680
  </xsl:template><xsl:template name="processBibitem">
6658
6681
 
6659
6682
 
6660
- <!-- end BIPM bibitem processing-->
6661
6683
 
6662
6684
 
6663
6685
 
@@ -1891,7 +1891,7 @@
1891
1891
  </xsl:choose>
1892
1892
  </xsl:variable>
1893
1893
  <xsl:element name="{$element-name}">
1894
- <xsl:attribute name="font-family">Courier</xsl:attribute>
1894
+ <xsl:attribute name="font-family">Courier New</xsl:attribute>
1895
1895
  <xsl:attribute name="font-size">10pt</xsl:attribute>
1896
1896
  <xsl:if test="local-name(..) != 'dt' and not(ancestor::itu:dd) and not(ancestor::itu:title)">
1897
1897
  <xsl:attribute name="text-align">center</xsl:attribute>
@@ -2505,7 +2505,7 @@
2505
2505
 
2506
2506
 
2507
2507
 
2508
- <xsl:attribute name="font-family">Courier</xsl:attribute>
2508
+ <xsl:attribute name="font-family">Courier New</xsl:attribute>
2509
2509
  <xsl:attribute name="margin-top">6pt</xsl:attribute>
2510
2510
  <xsl:attribute name="margin-bottom">6pt</xsl:attribute>
2511
2511
 
@@ -2589,6 +2589,7 @@
2589
2589
 
2590
2590
 
2591
2591
 
2592
+
2592
2593
  <xsl:attribute name="font-size">10pt</xsl:attribute>
2593
2594
  <xsl:attribute name="margin-top">12pt</xsl:attribute>
2594
2595
  <xsl:attribute name="margin-bottom">12pt</xsl:attribute>
@@ -3070,6 +3071,8 @@
3070
3071
  <xsl:attribute name="border-bottom">0pt solid black</xsl:attribute> <!-- set 0pt border, because there is a separete table below for footer -->
3071
3072
  </xsl:if>
3072
3073
 
3074
+
3075
+
3073
3076
  <xsl:choose>
3074
3077
  <xsl:when test="*[local-name()='colgroup']/*[local-name()='col']">
3075
3078
  <xsl:for-each select="*[local-name()='colgroup']/*[local-name()='col']">
@@ -3357,9 +3360,9 @@
3357
3360
  <xsl:apply-templates select="ancestor::*[local-name()='table']/*[local-name()='name']" mode="presentation">
3358
3361
  <xsl:with-param name="continued">true</xsl:with-param>
3359
3362
  </xsl:apply-templates>
3360
- <xsl:for-each select="ancestor::*[local-name()='table'][1]">
3361
- <xsl:call-template name="fn_name_display"/>
3362
- </xsl:for-each>
3363
+
3364
+
3365
+
3363
3366
 
3364
3367
  </fo:table-cell>
3365
3368
  </fo:table-row>
@@ -3445,7 +3448,11 @@
3445
3448
 
3446
3449
  <xsl:variable name="isNoteOrFnExist" select="../*[local-name()='note'] or ..//*[local-name()='fn'][local-name(..) != 'name']"/>
3447
3450
 
3448
- <xsl:if test="$isNoteOrFnExist = 'true'">
3451
+ <xsl:variable name="isNoteOrFnExistShowAfterTable">
3452
+
3453
+ </xsl:variable>
3454
+
3455
+ <xsl:if test="$isNoteOrFnExist = 'true' or normalize-space($isNoteOrFnExistShowAfterTable) = 'true'">
3449
3456
 
3450
3457
  <xsl:variable name="cols-count">
3451
3458
  <xsl:choose>
@@ -3603,6 +3610,19 @@
3603
3610
 
3604
3611
  </fo:table-body>
3605
3612
 
3613
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/text()[1]" priority="2" mode="presentation_name">
3614
+ <xsl:choose>
3615
+ <xsl:when test="substring-after(., '—') != ''">
3616
+ <xsl:text>—</xsl:text><xsl:value-of select="substring-after(., '—')"/>
3617
+ </xsl:when>
3618
+ <xsl:otherwise>
3619
+ <xsl:value-of select="."/>
3620
+ </xsl:otherwise>
3621
+ </xsl:choose>
3622
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']" mode="presentation_name">
3623
+ <xsl:apply-templates mode="presentation_name"/>
3624
+ </xsl:template><xsl:template match="*[local-name()='table']/*[local-name()='name']/node()" mode="presentation_name">
3625
+ <xsl:apply-templates select="."/>
3606
3626
  </xsl:template><xsl:template match="*[local-name()='tr']">
3607
3627
  <xsl:variable name="parent-name" select="local-name(..)"/>
3608
3628
  <!-- <xsl:variable name="namespace" select="substring-before(name(/*), '-')"/> -->
@@ -3801,18 +3821,12 @@
3801
3821
  <xsl:apply-templates/>
3802
3822
  </xsl:template><xsl:template name="fn_display">
3803
3823
  <xsl:variable name="references">
3824
+
3804
3825
  <xsl:for-each select="..//*[local-name()='fn'][local-name(..) != 'name']">
3805
- <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
3806
-
3807
- <xsl:if test="ancestor::*[local-name()='preface']">
3808
- <xsl:attribute name="preface">true</xsl:attribute>
3809
- </xsl:if>
3810
-
3811
-
3812
- <xsl:apply-templates/>
3813
- </fn>
3826
+ <xsl:call-template name="create_fn"/>
3814
3827
  </xsl:for-each>
3815
3828
  </xsl:variable>
3829
+
3816
3830
  <xsl:for-each select="xalan:nodeset($references)//fn">
3817
3831
  <xsl:variable name="reference" select="@reference"/>
3818
3832
  <xsl:if test="not(preceding-sibling::*[@reference = $reference])"> <!-- only unique reference puts in note-->
@@ -3860,6 +3874,16 @@
3860
3874
  </fo:block>
3861
3875
  </xsl:if>
3862
3876
  </xsl:for-each>
3877
+ </xsl:template><xsl:template name="create_fn">
3878
+ <fn reference="{@reference}" id="{@reference}_{ancestor::*[@id][1]/@id}">
3879
+
3880
+ <xsl:if test="ancestor::*[local-name()='preface']">
3881
+ <xsl:attribute name="preface">true</xsl:attribute>
3882
+ </xsl:if>
3883
+
3884
+
3885
+ <xsl:apply-templates/>
3886
+ </fn>
3863
3887
  </xsl:template><xsl:template name="fn_name_display">
3864
3888
  <!-- <xsl:variable name="references">
3865
3889
  <xsl:for-each select="*[local-name()='name']//*[local-name()='fn']">
@@ -4880,19 +4904,6 @@
4880
4904
  <!-- replace start and end spaces to non-break space -->
4881
4905
  <xsl:value-of select="java:replaceAll(java:java.lang.String.new(.),'(^ )|( $)',' ')"/>
4882
4906
  </xsl:copy>
4883
- </xsl:template><xsl:template match="mathml:mi[. = ',' and not(following-sibling::*[1][local-name() = 'mtext' and text() = ' '])]" mode="mathml">
4884
- <xsl:copy>
4885
- <xsl:apply-templates select="@*|node()" mode="mathml"/>
4886
- </xsl:copy>
4887
- <xsl:choose>
4888
- <!-- if in msub, then don't add space -->
4889
- <xsl:when test="ancestor::mathml:mrow[parent::mathml:msub and preceding-sibling::*[1][self::mathml:mrow]]"/>
4890
- <!-- if next char in digit, don't add space -->
4891
- <xsl:when test="translate(substring(following-sibling::*[1]/text(),1,1),'0123456789','') = ''"/>
4892
- <xsl:otherwise>
4893
- <mathml:mspace width="0.5ex"/>
4894
- </xsl:otherwise>
4895
- </xsl:choose>
4896
4907
  </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">
4897
4908
  <xsl:variable name="target">
4898
4909
  <xsl:choose>
@@ -6080,7 +6091,19 @@
6080
6091
  </fo:inline>
6081
6092
  </xsl:if>
6082
6093
  </xsl:template><xsl:template match="*[local-name() = 'termexample']/*[local-name() = 'p']">
6083
- <fo:inline><xsl:apply-templates/></fo:inline>
6094
+ <xsl:variable name="element">inline
6095
+
6096
+ </xsl:variable>
6097
+ <xsl:choose>
6098
+ <xsl:when test="contains($element, 'block')">
6099
+ <fo:block xsl:use-attribute-sets="example-p-style">
6100
+ <xsl:apply-templates/>
6101
+ </fo:block>
6102
+ </xsl:when>
6103
+ <xsl:otherwise>
6104
+ <fo:inline><xsl:apply-templates/></fo:inline>
6105
+ </xsl:otherwise>
6106
+ </xsl:choose>
6084
6107
  </xsl:template><xsl:template match="*[local-name() = 'example']">
6085
6108
  <fo:block id="{@id}" xsl:use-attribute-sets="example-style">
6086
6109
 
@@ -6657,7 +6680,6 @@
6657
6680
  </xsl:template><xsl:template name="processBibitem">
6658
6681
 
6659
6682
 
6660
- <!-- end BIPM bibitem processing-->
6661
6683
 
6662
6684
 
6663
6685