metanorma-iso 1.10.0 → 1.10.1

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: 80f036674b2fadf0f45d564dee4050674cf69babf4d88c6ee84986e82ed8a5ce
4
- data.tar.gz: 491de6c6a6b92a4ce05212833f6acd5e2de4094973e4f8e3c44e2981ca983fce
3
+ metadata.gz: 24633dfc813afd54d496d125ac4cc7ffdb4e11b9a2958437033c0cfe57ea7873
4
+ data.tar.gz: b3995300f75025e162a31b28aa2aea9ebfdb3fd791928d622ee9fea264948a63
5
5
  SHA512:
6
- metadata.gz: d08a1c0909b6c0c0fafa0748132851eea415c110d6ce6bac821364df0a5c257adf30d3a86649ee2ed9d92a8dec6f1986fccfa39414aaf1a376f1a9e057ea6659
7
- data.tar.gz: 21fda2fe4ceec7d933d3f960dc19b4a2758e4e8cf4aa713e65da4e66d1447d55b34e08fe150dea6abd4d0c2c5e18d1d4acd961fc5200d3c632167278fe62348f
6
+ metadata.gz: 1d495eb4e4758f85053f888027b8776048ed4e1c2f1c0ee5f87a5dda4214fcfe85d2d490947633a8889cf9aa8db48dcd42eb319e1ae63abb5cf3901fec9cb789
7
+ data.tar.gz: c4472ab5da3868ccf1331e6ff1879218a5e5e515128f3733d1ef32dcc8b4fec5b5855d5712c03ac950c67b4a7e0ccdf452da1b4fba9c6f61907b9ed40b0867e3
@@ -0,0 +1,41 @@
1
+ name: ubuntu
2
+
3
+ on:
4
+ push:
5
+ branches:
6
+ - main
7
+ pull_request:
8
+
9
+ jobs:
10
+ build:
11
+ runs-on: ubuntu-latest
12
+ steps:
13
+ - uses: actions/checkout@v2
14
+
15
+ - name: Setup prerequisites
16
+ run: |
17
+ sudo apt-get update
18
+ sudo apt-get -y install xsltproc
19
+
20
+ - run: make xsd_doc
21
+ env:
22
+ GITHUB_USERNAME: ${{ github.actor }}
23
+ GITHUB_TOKEN: ${{ github.token }}
24
+
25
+ - uses: actions/upload-artifact@master
26
+ with:
27
+ name: xsd_doc
28
+ path: xsd_doc
29
+
30
+ deploy-gh-pages:
31
+ if: github.ref == 'refs/heads/main'
32
+ runs-on: ubuntu-latest
33
+ needs: build
34
+ steps:
35
+ - uses: actions/checkout@master
36
+
37
+ - uses: actions/download-artifact@master
38
+ with:
39
+ name: xsd_doc-ubuntu
40
+ path: xsd_doc
41
+
data/Gemfile CHANGED
@@ -4,11 +4,10 @@ Encoding.default_internal = Encoding::UTF_8
4
4
  source "https://rubygems.org"
5
5
  git_source(:github) { |repo| "https://github.com/#{repo}" }
6
6
 
7
- #gem "asciimath", git: "https://github.com/asciidoctor/asciimath"
7
+ # gem "asciimath", git: "https://github.com/asciidoctor/asciimath"
8
8
 
9
9
  gemspec
10
10
 
11
- if File.exist? 'Gemfile.devel'
12
- eval File.read('Gemfile.devel'), nil, 'Gemfile.devel' # rubocop:disable Security/Eval
11
+ if File.exist? "Gemfile.devel"
12
+ eval File.read("Gemfile.devel"), nil, "Gemfile.devel" # rubocop:disable Security/Eval
13
13
  end
14
-
data/Makefile CHANGED
@@ -8,6 +8,15 @@ SHELL := /bin/bash
8
8
  # Ensure the xml2rfc cache directory exists locally
9
9
  IGNORE := $(shell mkdir -p $(HOME)/.cache/xml2rfc)
10
10
 
