metanorma-un 0.6.9 → 0.6.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bebff59ec3ff854c555b92c957234f6741e6bf178b8b88f849a9a1984eee4bf0
4
- data.tar.gz: e1c6234c1e97e715eb0162a12af1671aa095bec3ea184641c09e0ed27e80bfb9
3
+ metadata.gz: 20d1e57f121c8608902a2faf38631a06035ddd820a11826977e2fc04bfbb36ca
4
+ data.tar.gz: 3991d1560ef4d9721da8033083e4b1f4e79323e2f382b80c6ba05c129d1aed24
5
5
  SHA512:
6
- metadata.gz: 9845dc890c962b26f7f28a73cd8acddc2631b2656f9cbd66ff23715b7b5077087838f7948c23b770c6006f001f49c71097fde08def137e725437fa3ca9f73bb1
7
- data.tar.gz: c80f23d647165a1c4ad89bc7f7efed18f4c484ccbf495a9ef0a4a3a53bde0d68c241cb877c6ee093995987b90effeaab8ab3d7029c23aaea71a670bac2fb2d50
6
+ metadata.gz: 64f5c9d3de39a64d021a9afc081e6c9b931c0d9a5f707c102c86b2744949500a544386f7c99508d376cf76618a5ac942c720684075461e77f4d57929f353e85a
7
+ data.tar.gz: 0b5a23f6f9e0d88e255d24a5d3d597383106da1c8ef7f9b644ac3c893f57c8c33bae0ac022d9ddd312ac820a55c8227fe8980e8db574ead3ce6a8b8f08a2c581
data/Gemfile CHANGED
@@ -6,6 +6,6 @@ git_source(:github) { |repo| "https://github.com/#{repo}" }
6
6
 
7
7
  gemspec
8
8
 
9
- if File.exist? 'Gemfile.devel'
10
- eval File.read('Gemfile.devel'), nil, 'Gemfile.devel' # rubocop:disable Security/Eval
9
+ if File.exist? "Gemfile.devel"
10
+ eval File.read("Gemfile.devel"), nil, "Gemfile.devel" # rubocop:disable Security/Eval
11
11
  end
data/Rakefile CHANGED
@@ -1,8 +1,8 @@
1
1
  require "bundler/gem_tasks"
2
2
  require "rspec/core/rake_task"
3
- require 'isodoc/gem_tasks'
3
+ require "isodoc/gem_tasks"
4
4
 
5
5
  IsoDoc::GemTasks.install
6
6
  RSpec::Core::RakeTask.new(:spec)
7
7
 
8
- task :default => :spec
8
+ task default: :spec
@@ -17,13 +17,14 @@ module Asciidoctor
17
17
 
18
18
  def metadata_committee(node, xml)
19
19
  return unless node.attr("committee")
20
+
20
21
  xml.editorialgroup do |a|
21
22
  a.committee node.attr("committee"),
22
- **attr_code(type: node.attr("committee-type"))
23
+ **attr_code(type: node.attr("committee-type"))
23
24
  i = 2
24
- while node.attr("committee_#{i}") do
25
+ while node.attr("committee_#{i}")
25
26
  a.committee node.attr("committee_#{i}"),
26
- **attr_code(type: node.attr("committee-type_#{i}"))
27
+ **attr_code(type: node.attr("committee-type_#{i}"))
27
28
  i += 1
28
29
  end
29
30
  end
@@ -66,13 +67,13 @@ module Asciidoctor
66
67
  xml.session do |session|
67
68
  session.number node.attr("session") if node.attr("session")
68
69
  session.date node.attr("session-date") if node.attr("session-date")
69
- node&.attr("item-number")&.split(/,[ ]*/)&.each do |i|
70
+ node&.attr("item-number")&.split(/, */)&.each do |i|
70
71
  session.item_number i
71
72
  end
72
- node&.attr("item-name")&.split(/,[ ]*/)&.each do |i|
73
+ node&.attr("item-name")&.split(/, */)&.each do |i|
73
74
  session.item_name i
74
75
  end
75
- node&.attr("subitem-name")&.split(/,[ ]*/)&.each do |i|
76
+ node&.attr("subitem-name")&.split(/, */)&.each do |i|
76
77
  session.subitem_name i
77
78
  end
