metanorma-iso 1.9.6 → 1.10.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (47) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/ubuntu.yml +41 -0
  3. data/Gemfile +3 -4
  4. data/Makefile +44 -0
  5. data/Rakefile +1 -1
  6. data/bin/rspec +1 -2
  7. data/lib/asciidoctor/iso/cleanup.rb +7 -6
  8. data/lib/asciidoctor/iso/front.rb +2 -2
  9. data/lib/asciidoctor/iso/isodoc.rng +254 -27
  10. data/lib/asciidoctor/iso/section.rb +1 -1
  11. data/lib/asciidoctor/iso/validate.rb +7 -7
  12. data/lib/asciidoctor/iso/validate_section.rb +1 -1
  13. data/lib/isodoc/iso/html/isodoc.css +0 -1
  14. data/lib/isodoc/iso/html/isodoc.scss +0 -1
  15. data/lib/isodoc/iso/html/style-human.css +0 -1
  16. data/lib/isodoc/iso/html/style-human.scss +0 -1
  17. data/lib/isodoc/iso/html/style-iso.css +0 -1
  18. data/lib/isodoc/iso/html/style-iso.scss +0 -1
  19. data/lib/isodoc/iso/i18n.rb +10 -9
  20. data/lib/isodoc/iso/iso.amendment.xsl +57 -17
  21. data/lib/isodoc/iso/iso.international-standard.xsl +57 -17
  22. data/lib/isodoc/iso/isosts_convert.rb +6 -2
  23. data/lib/isodoc/iso/presentation_xml_convert.rb +19 -9
  24. data/lib/isodoc/iso/sections.rb +2 -0
  25. data/lib/isodoc/iso/sts_convert.rb +5 -2
  26. data/lib/isodoc/iso/word_cleanup.rb +94 -0
  27. data/lib/isodoc/iso/word_convert.rb +12 -89
  28. data/lib/metanorma/iso/processor.rb +2 -2
  29. data/lib/metanorma/iso/version.rb +1 -1
  30. data/metanorma-iso.gemspec +4 -5
  31. data/spec/asciidoctor/base_spec.rb +543 -209
  32. data/spec/asciidoctor/blocks_spec.rb +22 -47
  33. data/spec/asciidoctor/cleanup_spec.rb +37 -20
  34. data/spec/asciidoctor/inline_spec.rb +10 -2
  35. data/spec/asciidoctor/refs_spec.rb +174 -88
  36. data/spec/asciidoctor/section_spec.rb +3 -3
  37. data/spec/isodoc/i18n_spec.rb +36 -22
  38. data/spec/isodoc/inline_spec.rb +6 -6
  39. data/spec/isodoc/section_spec.rb +4 -4
  40. data/spec/isodoc/table_spec.rb +6 -8
  41. data/spec/isodoc/terms_spec.rb +25 -25
  42. data/spec/isodoc/xref_spec.rb +1397 -1376
  43. data/spec/metanorma/processor_spec.rb +114 -15
  44. data/spec/spec_helper.rb +2 -1
  45. data/spec/vcr_cassettes/docrels.yml +427 -37
  46. data/spec/vcr_cassettes/sortrefs.yml +599 -0
  47. metadata +13 -24
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b9ee078ae53c881c7b83242412a6adb7e238e5b471119280c22edc6f7b45a71e
4
- data.tar.gz: 553430cda221363dbcef14070bba64f214b2269dd4b4d5e52927e574ffae2f4d
3
+ metadata.gz: 496766841b7e48e3e2f8f879f5e9c485b0874212ea6316a926558ba434f1636a
4
+ data.tar.gz: 24bc39c4fdf29b8dfeaba19a972d8a2d2610d940b6b9afb93da58975c8bd6ac3
5
5
  SHA512:
6
- metadata.gz: acd0cd92b131c86e859891c63d26dc2ef6e093a26667350f90b6a2ade3062e33737c154f732f7cbe6b4e82ced031e368641fa06ff9acb825ff17abf1546dedcf
7
- data.tar.gz: 43082f2a384ad764599231c6b0378c3d5df8ba74a3db9209e9d7341c76f74700f23260689aa65287a7c889f777a4c66359c568a66180e332959d00ffa17b7bda
6
+ metadata.gz: 2a780fb001362017bf69e8b64ca78eb9c877d20c7bed50670d69fbf9f7a71c40756725e272e3baa0cc9d026c4809cbb222a466f0f9b77b30fe35afbdc9038d60
7
+ data.tar.gz: 9db3e3c657f3d5525e2407cc27c498bffbda194dcf06199e49def7a540af8a70755e1f6ff2b4465af09ea9440ffae9a106a965ba2e6696363774faf3bbab7004
@@ -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
-
@@ -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)
@@ -18,8 +18,8 @@ module Asciidoctor
18
18
  xml.updates_document_type a