11
+ TRANG_RELEASE := https://github.com/relaxng/jing-trang/releases/download/V20181222/trang-20181222.zip
12
+ TOOLS_DIR := ${CURDIR}/tools
13
+ TRANG_JAR := $(TOOLS_DIR)/trang.jar
14
+ XSDVIPATH := $(TOOLS_DIR)/xsdvi.jar
15
+ XSLT_FILE := $(TOOLS_DIR)/xs3pxsl
16
+ XSLT_FILE_MERGE := $(TOOLS_DIR)/xsdmerge.xsl
17
+ RNG_FILE_SRC := lib/asciidoctor/iso/isostandard.rng
18
+ XSD_FILE_DEST := ${CURDIR}/xsd_doc/isostandard.xsd
19
+
11
20
  all: $(TXT) $(HTML) $(XML) $(NITS)
12
21
 
13
22
  clean:
@@ -37,3 +46,38 @@ clean:
37
46
  open:
38
47
  open *.txt
39
48
 
49
+
50
+ $(XSDVIPATH):
51
+ mkdir -p $(dir $@); \
52
+ curl -sSL https://sourceforge.net/projects/xsdvi/files/latest/download > $(dir $@)/xsdvi.zip; \
53
+ unzip -p $(dir $@)/xsdvi.zip dist/lib/xercesImpl.jar > $(dir $@)/xercesImpl.jar; \
54
+ curl -sSL https://github.com/metanorma/xsdvi/releases/download/v1.0/xsdvi-1.0.jar > $@
55
+
56
+ $(XSLT_FILE):
57
+ mkdir -p $(dir $@)
58
+ curl -sSL https://raw.githubusercontent.com/metanorma/xs3p/main/xsl/xs3p.xsl > $@
59
+
60
+ $(XSLT_FILE_MERGE):
61
+ mkdir -p $(dir $@)
62
+ curl -sSL https://raw.githubusercontent.com/metanorma/xs3p/main/xsl/xsdmerge.xsl > $@
63
+
64
+ $(TRANG_JAR):
65
+ mkdir -p $(dir $@); \
66
+ cd $(dir $@); \
67
+ curl -sSL $(TRANG_RELEASE) > trang.zip; \
68
+ unzip -p trang.zip trang-20181222/trang.jar > $@
69
+
70
+
71
+ $(XSD_FILE_DEST): $(TRANG_JAR)
72
+ mkdir -p $(dir $@); \
73
+ java -jar $< $(RNG_FILE_SRC) $@
74
+
75
+ xsd_doc: $(XSD_FILE_DEST) $(XSDVIPATH) $(XSLT_FILE) $(XSLT_FILE_MERGE)
76
+ mkdir -p $@/diagrams; \
77
+ cd $@; \
78
+ java -jar $(XSDVIPATH) $< -rootNodeName all -oneNodeOnly -outputPath diagrams; \
79
+ xsltproc --nonet --stringparam rootxsd iso-standard --output $@.tmp $(XSLT_FILE_MERGE) $<;\
80
+ xsltproc --nonet --param title "'Metanorma XML Schema Documentation, ISO Standard'" \
81
+ --output index.html $(XSLT_FILE) $@.tmp;\
82
+ rm $@.tmp
83
+
data/Rakefile CHANGED
@@ -1,6 +1,6 @@
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)
data/bin/rspec CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env ruby
2
-
2
+
3
3
  # This file was generated by Bundler.
4
4
  #
5
5
  # The application 'rspec' is installed as part of a gem, and
@@ -15,4 +15,3 @@ require "rubygems"
15
15
  require "bundler/setup"
16
16
 
17
17
  load Gem.bin_path("rspec-core", "rspec")
18
-
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
2
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
3
  <include href="biblio.rng">
4
4
  <start>
5
5
  <ref name="document"/>
@@ -19,6 +19,7 @@
19
19
  </define>
20
20
  <define name="bibdata">
21
21
  <element name="bibdata">
22
+ <a:documentation>Document attributes</a:documentation>
22
23
  <ref name="BibData"/>
23
24
  </element>
24
25
  </define>
@@ -104,10 +105,12 @@
104
105
  </define>
105
106
  <define name="paragraph">
106
107
  <element name="p">
108
+ <a:documentation>Paragraph</a:documentation>
107
109
  <ref name="ParagraphType"/>
108
110
  </element>
109
111
  </define>
110
112
  <define name="Alignments">
113
+ <a:documentation>Text alignment</a:documentation>
111
114
  <choice>
112
115
  <value>left</value>
113
116
  <value>right</value>
@@ -215,6 +218,7 @@
215
218
  </define>