78
79
  node.attr("collaborator") and
@@ -84,13 +85,13 @@ module Asciidoctor
84
85
  end
85
86
 
86
87
  def metadata_language(node, xml)
87
- languages = node&.attr("language")&.split(/,[ ]*/) ||
88
+ languages = node&.attr("language")&.split(/, */) ||
88
89
  %w(ar ru en fr zh es)
89
90
  languages.each { |l| xml.language l }
90
91
  end
91
92
 
92
93
  def metadata_submission_language(node, xml)
93
- languages = node&.attr("submissionlanguage")&.split(/,[ ]*/) || []
94
+ languages = node&.attr("submissionlanguage")&.split(/, */) || []
94
95
  languages.each { |l| xml.submissionlanguage l }
95
96
  end
96
97
 
@@ -101,7 +102,7 @@ module Asciidoctor
101
102
  metadata_submission_language(node, xml)
102
103
  end
103
104
 
104
- def title_validate(root)
105
+ def title_validate(_root)
105
106
  nil
106
107
  end
107
108
 
@@ -114,12 +115,11 @@ module Asciidoctor
114
115
 
115
116
  def doctype(node)
116
117
  d = super
117
- unless %w{plenary recommendation addendum communication corrigendum
118
- reissue agenda budgetary sec-gen-notes expert-report resolution
119
- plenary-attachment}.include? d
120
- @log.add(
121
- "Document Attributes", nil,
122
- "#{d} is not a legal document type: reverting to 'recommendation'")
118
+ unless %w{plenary recommendation addendum communication corrigendum
119
+ reissue agenda budgetary sec-gen-notes expert-report
120
+ resolution plenary-attachment}.include? d
121
+ @log.add("Document Attributes", nil,
122
+ "#{d} is not a legal document type: reverting to 'recommendation'")
123
123
  d = "recommendation"
124
124
  end
125
125
  d
@@ -128,11 +128,11 @@ module Asciidoctor
128
128
  def outputs(node, ret)
129
129
  File.open(@filename + ".xml", "w:UTF-8") { |f| f.write(ret) }
130
130
  presentation_xml_converter(node).convert(@filename + ".xml")