19
19
  end
20
20
 
21
- def metadata_doctype(node, xml)
22
- xml.doctype doctype(node)
21
+ def metadata_subdoctype(node, xml)
22
+ super
23
23
  a = node.attr("horizontal") and xml.horizontal a
24
24
  end
25
25
 
@@ -17,7 +17,7 @@
17
17
  these elements; we just want one namespace for any child grammars
18
18
  of this.
19
19
  -->
20
- <grammar xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
20
+ <grammar xmlns:a="http://relaxng.org/ns/compatibility/annotations/1.0" xmlns="http://relaxng.org/ns/structure/1.0" datatypeLibrary="http://www.w3.org/2001/XMLSchema-datatypes">
21
21
  <include href="reqt.rng"/>
22
22
  <!-- include "biblio.rnc" { } -->
23
23
  <include href="basicdoc.rng">
@@ -58,7 +58,7 @@
58
58
  <attribute name="alt"/>
59
59
  </optional>
60
60
  <optional>
61
- <attribute name="updatetype">
61
+ <attribute name="update-type">
62
62
  <data type="boolean"/>
63
63
  </attribute>
64
64
  </optional>
@@ -1803,17 +1803,17 @@
1803
1803
  <ref name="admitted"/>
1804
1804
  </zeroOrMore>
1805
1805
  <zeroOrMore>
1806
- <ref name="related"/>
1806
+ <ref name="deprecates"/>
1807
1807
  </zeroOrMore>
1808
1808
  <zeroOrMore>
1809
- <ref name="deprecates"/>
1809
+ <ref name="related"/>
1810
1810
  </zeroOrMore>
1811
1811
  <optional>
1812
1812
  <ref name="termdomain"/>
1813
1813
  </optional>
1814
- <zeroOrMore>
1815
- <ref name="termgrammar"/>
1816
- </zeroOrMore>
1814
+ <optional>
1815
+ <ref name="termsubject"/>
1816
+ </optional>
1817
1817
  <oneOrMore>
1818
1818
  <ref name="termdefinition"/>
1819
1819
  </oneOrMore>
@@ -1830,41 +1830,232 @@
1830
1830
  </define>
1831
1831
  <define name="preferred">
1832
1832
  <element name="preferred">
1833
- <oneOrMore>
1834
- <ref name="TextElement"/>
1835
- </oneOrMore>
1833
+ <ref name="Designation"/>
1836
1834
  </element>
1837
1835
  </define>
1838
1836
  <define name="admitted">
1839
1837
  <element name="admitted">
1840
- <oneOrMore>
1841
- <ref name="TextElement"/>
1842
- </oneOrMore>
1838
+ <ref name="Designation"/>
1843
1839
  </element>
1844
1840
  </define>
1845
1841
  <define name="related">
1846
1842
  <element name="related">
1843
+ <attribute name="type">
1844
+ <ref name="RelatedTermType"/>
1845
+ </attribute>
1846
+ <element name="preferred">
1847
+ <ref name="Designation"/>
1848
+ </element>
1849
+ <choice>
1850
+ <ref name="eref"/>
1851
+ <ref name="xref"/>
1852
+ <ref name="termref"/>
1853
+ </choice>
1854
+ </element>
1855
+ </define>
1856
+ <define name="RelatedTermType">
1857
+ <choice>
1858
+ <value>deprecates</value>
1859
+ <value>supersedes</value>
1860
+ <value>narrower</value>
1861
+ <value>broader</value>
1862
+ <value>equivalent</value>
1863
+ <value>compare</value>
1864
+ <value>contrast</value>
1865
+ <value>see</value>
1866
+ </choice>
1867
+ </define>
1868
+ <define name="deprecates">
1869
+ <element name="deprecates">
1870
+ <ref name="Designation"/>
1871
+ </element>
1872
+ </define>
1873
+ <define name="Designation">
1874
+ <optional>
1875
+ <attribute name="absent">
1876
+ <data type="boolean"/>
1877
+ </attribute>
1878
+ </optional>
1879
+ <optional>
1880
+ <attribute name="geographic-area"/>
1881
+ </optional>
1882
+ <choice>
1883
+ <ref name="expression_designation"/>
1884
+ <ref name="letter_symbol_designation"/>
1885
+ <ref name="graphical_symbol_designation"/>
1886
+ </choice>
1887
+ <optional>
1888
+ <ref name="fieldofapplication"/>
1889
+ </optional>
1890
+ <optional>
1891
+ <ref name="usageinfo"/>
1892
+ </optional>
1893
+ <zeroOrMore>
1894
+ <ref name="termsource"/>
1895
+ </zeroOrMore>
1896
+ </define>
1897
+ <define name="fieldofapplication">
1898
+ <element name="field-of-application">
1899
+ <oneOrMore>
1900
+ <ref name="PureTextElement"/>
1901
+ </oneOrMore>
1902
+ </element>
1903
+ </define>
1904
+ <define name="usageinfo">
1905
+ <element name="usage-info">
1906
+ <oneOrMore>
1907
+ <ref name="PureTextElement"/>
1908
+ </oneOrMore>
1909
+ </element>
1910
+ </define>
1911
+ <define name="letter_symbol_designation">
1912
+ <element name="letter-symbol">
1847
1913
  <optional>