216
219
  <define name="quote">
217
220
  <element name="quote">
221
+ <a:documentation>Block quotes</a:documentation>
218
222
  <attribute name="id">
219
223
  <data type="ID"/>
220
224
  </attribute>
@@ -249,6 +253,7 @@
249
253
  </define>
250
254
  <define name="sourcecode">
251
255
  <element name="sourcecode">
256
+ <a:documentation>Source code, a pre-formatted source snippet to be rendered in monospace font, and with spaces preserved</a:documentation>
252
257
  <attribute name="id">
253
258
  <data type="ID"/>
254
259
  </attribute>
@@ -1047,6 +1052,7 @@
1047
1052
  </define>
1048
1053
  <define name="ul">
1049
1054
  <element name="ul">
1055
+ <a:documentation>Unordered list</a:documentation>
1050
1056
  <attribute name="id">
1051
1057
  <data type="ID"/>
1052
1058
  </attribute>
@@ -1060,6 +1066,7 @@
1060
1066
  </define>
1061
1067
  <define name="li">
1062
1068
  <element name="li">
1069
+ <a:documentation>List item</a:documentation>
1063
1070
  <optional>
1064
1071
  <attribute name="id">
1065
1072
  <data type="ID"/>
@@ -1097,6 +1104,7 @@
1097
1104
  </define>
1098
1105
  <define name="dl">
1099
1106
  <element name="dl">
1107
+ <a:documentation>Definition list</a:documentation>
1100
1108
  <attribute name="id">
1101
1109
  <data type="ID"/>
1102
1110
  </attribute>
@@ -1111,6 +1119,7 @@
1111
1119
  </define>
1112
1120
  <define name="dt">
1113
1121
  <element name="dt">
1122
+ <a:documentation>Definition term</a:documentation>
1114
1123
  <zeroOrMore>
1115
1124
  <ref name="TextElement"/>
1116
1125
  </zeroOrMore>
@@ -1118,6 +1127,7 @@
1118
1127
  </define>
1119
1128
  <define name="dd">
1120
1129
  <element name="dd">
1130
+ <a:documentation>Definition description</a:documentation>
1121
1131
  <zeroOrMore>
1122
1132
  <ref name="paragraph-with-footnote"/>
1123
1133
  </zeroOrMore>
@@ -76,12 +76,14 @@
76
76
  <define name="script">
77
77
  <a:documentation>ISO-639</a:documentation>
78
78
  <element name="script">
79
+ <a:documentation>ISO-639</a:documentation>
79
80
  <text/>
80
81
  </element>
81
82
  </define>
82
83
  <define name="edition">
83
84
  <a:documentation>ISO-15924: Latn</a:documentation>
84
85
  <element name="edition">
86
+ <a:documentation>ISO-15924: Latn</a:documentation>
85
87
  <optional>
86
88
  <attribute name="number"/>
87
89
  </optional>
@@ -8,7 +8,7 @@ module Asciidoctor
8
8
  module ISO
9
9
  class Converter < Standoc::Converter
10
10
  PRE_NORMREF_FOOTNOTES = "//preface//fn | "\
11
- "//clause[@type = 'scope']//fn".freeze
11
+ "//clause[@type = 'scope']//fn".freeze
12
12
 
13
13
  NORMREF_FOOTNOTES =
14
14
  "//references[@normative = 'true']//fn".freeze
@@ -41,7 +41,7 @@ module Asciidoctor
41
41
  xmldoc.xpath("//bibdata/contributor[role/@type = 'publisher']"\
42
42
  "/organization").each do |x|
43
43
  x1 = x.at("abbreviation")&.text || x.at("name")&.text
44
- x1 == "ISO" and prefix.unshift("ISO") or prefix << x1
44
+ (x1 == "ISO" and prefix.unshift("ISO")) or prefix << x1
45
45
  end
46
46
  prefix
47
47
  end
@@ -64,14 +64,15 @@ module Asciidoctor
64
64
  super
65
65
  end
66
66
 
67
- TERM_CLAUSE = "//sections//terms | "\
67
+ TERM_CLAUSE =
68
+ "//sections//terms | "\
68
69
  "//sections//clause[descendant::terms][not(descendant::definitions)]"
69
- .freeze
70
+ .freeze
70
71
 