131
- html_converter(node).convert(@filename + ".presentation.xml",
131
+ html_converter(node).convert(@filename + ".presentation.xml",
132
132
  nil, false, "#{@filename}.html")
133
- doc_converter(node).convert(@filename + ".presentation.xml",
133
+ doc_converter(node).convert(@filename + ".presentation.xml",
134
134
  nil, false, "#{@filename}.doc")
135
- pdf_converter(node)&.convert(@filename + ".presentation.xml",
135
+ pdf_converter(node)&.convert(@filename + ".presentation.xml",
136
136
  nil, false, "#{@filename}.pdf")
137
137
  end
138
138
 
@@ -142,8 +142,8 @@ module Asciidoctor
142
142
  File.join(File.dirname(__FILE__), "un.rng"))
143
143
  end
144
144
 
145
- def style(n, t)
146
- return
145
+ def style(_node, _text)
146
+ nil
147
147
  end
148
148
 
149
149
  def html_extract_attributes(node)
@@ -168,6 +168,7 @@ module Asciidoctor
168
168
 
169
169
  def pdf_converter(node)
170
170
  return nil if node.attr("no-pdf")
171
+
171
172
  IsoDoc::UN::PdfConvert.new(doc_extract_attributes(node))
172
173
  end
173
174
 
@@ -196,25 +197,24 @@ module Asciidoctor
196
197
  xmldoc.xpath("//clause/p | //annex/p").each do |p|
197
198
  cl = Nokogiri::XML::Node.new("clause", xmldoc)
198
199
  cl["id"] = p["id"]
199
- cl["inline-header"]="true"
200
- p["id"] = "_" + UUIDTools::UUID.random_create
200
+ cl["inline-header"] = "true"
201
+ p["id"] = "_#{UUIDTools::UUID.random_create}"
201
202
  p.replace(cl)
202
203
  p.parent = cl
203
- while n = cl.next_element and !%w(p clause).include? n.name
204
+ while (n = cl.next_element) && !%w(p clause).include?(n.name)
204
205
  n.parent = cl
205
206
  end
206
207
  end
207
208
  end
208
209
 
209
210
  def admonition_attrs(node)
210
- attr_code(super.merge("unnumbered": node.option?("unnumbered"),
211
- "subsequence": node.attr("subsequence")))
211
+ attr_code(super.merge(unnumbered: node.option?("unnumbered"),
212
+ subsequence: node.attr("subsequence")))
212
213
  end
213
214
 
214
215
  def sectiontype_streamline(ret)
215
216
  case ret
216
- when "foreword" then "donotrecognise-foreword"
217
- when "introduction" then "donotrecognise-foreword"
217
+ when "foreword", "introduction" then "donotrecognise-foreword"
218
218
  else
219
219
  super
220
220
  end
@@ -32,6 +32,18 @@
32
32
  <ref name="DocumentType"/>
33
33
  </element>
34
34
  </define>
35
+ <define name="section-title">
36
+ <element name="title">
37
+ <zeroOrMore>
38
+ <ref name="TextElement"/>
39
+ </zeroOrMore>
40
+ </element>
41
+ <zeroOrMore>
42
+ <element name="variant-title">
43
+ <ref name="TypedTitleString"/>
44
+ </element>
45
+ </zeroOrMore>
46
+ </define>
35
47
  <define name="hyperlink">
36
48
  <element name="link">
37
49
  <attribute name="target">
@@ -158,15 +170,17 @@
158
170
  <data type="boolean"/>
159
171
  </attribute>
160
172
  </optional>
161
- <attribute name="type">
162
- <choice>
163
- <value>roman</value>
164
- <value>alphabet</value>
165
- <value>arabic</value>
166
- <value>roman_upper</value>
167
- <value>alphabet_upper</value>
168
- </choice>
169
- </attribute>
173
+ <optional>
174
+ <attribute name="type">
175
+ <choice>
176
+ <value>roman</value>
177
+ <value>alphabet</value>
178
+ <value>arabic</value>
179
+ <value>roman_upper</value>
180
+ <value>alphabet_upper</value>
181
+ </choice>
182
+ </attribute>
183
+ </optional>
170
184
  <oneOrMore>
171
185
  <ref name="li"/>
172
186
  </oneOrMore>
@@ -13,11 +13,10 @@ module Asciidoctor
13
13
  def stage_validate(xmldoc)
14
14
  stage = xmldoc&.at("//bibdata/status/stage")&.text
15
15
  %w(proposal working-draft committee-draft draft-standard final-draft
16
- published withdrawn).include? stage or
17
- @log.add("Document Attributes", nil,
18
- "#{stage} is not a recognised status")
16
+ published withdrawn).include? stage or
17
+ @log.add("Document Attributes", nil,
18
+ "#{stage} is not a recognised status")
19
19
  end
20
20
  end
21
21
  end
22
22
  end
23
-
@@ -8,4 +8,3 @@ module IsoDoc
8
8
  end
9
9
  end
10
10
  end
11
-
@@ -11,7 +11,7 @@ module IsoDoc
11
11
  @meta.set(:toc, @toc)
12
12
  end
13
13
 
14
- def xref_init(lang, script, klass, labels, options)
14
+ def xref_init(lang, script, _klass, labels, options)
15
15
  html = HtmlConvert.new(language: lang, script: script)
16
16
  @xrefs = Xref.new(lang, script, html, labels, options)
17
17
  end
@@ -26,4 +26,3 @@ module IsoDoc
26
26
  end
27
27
  end
28
28
  end
29
-
@@ -160,7 +160,7 @@
160
160
  <fo:block>
161
161
  <xsl:value-of select="translate(/un:un-standard/un:sections/un:clause[1]/un:ol[1]/un:li[1]/un:p[1], '.', '')"/>
162
162
  </fo:block>
163
- <fo:block><xsl:value-of select="$title"/></fo:block>
163
+ <fo:block role="H1"><xsl:value-of select="$title"/></fo:block>
164
164
  </fo:block>
165
165
  </fo:block-container>
166
166
 
@@ -485,7 +485,10 @@
485
485
  </xsl:template>
486
486
 
487
487
  <xsl:template match="un:title" mode="inline-header">
488
- <fo:inline>
488
+ <xsl:variable name="level">
489
+ <xsl:call-template name="getLevel"/>
490
+ </xsl:variable>
491
+ <fo:inline role="H{$level}">
489
492
  <xsl:apply-templates/>
490
493
  </fo:inline>
491
494
  </xsl:template>
@@ -715,8 +718,9 @@
715
718
  <xsl:otherwise>11pt</xsl:otherwise>
716
719
  </xsl:choose>
717
720
  </xsl:variable>
718
- <fo:block font-size="{$font-size}" font-weight="bold" margin-top="3pt" margin-bottom="16pt" keep-with-next="always">
721
+ <fo:block font-size="{$font-size}" font-weight="bold" margin-top="3pt" margin-bottom="16pt" keep-with-next="always" role="H{$level}">
719
722
  <xsl:apply-templates/>
723
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
720
724
  </fo:block>
721
725
  </xsl:template>
722
726
 
@@ -734,15 +738,17 @@
734
738
  </xsl:variable>
735
739
  <xsl:choose>
736
740
  <xsl:when test="$level = 1">
737
- <fo:block font-size="{$font-size}" font-weight="bold" space-before="3pt" keep-with-next="always">
741
+ <fo:block font-size="{$font-size}" font-weight="bold" space-before="3pt" keep-with-next="always" role="H{$level}">
738
742
  <fo:block margin-bottom="12pt">
739
743
  <xsl:apply-templates/>
744
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
740
745
  </fo:block>
741
746
  </fo:block>
742
747
  </xsl:when>
743
748
  <xsl:otherwise>
744
- <fo:block font-size="{$font-size}" font-weight="bold" margin-left="1mm" space-before="3pt" margin-bottom="6pt" keep-with-next="always">
749
+ <fo:block font-size="{$font-size}" font-weight="bold" margin-left="1mm" space-before="3pt" margin-bottom="6pt" keep-with-next="always" role="H{$level}">
745
750
  <xsl:apply-templates/>
751
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
746
752
  </fo:block>
747
753
  </xsl:otherwise>
748
754
  </xsl:choose>
@@ -769,7 +775,7 @@
769
775
  <xsl:choose>
770
776
  <xsl:when test="ancestor::un:sections and $level = 1">
771
777
  <fo:block-container margin-left="-16mm">
772
- <fo:block font-size="{$font-size}" font-weight="bold" margin-left="16mm" space-before="16pt" margin-bottom="13pt" keep-with-next="always">
778
+ <fo:block font-size="{$font-size}" font-weight="bold" margin-left="16mm" space-before="16pt" margin-bottom="13pt" keep-with-next="always" role="H{$level}">
773
779
  <fo:table table-layout="fixed" width="100%">
774
780
  <fo:table-column column-width="16mm"/>
775
781
  <fo:table-column column-width="130mm"/>
@@ -788,6 +794,7 @@
788
794
  <fo:table-cell>
789
795
  <fo:block>
790
796
  <xsl:call-template name="extractTitle"/>
797
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
791
798
  </fo:block>
792
799
  </fo:table-cell>
793
800
  </fo:table-row>
@@ -797,7 +804,7 @@
797
804
  </fo:block-container>
798
805
  </xsl:when>
799
806
  <xsl:when test="ancestor::un:sections">
800
- <fo:block font-size="{$font-size}" font-weight="bold" space-before="16pt" margin-bottom="13pt" text-indent="-8mm" keep-with-next="always">
807
+ <fo:block font-size="{$font-size}" font-weight="bold" space-before="16pt" margin-bottom="13pt" text-indent="-8mm" keep-with-next="always" role="H{$level}">
801
808
  <xsl:if test="$level = 2">
802
809
  <xsl:attribute name="margin-left">1mm</xsl:attribute>
803
810
  <xsl:attribute name="space-before">12pt</xsl:attribute>
@@ -814,8 +821,9 @@
814
821
  </fo:block>
815
822
  </xsl:when>
816
823
  <xsl:otherwise>
817
- <fo:block font-size="{$font-size}" font-weight="bold" text-align="left" keep-with-next="always">
824
+ <fo:block font-size="{$font-size}" font-weight="bold" text-align="left" keep-with-next="always" role="H{$level}">
818
825
  <xsl:apply-templates/>
826
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
819
827
  </fo:block>
820
828
  </xsl:otherwise>
821
829
  </xsl:choose>
@@ -1046,26 +1054,26 @@
1046
1054
  <!-- ============================ -->
1047
1055
 
1048
1056
  <xsl:template name="insertHeaderFooter">
1049
- <fo:static-content flow-name="header-odd">
1057
+ <fo:static-content flow-name="header-odd" role="artifact">
1050
1058
  <fo:block-container height="25mm" display-align="after" border-bottom="0.5pt solid black" margin-left="-20.5mm" margin-right="-20.5mm">
1051
1059
  <fo:block font-size="9pt" font-weight="bold" text-align="right" margin-left="21mm" margin-right="21mm" padding-bottom="0.5mm">
1052
1060
  <xsl:value-of select="$id"/>
1053
1061
  </fo:block>
1054
1062
  </fo:block-container>
1055
1063
  </fo:static-content>
1056
- <fo:static-content flow-name="footer-odd">
1064
+ <fo:static-content flow-name="footer-odd" role="artifact">
1057
1065
  <fo:block-container height="40mm" margin-left="-20.5mm" margin-right="-20.5mm">
1058
1066
  <fo:block font-size="9pt" font-weight="bold" text-align="right" margin-left="21mm" margin-right="21mm" padding-top="12mm"><fo:page-number/></fo:block>
1059
1067
  </fo:block-container>
1060
1068
  </fo:static-content>
1061
- <fo:static-content flow-name="header-even">
1069
+ <fo:static-content flow-name="header-even" role="artifact">
1062
1070
  <fo:block-container height="25mm" display-align="after" border-bottom="0.5pt solid black" margin-left="-20.5mm" margin-right="-20.5mm">
1063
1071
  <fo:block font-size="9pt" font-weight="bold" margin-left="21mm" margin-right="21mm" padding-bottom="0.5mm">
1064
1072
  <xsl:value-of select="$id"/>
1065
1073
  </fo:block>
1066
1074
  </fo:block-container>
1067
1075
  </fo:static-content>
1068
- <fo:static-content flow-name="footer-even">
1076
+ <fo:static-content flow-name="footer-even" role="artifact">
1069
1077
  <fo:block-container height="40mm" margin-left="-20.5mm" margin-right="-20.5mm">
1070
1078
  <fo:block font-size="9pt" font-weight="bold" margin-left="21mm" margin-right="21mm" padding-top="12mm"><fo:page-number/></fo:block>
1071
1079
  </fo:block-container>
@@ -1271,6 +1279,7 @@
1271
1279
  </xsl:attribute-set><xsl:attribute-set name="sourcecode-style">
1272
1280
  <xsl:attribute name="white-space">pre</xsl:attribute>
1273
1281
  <xsl:attribute name="wrap-option">wrap</xsl:attribute>
1282
+ <xsl:attribute name="role">Code</xsl:attribute>
1274
1283
 
1275
1284
 
1276
1285
 
@@ -1296,8 +1305,13 @@
1296
1305
 
1297
1306
  </xsl:attribute-set><xsl:attribute-set name="requirement-label-style">
1298
1307
 
1299
- </xsl:attribute-set><xsl:attribute-set name="requirement-subject-style">
1300
- </xsl:attribute-set><xsl:attribute-set name="requirement-inherit-style">
1308
+ </xsl:attribute-set><xsl:attribute-set name="subject-style">
1309
+ </xsl:attribute-set><xsl:attribute-set name="inherit-style">
1310
+ </xsl:attribute-set><xsl:attribute-set name="description-style">
1311
+ </xsl:attribute-set><xsl:attribute-set name="specification-style">
1312
+ </xsl:attribute-set><xsl:attribute-set name="measurement-target-style">
1313
+ </xsl:attribute-set><xsl:attribute-set name="verification-style">
1314
+ </xsl:attribute-set><xsl:attribute-set name="import-style">
1301
1315
  </xsl:attribute-set><xsl:attribute-set name="recommendation-style">
1302
1316
 
1303
1317
 
@@ -1497,7 +1511,8 @@
1497
1511
 
1498
1512
 
1499
1513
 
1500
- </xsl:attribute-set><xsl:attribute-set name="quote-style">
1514
+ </xsl:attribute-set><xsl:attribute-set name="quote-style">
1515
+ <xsl:attribute name="role">BlockQuote</xsl:attribute>
1501
1516
 
1502
1517
 
1503
1518
 
@@ -1688,7 +1703,9 @@
1688
1703
 
1689
1704
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
1690
1705
 
1691
-
1706
+
1707
+
1708
+
1692
1709
 
1693
1710
  <xsl:call-template name="fn_name_display"/>
1694
1711
 
@@ -3575,16 +3592,68 @@
3575
3592
  <xsl:with-param name="isDeleted" select="$isDeleted"/>
3576
3593
  </xsl:call-template>
3577
3594
 
3595
+
3596
+
3578
3597
  <xsl:variable name="mathml">
3579
3598
  <xsl:apply-templates select="." mode="mathml"/>
3580
3599
  </xsl:variable>
3581
3600
  <fo:instream-foreign-object fox:alt-text="Math">
3582
3601
 
3583
3602
 
3603
+ <xsl:variable name="comment_text_following" select="following-sibling::node()[1][self::comment()]"/>
3604
+ <xsl:variable name="comment_text_">
3605
+ <xsl:choose>
3606
+ <xsl:when test="normalize-space($comment_text_following) != ''">
3607
+ <xsl:value-of select="$comment_text_following"/>
3608
+ </xsl:when>
3609
+ <xsl:otherwise>
3610
+ <xsl:value-of select="normalize-space(translate(.,' ⁢',' '))"/>
3611
+ </xsl:otherwise>
3612
+ </xsl:choose>
3613
+ </xsl:variable>
3614
+ <xsl:variable name="comment_text" select="java:org.metanorma.fop.Util.unescape($comment_text_)"/>
3615
+
3616
+ <xsl:if test="normalize-space($comment_text) != ''">
3617
+ <!-- put Mathin Alternate Text -->
3618
+ <xsl:attribute name="fox:alt-text">
3619
+ <xsl:value-of select="java:org.metanorma.fop.Util.unescape($comment_text)"/>
3620
+ </xsl:attribute>
3621
+ </xsl:if>
3622
+
3623
+ <xsl:variable name="mathml_content">
3624
+ <xsl:apply-templates select="." mode="mathml_actual_text"/>
3625
+ </xsl:variable>
3626
+ <!-- put MathML in Actual Text -->
3627
+ <xsl:attribute name="fox:actual-text">
3628
+ <xsl:value-of select="$mathml_content"/>
3629
+ </xsl:attribute>
3630
+
3631
+
3584
3632
  <!-- <xsl:copy-of select="."/> -->
3585
3633
  <xsl:copy-of select="xalan:nodeset($mathml)"/>
3586
3634
  </fo:instream-foreign-object>
3587
3635
  </fo:inline>
3636
+ </xsl:template><xsl:template match="mathml:*" mode="mathml_actual_text">
3637
+ <!-- <xsl:text>a+b</xsl:text> -->
3638
+ <xsl:text>&lt;</xsl:text>
3639
+ <xsl:value-of select="local-name()"/>
3640
+ <xsl:if test="local-name() = 'math'">
3641
+ <xsl:text> xmlns="http://www.w3.org/1998/Math/MathML"</xsl:text>
3642
+ </xsl:if>
3643
+ <xsl:for-each select="@*">
3644
+ <xsl:text> </xsl:text>
3645
+ <xsl:value-of select="local-name()"/>
3646
+ <xsl:text>="</xsl:text>
3647
+ <xsl:value-of select="."/>
3648
+ <xsl:text>"</xsl:text>
3649
+ </xsl:for-each>
3650
+ <xsl:text>&gt;</xsl:text>
3651
+ <xsl:apply-templates mode="mathml_actual_text"/>
3652
+ <xsl:text>&lt;/</xsl:text>
3653
+ <xsl:value-of select="local-name()"/>
3654
+ <xsl:text>&gt;</xsl:text>
3655
+ </xsl:template><xsl:template match="text()" mode="mathml_actual_text">
3656
+ <xsl:value-of select="normalize-space()"/>
3588
3657
  </xsl:template><xsl:template match="@*|node()" mode="mathml">
3589
3658
  <xsl:copy>
3590
3659
  <xsl:apply-templates select="@*|node()" mode="mathml"/>
@@ -3646,7 +3715,10 @@
3646
3715
  </fo:block>
3647
3716
  <xsl:apply-templates/>
3648
3717
  </xsl:template><xsl:template match="*[local-name()='appendix']/*[local-name()='title']"/><xsl:template match="*[local-name()='appendix']/*[local-name()='title']" mode="process">
3649
- <fo:inline><xsl:apply-templates/></fo:inline>
3718
+ <xsl:variable name="level">
3719
+ <xsl:call-template name="getLevel"/>
3720
+ </xsl:variable>
3721
+ <fo:inline role="H{$level}"><xsl:apply-templates/></fo:inline>
3650
3722
  </xsl:template><xsl:template match="*[local-name()='appendix']//*[local-name()='example']" priority="2">
3651
3723
  <fo:block id="{@id}" xsl:use-attribute-sets="appendix-example-style">
3652
3724
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -3681,9 +3753,10 @@
3681
3753
 
3682
3754
  </xsl:variable>
3683
3755
 
3756
+ <xsl:variable name="text"><xsl:apply-templates/></xsl:variable>
3684
3757
  <xsl:choose>
3685
- <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:text>—</xsl:text></xsl:when>
3686
- <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:text> — </xsl:text></xsl:otherwise>
3758
+ <xsl:when test="$lang = 'zh'"><xsl:text>、</xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text>—</xsl:text></xsl:if></xsl:when>
3759
+ <xsl:otherwise><xsl:text>, </xsl:text><xsl:value-of select="$title-modified"/><xsl:if test="normalize-space($text) != ''"><xsl:text> — </xsl:text></xsl:if></xsl:otherwise>
3687
3760
  </xsl:choose>
3688
3761
  <xsl:apply-templates/>
3689
3762
  </xsl:template><xsl:template match="*[local-name() = 'xref']">
@@ -3840,7 +3913,10 @@
3840
3913
  </fo:block>
3841
3914
  </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
3842
3915
  <xsl:if test="normalize-space() != ''">
3843
- <fo:inline>
3916
+ <xsl:variable name="level">
3917
+ <xsl:call-template name="getLevelTermName"/>
3918
+ </xsl:variable>
3919
+ <fo:inline role="H{$level}">
3844
3920
  <xsl:apply-templates/>
3845
3921
  <!-- <xsl:if test="$namespace = 'gb' or $namespace = 'ogc'">
3846
3922
  <xsl:text>.</xsl:text>
@@ -4471,6 +4547,7 @@
4471
4547
  </xsl:when>
4472
4548
  <xsl:otherwise>
4473
4549
  <xsl:apply-templates/>
4550
+ <xsl:apply-templates select="following-sibling::*[1][local-name() = 'variant-title'][@type = 'sub']" mode="subtitle"/>
4474
4551
  </xsl:otherwise>
4475
4552
  </xsl:choose>
4476
4553
  </fo:block>
@@ -4611,14 +4688,6 @@
4611
4688
  <fo:block>
4612
4689
  <fo:inline padding-right="3mm">Obligation</fo:inline><xsl:value-of select="."/>
4613
4690
  </fo:block>
4614
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
4615
- <fo:block xsl:use-attribute-sets="requirement-subject-style">
4616
- <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4617
- </fo:block>
4618
- </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'inherit']">
4619
- <fo:block xsl:use-attribute-sets="requirement-inherit-style">
4620
- <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
4621
- </fo:block>
4622
4691
  </xsl:template><xsl:template match="*[local-name() = 'recommendation']">