1848
- <attribute name="type">
1914
+ <attribute name="isInternational">
1915
+ <data type="boolean"/>
1916
+ </attribute>
1917
+ </optional>
1918
+ <element name="name">
1919
+ <oneOrMore>
1849
1920
  <choice>
1850
- <value>compare</value>
1851
- <value>contrast</value>
1852
- <value>see</value>
1921
+ <ref name="PureTextElement"/>
1922
+ <ref name="stem"/>
1853
1923
  </choice>
1924
+ </oneOrMore>
1925
+ </element>
1926
+ </element>
1927
+ </define>
1928
+ <define name="graphical_symbol_designation">
1929
+ <element name="graphical-symbol">
1930
+ <optional>
1931
+ <attribute name="isInternational">
1932
+ <data type="boolean"/>
1854
1933
  </attribute>
1855
1934
  </optional>
1856
- <oneOrMore>
1857
- <ref name="TextElement"/>
1858
- </oneOrMore>
1935
+ <ref name="figure"/>
1859
1936
  </element>
1860
1937
  </define>
1861
- <define name="deprecates">
1862
- <element name="deprecates">
1863
- <oneOrMore>
1864
- <ref name="TextElement"/>
1865
- </oneOrMore>
1938
+ <define name="expression_designation">
1939
+ <element name="expression">
1940
+ <optional>
1941
+ <attribute name="language">
1942
+ <a:documentation>ISO-639</a:documentation>
1943
+ </attribute>
1944
+ </optional>
1945
+ <optional>
1946
+ <attribute name="script">
1947
+ <a:documentation>ISO-15924</a:documentation>
1948
+ </attribute>
1949
+ </optional>
1950
+ <optional>
1951
+ <attribute name="type">
1952
+ <ref name="ExpressionDesignationType"/>
1953
+ </attribute>
1954
+ </optional>
1955
+ <optional>
1956
+ <attribute name="isInternational">
1957
+ <data type="boolean"/>
1958
+ </attribute>
1959
+ </optional>
1960
+ <element name="name">
1961
+ <zeroOrMore>
1962
+ <ref name="PureTextElement"/>
1963
+ </zeroOrMore>
1964
+ </element>
1965
+ <optional>
1966
+ <element name="abbreviation-type">
1967
+ <ref name="AbbreviationType"/>
1968
+ </element>
1969
+ </optional>
1970
+ <optional>
1971
+ <element name="pronunciation">
1972
+ <ref name="LocalizedString"/>
1973
+ </element>
1974
+ </optional>
1975
+ <optional>
1976
+ <element name="grammar-info">
1977
+ <ref name="Grammar"/>
1978
+ </element>
1979
+ </optional>
1866
1980
  </element>
1867
1981
  </define>