71
72
  PUBLISHER = "./contributor[role/@type = 'publisher']/organization".freeze
72
73
 
73
74
  OTHERIDS = "@type = 'DOI' or @type = 'metanorma' or @type = 'ISSN' or "\
74
- "@type = 'ISBN'".freeze
75
+ "@type = 'ISBN'".freeze
75
76
 
76
77
  def pub_class(bib)
77
78
  return 1 if bib.at("#{PUBLISHER}[abbreviation = 'ISO']")
@@ -111,7 +112,7 @@ module Asciidoctor
111
112
  bib&.at("./title")&.text || bib&.at("./formattedref")&.text
112
113
  "#{pubclass} :: #{type} :: "\
113
114
  "#{num.nil? ? abbrid : sprintf('%09d', num.to_i)} :: "\
114
- "#{partid} :: #{id&.text} :: #{title}"
115
+ "#{sprintf('%09d', partid.to_i)} :: #{id&.text} :: #{title}"
115
116
  end
116
117
 
117
118
  def sections_cleanup(xml)
@@ -194,6 +194,7 @@
194
194
  </optional>
195
195
  <optional>
196
196
  <attribute name="type">
197
+ <a:documentation>allow specifying labels of an ordered list</a:documentation>
197
198
  <choice>
198
199
  <value>roman</value>
199
200
  <value>alphabet</value>
@@ -2063,7 +2064,12 @@
2063
2064
  <define name="verbaldefinition">
2064
2065
  <element name="verbaldefinition">
2065
2066
  <oneOrMore>
2066
- <ref name="paragraph"/>
2067
+ <choice>
2068
+ <ref name="paragraph"/>
2069
+ <ref name="dl"/>
2070
+ <ref name="ol"/>
2071
+ <ref name="ul"/>
2072
+ </choice>
2067
2073
  </oneOrMore>
2068
2074
  <zeroOrMore>
2069
2075
  <ref name="termsource"/>
@@ -2163,6 +2169,12 @@
2163
2169
  <value>modified</value>
2164
2170
  </choice>
2165
2171
  </attribute>
2172
+ <attribute name="type">
2173
+ <choice>
2174
+ <value>authoritative</value>
2175
+ <value>lineage</value>
2176
+ </choice>
2177
+ </attribute>
2166
2178
  <ref name="origin"/>
2167
2179
  <optional>
2168
2180
  <ref name="modification"/>
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar ns="https://www.metanorma.org/ns/iso" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
2
+ <grammar ns="https://www.metanorma.org/ns/iso" xmlns="http://relaxng.org/ns/structure/1.0" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
3
  <!-- default namespace isostandard = "https://www.metanorma.com/ns/iso" -->
4
4
  <include href="isostandard.rng">
5
5
  <start>
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar ns="https://www.metanorma.org/ns/iso" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
2
+ <grammar ns="https://www.metanorma.org/ns/iso" xmlns="http://relaxng.org/ns/structure/1.0" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
3
  <!-- default namespace isostandard = "https://www.metanorma.com/ns/iso" -->
4
4
  <include href="isodoc.rng">
5
5
  <start>
@@ -359,6 +359,7 @@
359
359
  -->
360
360
  <define name="iso-standard">
361
361
  <element name="iso-standard">
362
+ <a:documentation>Root element for xml document</a:documentation>
362
363
  <attribute name="version"/>
363
364
  <attribute name="type">
364
365
  <choice>
@@ -469,6 +470,7 @@
469
470
  </define>
470
471
  <define name="annex-appendix">
471
472
  <element name="appendix">
473
+ <a:documentation>Appendix</a:documentation>
472
474
  <ref name="Clause-Section"/>
473
475
  </element>
474
476
  </define>
@@ -1,5 +1,5 @@
1
1
  <?xml version="1.0" encoding="UTF-8"?>
2
- <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
2
+ <grammar xmlns="http://relaxng.org/ns/structure/1.0" xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
3
3
  <!--
4
4
  Presupposes isodoc.rnc, is included in it
5
5
  include "isodoc.rnc" { }
@@ -1,16 +1,17 @@
1
1
  module IsoDoc
2
2
  module Iso
3
3
  class I18n < IsoDoc::I18n
4
+ def load_file(fname)
5
+ YAML.load_file(File.join(File.dirname(__FILE__), fname))
6
+ end
7
+
4
8
  def load_yaml1(lang, script)