4623
4692
  <fo:block id="{@id}" xsl:use-attribute-sets="recommendation-style">
4624
4693
  <xsl:apply-templates select="*[local-name()='name']" mode="presentation"/>
@@ -4635,6 +4704,38 @@
4635
4704
  <fo:block xsl:use-attribute-sets="recommendation-label-style">
4636
4705
  <xsl:apply-templates/>
4637
4706
  </fo:block>
4707
+ </xsl:template><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" priority="2"/><xsl:template match="*[local-name() = 'requirement']/*[local-name() = 'subject']" mode="presentation">
4708
+ <fo:block xsl:use-attribute-sets="subject-style">
4709
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4710
+ </fo:block>
4711
+ </xsl:template><xsl:template match="*[local-name() = 'subject']">
4712
+ <fo:block xsl:use-attribute-sets="subject-style">
4713
+ <xsl:text>Target Type </xsl:text><xsl:apply-templates/>
4714
+ </fo:block>
4715
+ </xsl:template><xsl:template match="*[local-name() = 'inherit'] | *[local-name() = 'component'][@class = 'inherit']">
4716
+ <fo:block xsl:use-attribute-sets="inherit-style">
4717
+ <xsl:text>Dependency </xsl:text><xsl:apply-templates/>
4718
+ </fo:block>
4719
+ </xsl:template><xsl:template match="*[local-name() = 'description'] | *[local-name() = 'component'][@class = 'description']">
4720
+ <fo:block xsl:use-attribute-sets="description-style">
4721
+ <xsl:apply-templates/>
4722
+ </fo:block>
4723
+ </xsl:template><xsl:template match="*[local-name() = 'specification'] | *[local-name() = 'component'][@class = 'specification']">
4724
+ <fo:block xsl:use-attribute-sets="specification-style">
4725
+ <xsl:apply-templates/>
4726
+ </fo:block>
4727
+ </xsl:template><xsl:template match="*[local-name() = 'measurement-target'] | *[local-name() = 'component'][@class = 'measurement-target']">
4728
+ <fo:block xsl:use-attribute-sets="measurement-target-style">
4729
+ <xsl:apply-templates/>
4730
+ </fo:block>
4731
+ </xsl:template><xsl:template match="*[local-name() = 'verification'] | *[local-name() = 'component'][@class = 'verification']">
4732
+ <fo:block xsl:use-attribute-sets="verification-style">
4733
+ <xsl:apply-templates/>
4734
+ </fo:block>
4735
+ </xsl:template><xsl:template match="*[local-name() = 'import'] | *[local-name() = 'component'][@class = 'import']">
4736
+ <fo:block xsl:use-attribute-sets="import-style">
4737
+ <xsl:apply-templates/>
4738
+ </fo:block>
4638
4739
  </xsl:template><xsl:template match="*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
4639
4740
  <fo:block-container margin-left="0mm" margin-right="0mm" margin-bottom="12pt">
4640
4741
  <xsl:if test="ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']">
@@ -5507,6 +5608,9 @@
5507
5608
  <fo:block-container border="1pt solid black" width="50%">
5508
5609
  <fo:block> </fo:block>
5509
5610
  </fo:block-container>
5611
+ </xsl:template><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']"/><xsl:template match="*[local-name() = 'variant-title'][@type = 'sub']" mode="subtitle">
5612
+ <fo:inline padding-right="5mm"> </fo:inline>
5613
+ <fo:inline><xsl:apply-templates/></fo:inline>
5510
5614
  </xsl:template><xsl:template name="convertDate">
5511
5615
  <xsl:param name="date"/>
5512
5616
  <xsl:param name="format" select="'short'"/>
@@ -5745,6 +5849,26 @@
5745
5849
  <xsl:value-of select="$level"/>
5746
5850
  </xsl:otherwise>
5747
5851
  </xsl:choose>
5852
+ </xsl:template><xsl:template name="getLevelTermName">
5853
+ <xsl:choose>
5854
+ <xsl:when test="normalize-space(../@depth) != ''">
5855
+ <xsl:value-of select="../@depth"/>
5856
+ </xsl:when>
5857
+ <xsl:otherwise>
5858
+ <xsl:variable name="title_level_">
5859
+ <xsl:for-each select="../preceding-sibling::*[local-name() = 'title'][1]">
5860
+ <xsl:call-template name="getLevel"/>
5861
+ </xsl:for-each>
5862
+ </xsl:variable>
5863
+ <xsl:variable name="title_level" select="normalize-space($title_level_)"/>
5864
+ <xsl:choose>
5865
+ <xsl:when test="$title_level != ''"><xsl:value-of select="$title_level + 1"/></xsl:when>
5866
+ <xsl:otherwise>
5867
+ <xsl:call-template name="getLevel"/>
5868
+ </xsl:otherwise>
5869
+ </xsl:choose>
5870
+ </xsl:otherwise>
5871
+ </xsl:choose>
5748
5872
  </xsl:template><xsl:template name="split">
5749
5873
  <xsl:param name="pText" select="."/>
5750
5874
  <xsl:param name="sep" select="','"/>