1982
+ <define name="ExpressionDesignationType">
1983
+ <choice>
1984
+ <value>prefix</value>
1985
+ <value>suffix</value>
1986
+ <value>abbreviation</value>
1987
+ <value>full</value>
1988
+ </choice>
1989
+ </define>
1990
+ <define name="AbbreviationType">
1991
+ <choice>
1992
+ <value>truncation</value>
1993
+ <value>acronym</value>
1994
+ <value>initialism</value>
1995
+ </choice>
1996
+ </define>
1997
+ <define name="Grammar">
1998
+ <zeroOrMore>
1999
+ <element name="gender">
2000
+ <ref name="GrammarGender"/>
2001
+ </element>
2002
+ </zeroOrMore>
2003
+ <zeroOrMore>
2004
+ <element name="number">
2005
+ <ref name="GrammarNumber"/>
2006
+ </element>
2007
+ </zeroOrMore>
2008
+ <optional>
2009
+ <element name="isPreposition">
2010
+ <data type="boolean"/>
2011
+ </element>
2012
+ </optional>
2013
+ <optional>
2014
+ <element name="isParticiple">
2015
+ <data type="boolean"/>
2016
+ </element>
2017
+ </optional>
2018
+ <optional>
2019
+ <element name="isAdjective">
2020
+ <data type="boolean"/>
2021
+ </element>
2022
+ </optional>
2023
+ <optional>
2024
+ <element name="isVerb">
2025
+ <data type="boolean"/>
2026
+ </element>
2027
+ </optional>
2028
+ <optional>
2029
+ <element name="isAdverb">
2030
+ <data type="boolean"/>
2031
+ </element>
2032
+ </optional>
2033
+ <optional>
2034
+ <element name="isNoun">
2035
+ <data type="boolean"/>
2036
+ </element>
2037
+ </optional>
2038
+ <zeroOrMore>
2039
+ <element name="grammar-value">
2040
+ <text/>
2041
+ </element>
2042
+ </zeroOrMore>
2043
+ </define>
2044
+ <define name="GrammarGender">
2045
+ <choice>
2046
+ <value>masculine</value>
2047
+ <value>feminine</value>
2048
+ <value>neuter</value>
2049
+ <value>common</value>
2050
+ </choice>
2051
+ </define>
2052
+ <define name="GrammarNumber">
2053
+ <choice>
2054
+ <value>singular</value>
2055
+ <value>dual</value>
2056
+ <value>plural</value>
2057
+ </choice>
2058
+ </define>
1868
2059
  <define name="termdomain">
1869
2060
  <element name="domain">
1870
2061
  <oneOrMore>
@@ -1872,8 +2063,8 @@
1872
2063
  </oneOrMore>
1873
2064
  </element>
1874
2065
  </define>
1875
- <define name="termgrammar">
1876
- <element name="grammar">
2066
+ <define name="termsubject">
2067
+ <element name="subject">
1877
2068
  <oneOrMore>
1878
2069
  <ref name="TextElement"/>
1879
2070
  </oneOrMore>
@@ -1881,9 +2072,39 @@
1881
2072
  </define>
1882
2073
  <define name="termdefinition">
1883
2074
  <element name="definition">
2075
+ <choice>
2076
+ <ref name="verbaldefinition"/>
2077
+ <ref name="nonverbalrep"/>
2078
+ <group>
2079
+ <ref name="verbaldefinition"/>
2080
+ <ref name="nonverbalrep"/>
2081
+ </group>
2082
+ </choice>
2083
+ </element>
2084
+ </define>
2085
+ <define name="verbaldefinition">
2086
+ <element name="verbal-definition">
1884
2087
  <oneOrMore>
1885
2088
  <choice>
1886
2089
  <ref name="paragraph"/>
2090
+ <ref name="dl"/>
2091
+ <ref name="ol"/>
2092
+ <ref name="ul"/>
2093
+ <ref name="table"/>
2094
+ <ref name="figure"/>
2095
+ <ref name="formula"/>
2096
+ </choice>
2097
+ </oneOrMore>
2098
+ <zeroOrMore>
2099
+ <ref name="termsource"/>
2100
+ </zeroOrMore>
2101
+ </element>
2102
+ </define>
2103
+ <define name="nonverbalrep">
2104
+ <element name="non-verbal-representation">
2105
+ <oneOrMore>
2106
+ <choice>
2107
+ <ref name="table"/>
1887
2108
  <ref name="figure"/>
1888
2109
  <ref name="formula"/>
1889
2110
  </choice>
@@ -1972,6 +2193,12 @@
1972
2193
  <value>modified</value>
1973
2194
  </choice>
1974
2195
  </attribute>
2196
+ <attribute name="type">
2197
+ <choice>
2198
+ <value>authoritative</value>
2199
+ <value>lineage</value>
2200
+ </choice>
2201
+ </attribute>
1975
2202
  <ref name="origin"/>
1976
2203
  <optional>
1977
2204
  <ref name="modification"/>
@@ -1,5 +1,5 @@
1
1
  require "htmlentities"
2
- require "uri"
2
+ require "uri" if /^2\./.match?(RUBY_VERSION)
3
3
 
4
4
  module Asciidoctor