5
- y = if lang == "en"
6
- YAML.load_file(File.join(File.dirname(__FILE__), "i18n-en.yaml"))
7
- elsif lang == "fr"
8
- YAML.load_file(File.join(File.dirname(__FILE__), "i18n-fr.yaml"))
9
- elsif lang == "zh" && script == "Hans"
10
- YAML.load_file(File.join(File.dirname(__FILE__), "i18n-zh-Hans.yaml"))
11
- else
12
- YAML.load_file(File.join(File.dirname(__FILE__), "i18n-en.yaml"))
13
- end
9
+ y = if lang == "en" then load_file("i18n-en.yaml")
10
+ elsif lang == "fr" then load_file("i18n-fr.yaml")
11
+ elsif lang == "zh" && script == "Hans"
12
+ load_file("i18n-zh-Hans.yaml")
13
+ else load_file("i18n-en.yaml")
14
+ end
14
15
  super.merge(y)
15
16
  end
16
17
  end
@@ -1798,7 +1798,7 @@
1798
1798
  </xsl:variable>
1799
1799
  <fo:block line-height="1.1" role="H{$levelTerm}">
1800
1800
  <fo:block font-weight="bold" keep-with-next="always">
1801
- <xsl:apply-templates select="ancestor::iso:term/iso:name" mode="presentation"/>
1801
+ <xsl:apply-templates select="ancestor::iso:term[1]/iso:name" mode="presentation"/>
1802
1802
  </fo:block>
1803
1803
  <fo:block font-weight="bold" keep-with-next="always">
1804
1804
  <xsl:apply-templates/>
@@ -4295,6 +4295,7 @@
4295
4295
  <fo:table-cell>
4296
4296
 
4297
4297
  <fo:block margin-top="6pt">
4298
+ <xsl:copy-of select="@id"/>
4298
4299
 
4299
4300
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
4300
4301
 
@@ -5141,14 +5142,20 @@
5141
5142
  </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'p']">
5142
5143
  <fo:inline><xsl:apply-templates/></fo:inline>
5143
5144
  </xsl:template><xsl:template match="*[local-name() = 'terms']">
5145
+ <!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
5144
5146
  <fo:block id="{@id}">
5145
5147
  <xsl:apply-templates/>
5146
5148
  </fo:block>
5147
5149
  </xsl:template><xsl:template match="*[local-name() = 'term']">
5150
+ <!-- <xsl:message>'term' <xsl:number/> processing, name=<xsl:value-of select="iso:name"/>, preferred=<xsl:value-of select="iso:preferred"/>...</xsl:message> -->
5148
5151
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
5149
5152
 
5150
5153
 
5151
-
5154
+ <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
5155
+
5156
+ <xsl:attribute name="space-before">12pt</xsl:attribute>
5157
+
5158
+ </xsl:if>
5152
5159
  <xsl:apply-templates/>
5153
5160
  </fo:block>
5154
5161
  </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
@@ -6122,7 +6129,8 @@
6122
6129
  </fo:block>
6123
6130
  </fo:table-cell>
6124
6131
  </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
6125
- <fo:block font-size="11pt" color="rgb(237, 193, 35)"> <!-- font-weight="bold" margin-bottom="4pt" text-align="center" -->
6132
+ <fo:block font-size="11pt">
6133
+
6126
6134
  <xsl:apply-templates/>
6127
6135
  </fo:block>
6128
6136
  </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
@@ -6243,13 +6251,15 @@
6243
6251
  <!-- <xsl:apply-templates /> -->
6244
6252
  <xsl:copy-of select="$termsource_text"/>
6245
6253
  </xsl:when>
6246
- <xsl:otherwise>
6254
+ <xsl:otherwise>
6255
+
6247
6256
 
6248
6257
  <xsl:text>[</xsl:text>
6249
6258
 
6250
6259
  <!-- <xsl:apply-templates /> -->
6251
6260
  <xsl:copy-of select="$termsource_text"/>
6252
6261
 
6262
+
6253
6263
  <xsl:text>]</xsl:text>
6254
6264
 
6255
6265
  </xsl:otherwise>
@@ -6331,12 +6341,20 @@
6331
6341
  </xsl:template><xsl:template match="*[local-name() = 'author']">
6332
6342
  <xsl:text>— </xsl:text>
6333
6343
  <xsl:apply-templates/>
6334
- </xsl:template><xsl:template match="*[local-name() = 'eref']">
6344
+ </xsl:template><xsl:variable name="bibitem_hidden_">
6345
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden='true']">
6346
+ <xsl:copy-of select="."/>
6347
+ </xsl:for-each>
6348
+ <xsl:for-each select="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem']">
6349
+ <xsl:copy-of select="."/>
6350
+ </xsl:for-each>
6351
+ </xsl:variable><xsl:variable name="bibitem_hidden" select="xalan:nodeset($bibitem_hidden_)"/><xsl:template match="*[local-name() = 'eref']">
6335
6352
 
6336
6353
  <xsl:variable name="bibitemid">
6337
6354
  <xsl:choose>
6338
- <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
6339
- <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
6355
+ <!-- <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"></xsl:when>
6356
+ <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"></xsl:when> -->
6357
+ <xsl:when test="$bibitem_hidden/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
6340
6358
  <xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
6341
6359
  </xsl:choose>
6342
6360
  </xsl:variable>
@@ -6425,10 +6443,10 @@
6425
6443
  </xsl:choose>
6426
6444
  </xsl:variable>
6427
6445
 
6428
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
6446
+ <!-- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/> -->
6429
6447
 
6430
6448
  <xsl:choose>
6431
- <xsl:when test="$language = 'zh'">
6449
+ <xsl:when test="$lang = 'zh'">
6432
6450
  <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
6433
6451
  </xsl:when>
6434
6452
  <xsl:when test="../../@inline-header = 'true'">
@@ -1798,7 +1798,7 @@
1798
1798
  </xsl:variable>
1799
1799
  <fo:block line-height="1.1" role="H{$levelTerm}">
1800
1800
  <fo:block font-weight="bold" keep-with-next="always">
1801
- <xsl:apply-templates select="ancestor::iso:term/iso:name" mode="presentation"/>
1801
+ <xsl:apply-templates select="ancestor::iso:term[1]/iso:name" mode="presentation"/>
1802
1802
  </fo:block>
1803
1803
  <fo:block font-weight="bold" keep-with-next="always">
1804
1804
  <xsl:apply-templates/>
@@ -4295,6 +4295,7 @@
4295
4295
  <fo:table-cell>
4296
4296
 
4297
4297
  <fo:block margin-top="6pt">
4298
+ <xsl:copy-of select="@id"/>
4298
4299
 
4299
4300
  <xsl:attribute name="margin-top">0pt</xsl:attribute>
4300
4301
 
@@ -5141,14 +5142,20 @@
5141
5142
  </xsl:template><xsl:template match="*[local-name() = 'termnote']/*[local-name() = 'p']">
5142
5143
  <fo:inline><xsl:apply-templates/></fo:inline>
5143
5144
  </xsl:template><xsl:template match="*[local-name() = 'terms']">
5145
+ <!-- <xsl:message>'terms' <xsl:number/> processing...</xsl:message> -->
5144
5146
  <fo:block id="{@id}">
5145
5147
  <xsl:apply-templates/>
5146
5148
  </fo:block>
5147
5149
  </xsl:template><xsl:template match="*[local-name() = 'term']">
5150
+ <!-- <xsl:message>'term' <xsl:number/> processing, name=<xsl:value-of select="iso:name"/>, preferred=<xsl:value-of select="iso:preferred"/>...</xsl:message> -->
5148
5151
  <fo:block id="{@id}" xsl:use-attribute-sets="term-style">
5149
5152
 
5150
5153
 
5151
-
5154
+ <xsl:if test="parent::*[local-name() = 'term'] and not(preceding-sibling::*[local-name() = 'term'])">
5155
+
5156
+ <xsl:attribute name="space-before">12pt</xsl:attribute>
5157
+
5158
+ </xsl:if>
5152
5159
  <xsl:apply-templates/>
5153
5160
  </fo:block>
5154
5161
  </xsl:template><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']"/><xsl:template match="*[local-name() = 'term']/*[local-name() = 'name']" mode="presentation">
@@ -6122,7 +6129,8 @@
6122
6129
  </fo:block>
6123
6130
  </fo:table-cell>