5
5
  module ISO
@@ -63,7 +63,7 @@ module Asciidoctor
63
63
  def locality_erefs_validate(root)
64
64
  root.xpath("//eref[descendant::locality]").each do |t|
65
65
  if /^(ISO|IEC)/.match?(t["citeas"]) &&
66
- !(/: ?(\d+{4}|–)$/.match?(t["citeas"]))
66
+ !/: ?(\d+{4}|–)$/.match?(t["citeas"])
67
67
  @log.add("Style", t,
68
68
  "undated reference #{t['citeas']} should not contain "\
69
69
  "specific elements")
@@ -78,8 +78,8 @@ module Asciidoctor
78
78
  # ISO/IEC DIR 2, 16.5.6
79
79
  def termdef_style(xmldoc)
80
80
  xmldoc.xpath("//term").each do |t|
81
- para = t.at("./definition") || return
82
- term = t.at("./preferred").text
81
+ para = t.at("./definition/verbal-definition") || return
82
+ term = t.at("./preferred//name").text
83
83
  termdef_warn(para.text, /\A(the|a)\b/i, t, term,
84
84
  "term definition starts with article")
85
85
  termdef_warn(para.text, /\.\Z/i, t, term,
@@ -90,10 +90,10 @@ module Asciidoctor
90
90
  def doctype_validate(xmldoc)
91
91
  doctype = xmldoc&.at("//bibdata/ext/doctype")&.text
92
92
  %w(international-standard technical-specification technical-report
93
- publicly-available-specification international-workshop-agreement
94
- guide amendment technical-corrigendum).include? doctype or
95
- @log.add("Document Attributes", nil,
96
- "#{doctype} is not a recognised document type")
93
+ publicly-available-specification international-workshop-agreement
94
+ guide amendment technical-corrigendum).include? doctype or
95
+ @log.add("Document Attributes", nil,
96
+ "#{doctype} is not a recognised document type")
97
97
  end
98
98
 
99
99
  def script_validate(xmldoc)
@@ -216,7 +216,7 @@ module Asciidoctor
216
216
 
217
217
  def asset_style(root)
218
218
  root.xpath("//example | //termexample").each { |e| example_style(e) }
219
- root.xpath("//definition").each { |e| definition_style(e) }
219
+ root.xpath("//definition/verbal-definition").each { |e| definition_style(e) }
220
220
  root.xpath("//note").each { |e| note_style(e) }
221
221
  root.xpath("//fn").each { |e| footnote_style(e) }
222
222
  root.xpath(ASSETS_TO_STYLE).each { |e| style(e, extract_text(e)) }
@@ -689,7 +689,6 @@ p.Terms, li.Terms, div.Terms {
689
689
  mso-fareast-font-family: "SimHei",serif;
690
690
  mso-bidi-font-family: {{headerfont}};
691
691
  mso-ansi-language: EN-GB;
692
- font-weight: bold;
693
692
  mso-bidi-font-weight: normal; }
694
693
 
695
694
  p.AltTerms, li.AltTerms, div.AltTerms {
@@ -658,7 +658,6 @@ p.Terms, li.Terms, div.Terms
658
658
  mso-fareast-font-family:"SimHei",serif;
659
659
  mso-bidi-font-family:$headerfont;
660
660
  mso-ansi-language:EN-GB;
661
- font-weight:bold;
662
661
  mso-bidi-font-weight:normal;}
663
662
  p.AltTerms, li.AltTerms, div.AltTerms
664
663
  {mso-style-name:"AltTerm\(s\)";
@@ -429,7 +429,6 @@ p.AltTerms {
429
429
  margin-left: 2em; }
430
430
 
431
431
  p.Terms {
432
- font-weight: bold;
433
432
  margin-top: 0em; }
434
433
 
435
434
  /* Navigation*/
@@ -252,7 +252,6 @@ p.AltTerms {
252
252
  }
253
253
 
254
254
  p.Terms {
255
- font-weight: bold;
256
255
  margin-top: 0em;
257
256
  }
258
257
 
@@ -378,7 +378,6 @@ p.AltTerms {
378
378
  margin-left: 2em; }
379
379
 
380
380
  p.Terms {
381
- font-weight: bold;
382
381
  margin-top: 0em; }
383
382
 
384
383
  /* Navigation*/
@@ -193,7 +193,6 @@ p.AltTerms {
193
193
  }
194
194
 
195
195
  p.Terms {
196
- font-weight: bold;
197
196
  margin-top: 0em;
198
197
  }
199
198