6124
6131
  </xsl:template><xsl:template match="*[local-name() = 'p'][@class='RecommendationTitle' or @class = 'RecommendationTestTitle']" priority="2">
6125
- <fo:block font-size="11pt" color="rgb(237, 193, 35)"> <!-- font-weight="bold" margin-bottom="4pt" text-align="center" -->
6132
+ <fo:block font-size="11pt">
6133
+
6126
6134
  <xsl:apply-templates/>
6127
6135
  </fo:block>
6128
6136
  </xsl:template><xsl:template match="*[local-name() = 'p2'][ancestor::*[local-name() = 'table'][@class = 'recommendation' or @class='requirement' or @class='permission']]">
@@ -6243,13 +6251,15 @@
6243
6251
  <!-- <xsl:apply-templates /> -->
6244
6252
  <xsl:copy-of select="$termsource_text"/>
6245
6253
  </xsl:when>
6246
- <xsl:otherwise>
6254
+ <xsl:otherwise>
6255
+
6247
6256
 
6248
6257
  <xsl:text>[</xsl:text>
6249
6258
 
6250
6259
  <!-- <xsl:apply-templates /> -->
6251
6260
  <xsl:copy-of select="$termsource_text"/>
6252
6261
 
6262
+
6253
6263
  <xsl:text>]</xsl:text>
6254
6264
 
6255
6265
  </xsl:otherwise>
@@ -6331,12 +6341,20 @@
6331
6341
  </xsl:template><xsl:template match="*[local-name() = 'author']">
6332
6342
  <xsl:text>— </xsl:text>
6333
6343
  <xsl:apply-templates/>
6334
- </xsl:template><xsl:template match="*[local-name() = 'eref']">
6344
+ </xsl:template><xsl:variable name="bibitem_hidden_">
6345
+ <xsl:for-each select="//*[local-name() = 'bibitem'][@hidden='true']">
6346
+ <xsl:copy-of select="."/>
6347
+ </xsl:for-each>
6348
+ <xsl:for-each select="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem']">
6349
+ <xsl:copy-of select="."/>
6350
+ </xsl:for-each>
6351
+ </xsl:variable><xsl:variable name="bibitem_hidden" select="xalan:nodeset($bibitem_hidden_)"/><xsl:template match="*[local-name() = 'eref']">
6335
6352
 
6336
6353
  <xsl:variable name="bibitemid">
6337
6354
  <xsl:choose>
6338
- <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"/>
6339
- <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
6355
+ <!-- <xsl:when test="//*[local-name() = 'bibitem'][@hidden='true' and @id = current()/@bibitemid]"></xsl:when>
6356
+ <xsl:when test="//*[local-name() = 'references'][@hidden='true']/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"></xsl:when> -->
6357
+ <xsl:when test="$bibitem_hidden/*[local-name() = 'bibitem'][@id = current()/@bibitemid]"/>
6340
6358
  <xsl:otherwise><xsl:value-of select="@bibitemid"/></xsl:otherwise>
6341
6359
  </xsl:choose>
6342
6360
  </xsl:variable>
@@ -6425,10 +6443,10 @@
6425
6443
  </xsl:choose>
6426
6444
  </xsl:variable>
6427
6445
 
6428
- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/>
6446
+ <!-- <xsl:variable name="language" select="//*[local-name()='bibdata']//*[local-name()='language']"/> -->
6429
6447
 
6430
6448
  <xsl:choose>
6431
- <xsl:when test="$language = 'zh'">
6449
+ <xsl:when test="$lang = 'zh'">
6432
6450
  <fo:inline><xsl:value-of select="$tab_zh"/></fo:inline>
6433
6451
  </xsl:when>
6434
6452
  <xsl:when test="../../@inline-header = 'true'">
@@ -49,12 +49,14 @@ module IsoDoc
49
49
 
50
50
  def foreword(isoxml, out)
51
51
  f = isoxml.at(ns("//foreword")) || return
52
+ @foreword = true
52
53
  page_break(out)
53
54
  out.div **attr_code(id: f["id"]) do |s|
54
55
  clause_name(nil, f.at(ns("./title")) || @i18n.foreword, s,
55
56
  { class: "ForewordTitle" })
56
57
  f.elements.each { |e| parse(e, s) unless e.name == "title" }
57
58
  end
59
+ @foreword = false
58
60
  end
59
61
  end
60
62
  end