sts 0.1.0 → 0.3.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (105) hide show
  1. checksums.yaml +4 -4
  2. data/.github/workflows/release.yml +1 -1
  3. data/.rubocop.yml +12 -0
  4. data/Gemfile +6 -0
  5. data/lib/sts/mapper.rb +442 -0
  6. data/lib/sts/niso_sts/adoption.rb +30 -0
  7. data/lib/sts/niso_sts/adoption_front.rb +16 -0
  8. data/lib/sts/niso_sts/app.rb +49 -0
  9. data/lib/sts/niso_sts/app_group.rb +19 -0
  10. data/lib/sts/niso_sts/back.rb +12 -2
  11. data/lib/sts/niso_sts/body.rb +2 -2
  12. data/lib/sts/niso_sts/caption.rb +47 -0
  13. data/lib/sts/niso_sts/custom_meta.rb +23 -0
  14. data/lib/sts/niso_sts/custom_meta_group.rb +18 -0
  15. data/lib/sts/niso_sts/def.rb +19 -0
  16. data/lib/sts/niso_sts/def_item.rb +24 -0
  17. data/lib/sts/niso_sts/def_list.rb +28 -0
  18. data/lib/sts/niso_sts/display_formula.rb +27 -0
  19. data/lib/sts/niso_sts/document_identification.rb +7 -7
  20. data/lib/sts/niso_sts/ext_link.rb +20 -0
  21. data/lib/sts/niso_sts/figure.rb +40 -0
  22. data/lib/sts/niso_sts/fn.rb +24 -0
  23. data/lib/sts/niso_sts/fn_group.rb +19 -0
  24. data/lib/sts/niso_sts/front.rb +8 -2
  25. data/lib/sts/niso_sts/graphic.rb +29 -0
  26. data/lib/sts/niso_sts/inline_formula.rb +22 -0
  27. data/lib/sts/niso_sts/list.rb +9 -1
  28. data/lib/sts/niso_sts/list_item.rb +25 -0
  29. data/lib/sts/niso_sts/meta_note.rb +24 -0
  30. data/lib/sts/niso_sts/metadata_iso.rb +2 -2
  31. data/lib/sts/niso_sts/metadata_std.rb +59 -0
  32. data/lib/sts/niso_sts/mixed_citation.rb +27 -0
  33. data/lib/sts/niso_sts/non_normative_example.rb +22 -0
  34. data/lib/sts/niso_sts/non_normative_note.rb +8 -2
  35. data/lib/sts/niso_sts/object_id.rb +23 -0
  36. data/lib/sts/niso_sts/page_count.rb +2 -2
  37. data/lib/sts/niso_sts/paragraph.rb +36 -2
  38. data/lib/sts/niso_sts/permissions.rb +20 -0
  39. data/lib/sts/niso_sts/reference.rb +4 -1
  40. data/lib/sts/niso_sts/reference_list.rb +6 -1
  41. data/lib/sts/niso_sts/reference_standard.rb +17 -6
  42. data/lib/sts/niso_sts/section.rb +37 -9
  43. data/lib/sts/niso_sts/standard.rb +14 -1
  44. data/lib/sts/niso_sts/standard_identification.rb +13 -7
  45. data/lib/sts/niso_sts/standard_ref.rb +2 -2
  46. data/lib/sts/niso_sts/std_cross_reference.rb +18 -0
  47. data/lib/sts/niso_sts/std_id.rb +24 -0
  48. data/lib/sts/niso_sts/std_id_group.rb +19 -0
  49. data/lib/sts/niso_sts/term_display.rb +2 -2
  50. data/lib/sts/niso_sts/term_section.rb +10 -3
  51. data/lib/sts/niso_sts/title.rb +22 -0
  52. data/lib/sts/niso_sts/title_wrap.rb +27 -3
  53. data/lib/sts/niso_sts.rb +3 -0
  54. data/lib/sts/tbx_iso_tml/bold.rb +18 -0
  55. data/lib/sts/tbx_iso_tml/caption.rb +17 -0
  56. data/lib/sts/tbx_iso_tml/col.rb +23 -0
  57. data/lib/sts/tbx_iso_tml/definition.rb +24 -1
  58. data/lib/sts/tbx_iso_tml/entailed_term.rb +26 -0
  59. data/lib/sts/tbx_iso_tml/example.rb +16 -1
  60. data/lib/sts/tbx_iso_tml/external_graphic.rb +2 -2
  61. data/lib/sts/tbx_iso_tml/external_source.rb +2 -2
  62. data/lib/sts/tbx_iso_tml/fn.rb +23 -0
  63. data/lib/sts/tbx_iso_tml/fn_group.rb +19 -0
  64. data/lib/sts/tbx_iso_tml/geographical_usage.rb +2 -2
  65. data/lib/sts/tbx_iso_tml/grammatical_gender.rb +2 -2
  66. data/lib/sts/tbx_iso_tml/grammatical_number.rb +2 -2
  67. data/lib/sts/tbx_iso_tml/italic.rb +20 -0
  68. data/lib/sts/tbx_iso_tml/lang_set.rb +11 -7
  69. data/lib/sts/tbx_iso_tml/math.rb +62 -0
  70. data/lib/sts/tbx_iso_tml/mfenced.rb +43 -0
  71. data/lib/sts/tbx_iso_tml/mfrac.rb +33 -0
  72. data/lib/sts/tbx_iso_tml/mi.rb +19 -0
  73. data/lib/sts/tbx_iso_tml/mrow.rb +46 -0
  74. data/lib/sts/tbx_iso_tml/mspace.rb +18 -0
  75. data/lib/sts/tbx_iso_tml/mstyle.rb +29 -0
  76. data/lib/sts/tbx_iso_tml/msub.rb +34 -0
  77. data/lib/sts/tbx_iso_tml/msup.rb +27 -0
  78. data/lib/sts/tbx_iso_tml/munder.rb +20 -0
  79. data/lib/sts/tbx_iso_tml/munderover.rb +24 -0
  80. data/lib/sts/tbx_iso_tml/named_content.rb +20 -0
  81. data/lib/sts/tbx_iso_tml/normative_authorization.rb +2 -2
  82. data/lib/sts/tbx_iso_tml/note.rb +31 -2
  83. data/lib/sts/tbx_iso_tml/part_of_speech.rb +2 -2
  84. data/lib/sts/tbx_iso_tml/see.rb +2 -2
  85. data/lib/sts/tbx_iso_tml/semantics.rb +29 -0
  86. data/lib/sts/tbx_iso_tml/source.rb +6 -1
  87. data/lib/sts/tbx_iso_tml/sup.rb +24 -0
  88. data/lib/sts/tbx_iso_tml/table.rb +32 -0
  89. data/lib/sts/tbx_iso_tml/table_wrap.rb +33 -0
  90. data/lib/sts/tbx_iso_tml/table_wrap_foot.rb +19 -0
  91. data/lib/sts/tbx_iso_tml/tbody.rb +26 -0
  92. data/lib/sts/tbx_iso_tml/td.rb +60 -0
  93. data/lib/sts/tbx_iso_tml/term.rb +31 -2
  94. data/lib/sts/tbx_iso_tml/term_entry.rb +2 -3
  95. data/lib/sts/tbx_iso_tml/term_information_group.rb +5 -2
  96. data/lib/sts/tbx_iso_tml/term_type.rb +2 -2
  97. data/lib/sts/tbx_iso_tml/th.rb +50 -0
  98. data/lib/sts/tbx_iso_tml/thead.rb +26 -0
  99. data/lib/sts/tbx_iso_tml/tr.rb +22 -0
  100. data/lib/sts/tbx_iso_tml/xref.rb +26 -0
  101. data/lib/sts/tbx_iso_tml.rb +8 -0
  102. data/lib/sts/version.rb +1 -1
  103. data/lib/sts.rb +1 -0
  104. data/sts.gemspec +2 -8
  105. metadata +67 -63
@@ -1,15 +1,49 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "shale"
3
+ require_relative "../mapper"
4
+
5
+ require_relative "list"
6
+ require_relative "inline_formula"
7
+ require_relative "display_formula"
8
+ require_relative "def_list"
9
+ require_relative "non_normative_note"
10
+ require_relative "non_normative_example"
11
+ require_relative "reference_standard"
12
+ require_relative "../tbx_iso_tml/xref"
4
13
 
5
14
  module Sts
6
15
  module NisoSts
7
- class Paragraph < Shale::Mapper
16
+ class NonNormativeNote < Sts::Mapper; end
17
+
18
+ class Paragraph < Sts::Mapper
19
+ attribute :id, Shale::Type::String
8
20
  attribute :text, Shale::Type::String
21
+ attribute :italic, Shale::Type::String
22
+ attribute :bold, Shale::Type::String
23
+ attribute :list, Sts::NisoSts::List
24
+ attribute :def_list, DefList
25
+ attribute :non_normative_note, NonNormativeNote
26
+ attribute :non_normative_example, NonNormativeExample
27
+ attribute :inline_formula, Sts::NisoSts::InlineFormula, collection: true
28
+ attribute :disp_formula, Sts::NisoSts::DisplayFormula, collection: true
29
+ attribute :xref, TbxIsoTml::Xref
30
+ attribute :std, ReferenceStandard
9
31
 
10
32
  xml do
11
33
  root "p"
34
+
35
+ map_attribute "id", to: :id
12
36
  map_content to: :text
37
+ map_element "bold", to: :bold
38
+ map_element "italic", to: :italic
39
+ map_element "list", to: :list
40
+ map_element "def-list", to: :def_list
41
+ map_element "non-normative-note", to: :non_normative_note
42
+ map_element "non-normative-example", to: :non_normative_example
43
+ map_element "inline-formula", to: :inline_formula
44
+ map_element "disp-formula", to: :disp_formula
45
+ map_element "std", to: :std, namespace: nil, prefix: nil
46
+ map_element "xref", to: :xref, namespace: nil, prefix: nil
13
47
  end
14
48
  end
15
49
  end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ module Sts
6
+ module NisoSts
7
+ class Permissions < Sts::Mapper
8
+ attribute :copyright_statement, Shale::Type::String
9
+ attribute :copyright_year, Shale::Type::String
10
+ attribute :copyright_holder, Shale::Type::String
11
+
12
+ xml do
13
+ root "permissions"
14
+ map_element "copyright-statement", to: :copyright_statement
15
+ map_element "copyright-year", to: :copyright_year
16
+ map_element "copyright-holder", to: :copyright_holder
17
+ end
18
+ end
19
+ end
20
+ end
@@ -3,13 +3,15 @@
3
3
  require "shale"
4
4
 
5
5
  require_relative "reference_standard"
6
+ require_relative "mixed_citation"
6
7
 
7
8
  module Sts
8
9
  module NisoSts
9
- class Reference < Shale::Mapper
10
+ class Reference < Sts::Mapper
10
11
  attribute :content_type, Shale::Type::String
11
12
  attribute :id, Shale::Type::String
12
13
  attribute :label, Shale::Type::String
14
+ attribute :mixed_citation, MixedCitation
13
15
  attribute :std, ReferenceStandard, collection: true
14
16
 
15
17
  xml do
@@ -18,6 +20,7 @@ module Sts
18
20
  map_attribute "id", to: :id
19
21
  map_element "label", to: :label
20
22
  map_element "std", to: :std
23
+ map_element "mixed-citation", to: :mixed_citation
21
24
  end
22
25
  end
23
26
  end
@@ -6,17 +6,22 @@ require_relative "reference"
6
6
 
7
7
  module Sts
8
8
  module NisoSts
9
- class ReferenceList < Shale::Mapper
9
+ class ReferenceList < Sts::Mapper
10
10
  attribute :content_type, Shale::Type::String
11
11
  attribute :id, Shale::Type::String
12
+ attribute :specific_use, Shale::Type::String
12
13
  attribute :title, Shale::Type::String
14
+ attribute :label, Shale::Type::String
13
15
  attribute :ref, Reference, collection: true
14
16
 
15
17
  xml do
16
18
  root "ref-list"
19
+
17
20
  map_attribute "content-type", to: :content_type
18
21
  map_attribute "id", to: :id
22
+ map_attribute "specific-use", to: :specific_use
19
23
  map_element "title", to: :title
24
+ map_element "label", to: :label
20
25
  map_element "ref", to: :ref
21
26
  end
22
27
  end
@@ -1,23 +1,34 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "shale"
3
+ require_relative "../mapper"
4
+ require_relative "standard_ref"
5
+ require_relative "std_id_group"
6
+ require_relative "../tbx_iso_tml/xref"
4
7
 
5
8
  module Sts
6
9
  module NisoSts
7
- class ReferenceStandard < Shale::Mapper
10
+ class ReferenceStandard < Sts::Mapper
8
11
  attribute :type, Shale::Type::String
9
12
  attribute :std_id, Shale::Type::String
10
13
  attribute :content, Shale::Type::String
11
- # attribute :std_ref, Shale::Type::String
12
- # attribute :title, Shale::Type::String
14
+ attribute :std_ref, StandardRef
15
+ attribute :title, Shale::Type::String
16
+ attribute :std_id_group, StdIdGroup, collection: true
17
+ attribute :xref, Sts::TbxIsoTml::Xref, collection: true
13
18
 
14
19
  xml do
15
20
  root "std"
21
+
16
22
  map_attribute "type", to: :type
17
23
  map_attribute "std-id", to: :std_id
24
+ map_element "std-ref", to: :std_ref, namespace: nil, prefix: nil
25
+ map_element "title", to: :title, namespace: nil, prefix: nil
26
+ map_element "std-id-group", to: :std_id_group,
27
+ namespace: nil,
28
+ prefix: nil
29
+ map_element "xref", to: :xref
30
+
18
31
  map_content to: :content
19
- # map_element "std-ref", to: :std_ref
20
- # map_element "title", to: :title
21
32
  end
22
33
  end
23
34
  end
@@ -1,31 +1,59 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "shale"
3
+ require_relative "../mapper"
4
4
 
5
5
  require_relative "paragraph"
6
6
  require_relative "list"
7
7
  require_relative "term_section"
8
+ require_relative "reference_list"
9
+ require_relative "non_normative_note"
10
+ require_relative "non_normative_example"
11
+ require_relative "figure"
12
+ require_relative "title"
13
+
14
+ require_relative "../tbx_iso_tml/table_wrap"
8
15
 
9
16
  module Sts
10
17
  module NisoSts
11
- class Section < Shale::Mapper
18
+ class Title < Sts::Mapper; end
19
+
20
+ class Section < Sts::Mapper
12
21
  attribute :id, Shale::Type::String
22
+ attribute :specific_use, Shale::Type::String
13
23
  attribute :label, Shale::Type::String
14
- attribute :title, Shale::Type::String
24
+ attribute :title, Title
15
25
  attribute :type, Shale::Type::String
16
- attribute :p, Paragraph, collection: true
26
+ attribute :paragraphs, Paragraph, collection: true
17
27
  attribute :list, List, collection: true
18
28
  attribute :term_sec, TermSection, collection: true
29
+ attribute :ref_list, ReferenceList, collection: true
30
+ attribute :non_normative_note, NonNormativeNote, collection: true
31
+ attribute :non_normative_example, NonNormativeExample, collection: true
32
+ attribute :sec, Section, collection: true
33
+ attribute :figures, Figure, collection: true
34
+ attribute :fig, Figure, collection: true
35
+
36
+ attribute :table_wrap, ::Sts::TbxIsoTml::TableWrap, collection: true
19
37
 
20
38
  xml do
21
- root "standard"
22
- map_element "title", to: :title
23
- map_element "label", to: :label
24
- map_attribute "sec-type", to: :type
39
+ root "sec"
40
+
25
41
  map_attribute "id", to: :id
26
- map_element "p", to: :p
42
+ map_attribute "sec-type", to: :type
43
+ map_attribute "specific-use", to: :specific_use
44
+
45
+ map_element "label", to: :label, render_nil: true
46
+ map_element "title", to: :title
47
+ map_element "p", to: :paragraphs
48
+ map_element "sec", to: :sec
27
49
  map_element "term-sec", to: :term_sec
28
50
  map_element "list", to: :list
51
+ map_element "figure", to: :figures
52
+ map_element "fig", to: :fig
53
+ map_element "ref-list", to: :ref_list
54
+ map_element "table-wrap", to: :table_wrap
55
+ map_element "non-normative-note", to: :non_normative_note
56
+ map_element "non-normative-example", to: :non_normative_example
29
57
  end
30
58
  end
31
59
  end
@@ -8,13 +8,26 @@ require_relative "back"
8
8
 
9
9
  module Sts
10
10
  module NisoSts
11
- class Standard < Shale::Mapper
11
+ class Standard < Sts::Mapper
12
12
  attribute :front, Front
13
13
  attribute :body, Body
14
14
  attribute :back, Back
15
+ attribute :id, Shale::Type::String
16
+ attribute :lang, Shale::Type::String
17
+ attribute :mml, Shale::Type::String
18
+ attribute :tbx, Shale::Type::String
19
+ attribute :xlink, Shale::Type::String
15
20
 
16
21
  xml do
17
22
  root "standard"
23
+ # namespace "urn:iso:std:iso:30042:ed-1", "tbx"
24
+ # namespace "http://www.w3.org/1998/Math/MathML", "mml"
25
+ # namespace "http://www.w3.org/1999/xlink", "xlink"
26
+
27
+ map_attribute "id", to: :id
28
+ map_attribute "lang", to: :lang,
29
+ namespace: "http://www.w3.org/XML/1998/namespace",
30
+ prefix: "xml"
18
31
  map_element "front", to: :front
19
32
  map_element "body", to: :body
20
33
  map_element "back", to: :back
@@ -1,24 +1,30 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "shale"
3
+ require_relative "../mapper"
4
+
5
+ require_relative "std_id_group"
4
6
 
5
7
  module Sts
6
8
  module NisoSts
7
- class StandardIdentification < Shale::Mapper
9
+ class StandardIdentification < Sts::Mapper
8
10
  attribute :originator, Shale::Type::String
9
11
  attribute :doc_type, Shale::Type::String
10
12
  attribute :doc_number, Shale::Type::String
11
13
  attribute :edition, Shale::Type::String
12
14
  attribute :version, Shale::Type::String
15
+ attribute :part_number, Shale::Type::String
16
+ attribute :std_id_group, StdIdGroup
13
17
 
14
18
  xml do
15
19
  root "std-iden"
16
20
 
17
- map_element 'originator', to: :originator
18
- map_element 'doc-type', to: :doc_type
19
- map_element 'doc-number', to: :doc_number
20
- map_element 'edition', to: :edition
21
- map_element 'version', to: :version
21
+ map_element "originator", to: :originator
22
+ map_element "doc-type", to: :doc_type
23
+ map_element "doc-number", to: :doc_number
24
+ map_element "edition", to: :edition, render_nil: true
25
+ map_element "version", to: :version, render_nil: true
26
+ map_element "part-number", to: :part_number
27
+ map_element "std-id-group", to: :std_id_group
22
28
  end
23
29
  end
24
30
  end
@@ -1,10 +1,10 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "shale"
3
+ require_relative "../mapper"
4
4
 
5
5
  module Sts
6
6
  module NisoSts
7
- class StandardRef < Shale::Mapper
7
+ class StandardRef < Sts::Mapper
8
8
  attribute :type, Shale::Type::String
9
9
  attribute :value, Shale::Type::String
10
10
 
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ module Sts
6
+ module NisoSts
7
+ class StdCrossReference < Sts::Mapper
8
+ attribute :type, Shale::Type::String
9
+ attribute :std_ref, StandardRef, collection: true
10
+
11
+ xml do
12
+ root "iso-meta"
13
+ map_attribute "type", to: :type
14
+ map_element "std-ref", to: :std_ref
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ module Sts
6
+ module NisoSts
7
+ class StdId < Sts::Mapper
8
+ attribute :std_id_link_type, Shale::Type::String
9
+ attribute :std_id_type, Shale::Type::String
10
+ attribute :specific_use, Shale::Type::String
11
+ attribute :content, Shale::Type::String
12
+
13
+ xml do
14
+ root "std-id"
15
+
16
+ map_attribute "std-id-link-type", to: :std_id_link_type
17
+ map_attribute "std-id-type", to: :std_id_type
18
+ map_attribute "specific-use", to: :specific_use
19
+
20
+ map_content to: :content
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ require_relative "std_id"
6
+
7
+ module Sts
8
+ module NisoSts
9
+ class StdIdGroup < Sts::Mapper
10
+ attribute :std_id, StdId, collection: true
11
+
12
+ xml do
13
+ root "std-id-group"
14
+
15
+ map_element "std-id", to: :std_id
16
+ end
17
+ end
18
+ end
19
+ end
@@ -1,13 +1,13 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "shale"
3
+ require_relative "../mapper"
4
4
 
5
5
  require_relative "paragraph"
6
6
  require_relative "non_normative_note"
7
7
 
8
8
  module Sts
9
9
  module NisoSts
10
- class TermDisplay < Shale::Mapper
10
+ class TermDisplay < Sts::Mapper
11
11
  attribute :p, Paragraph, collection: true
12
12
  attribute :non_normative_note, NonNormativeNote, collection: true
13
13
 
@@ -1,19 +1,26 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "shale"
3
+ require_relative "../mapper"
4
4
 
5
5
  require_relative "../tbx_iso_tml"
6
6
  require_relative "term_display"
7
+ require_relative "../tbx_iso_tml/term_entry"
7
8
 
8
9
  module Sts
9
10
  module NisoSts
10
- class TermSection < Shale::Mapper
11
- attribute :term_entry, TbxIsoTml::TermEntry # , collection: true
11
+ class TermSection < Sts::Mapper
12
+ attribute :id, Shale::Type::String
13
+ attribute :sec_type, Shale::Type::String
14
+ attribute :label, Shale::Type::String
15
+ attribute :term_entry, Sts::TbxIsoTml::TermEntry # , collection: true
12
16
  attribute :term_display, TermDisplay # , collection: true
13
17
 
14
18
  xml do
15
19
  root "term-sec"
20
+ map_attribute "id", to: :id
21
+ map_attribute "sec-type", to: :sec_type
16
22
 
23
+ map_element "label", to: :label
17
24
  map_element "term-display", to: :term_display
18
25
  map_element "termEntry", to: :term_entry,
19
26
  namespace: "urn:iso:std:iso:30042:ed-1",
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ require_relative "section"
6
+ require_relative "inline_formula"
7
+
8
+ module Sts
9
+ module NisoSts
10
+ class Title < Sts::Mapper
11
+ attribute :content, Shale::Type::String
12
+ attribute :inline_formula, Sts::NisoSts::InlineFormula, collection: true
13
+
14
+ xml do
15
+ root "title"
16
+
17
+ map_content to: :content
18
+ map_element "inline-formula", to: :inline_formula
19
+ end
20
+ end
21
+ end
22
+ end
@@ -1,14 +1,36 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "shale"
3
+ require_relative "../mapper"
4
4
 
5
5
  require_relative "reference_list"
6
+ require_relative "reference_standard"
6
7
 
7
8
  module Sts
8
9
  module NisoSts
9
- class TitleWrap < Shale::Mapper
10
+ class TitleFull < Sts::Mapper
11
+ attribute :content, Shale::Type::String
12
+ attribute :std, ReferenceStandard
13
+
14
+ xml do
15
+ root "full"
16
+ map_content to: :content
17
+ map_element "std", to: :std, namespace: nil, prefix: nil
18
+ end
19
+ end
20
+
21
+ class TitleCompl < TitleFull
22
+ xml do
23
+ root "compl"
24
+ map_content to: :content
25
+ map_element "std", to: :std, namespace: nil, prefix: nil
26
+ end
27
+ end
28
+
29
+ class TitleWrap < Sts::Mapper
30
+ attribute :intro, Shale::Type::String
10
31
  attribute :main, Shale::Type::String
11
- attribute :full, Shale::Type::String
32
+ attribute :full, TitleFull
33
+ attribute :compl, TitleCompl
12
34
  attribute :lang, Shale::Type::String
13
35
 
14
36
  xml do
@@ -17,8 +39,10 @@ module Sts
17
39
  namespace: "http://www.w3.org/XML/1998/namespace",
18
40
  prefix: "xml"
19
41
 
42
+ map_element "intro", to: :intro
20
43
  map_element "main", to: :main
21
44
  map_element "full", to: :full
45
+ map_element "compl", to: :compl
22
46
  end
23
47
  end
24
48
  end
data/lib/sts/niso_sts.rb CHANGED
@@ -11,11 +11,14 @@ require_relative "niso_sts/front"
11
11
  require_relative "niso_sts/list"
12
12
  require_relative "niso_sts/metadata_iso"
13
13
  require_relative "niso_sts/non_normative_note"
14
+ require_relative "niso_sts/list_item"
14
15
  require_relative "niso_sts/paragraph"
15
16
  require_relative "niso_sts/reference"
16
17
  require_relative "niso_sts/reference_list"
17
18
  require_relative "niso_sts/reference_standard"
18
19
  require_relative "niso_sts/section"
19
20
  require_relative "niso_sts/standard"
21
+ require_relative "niso_sts/adoption"
22
+ require_relative "niso_sts/adoption_front"
20
23
  require_relative "niso_sts/term_display"
21
24
  require_relative "niso_sts/term_section"
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ module Sts
6
+ module TbxIsoTml
7
+ class Bold < Sts::Mapper
8
+ attribute :value, Shale::Type::String
9
+
10
+ xml do
11
+ root "bold"
12
+ namespace nil, nil
13
+
14
+ map_content to: :value
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ module Sts
6
+ module TbxIsoTml
7
+ class Caption < Sts::Mapper
8
+ attribute :p, Shale::Type::String
9
+
10
+ xml do
11
+ root "caption"
12
+
13
+ map_element "p", to: :p
14
+ end
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,23 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ module Sts
6
+ module TbxIsoTml
7
+ class Col < Sts::Mapper
8
+ attribute :width, Sts::TbxIsoTml::Col
9
+ attribute :char, Sts::TbxIsoTml::Col
10
+ attribute :charoff, Sts::TbxIsoTml::Col
11
+ attribute :span, Sts::TbxIsoTml::Col
12
+
13
+ xml do
14
+ root "col"
15
+
16
+ map_attribute "width", to: :width
17
+ map_attribute "char", to: :char
18
+ map_attribute "charoff", to: :charoff
19
+ map_attribute "span", to: :span
20
+ end
21
+ end
22
+ end
23
+ end
@@ -2,16 +2,39 @@
2
2
 
3
3
  require "shale"
4
4
 
5
+ require_relative "entailed_term"
6
+ require_relative "note"
7
+ require_relative "italic"
8
+ require_relative "math"
9
+ require_relative "../niso_sts/list"
10
+ require_relative "../niso_sts/reference_standard"
11
+
5
12
  module Sts
6
13
  module TbxIsoTml
7
- class Definition < Shale::Mapper
14
+ class Definition < Sts::Mapper
15
+ attribute :entailed_term, EntailedTerm
16
+ attribute :note, Note
8
17
  attribute :value, Shale::Type::String
18
+ attribute :italic, Italic
19
+ attribute :math, Sts::TbxIsoTml::Math
20
+ attribute :sub, Shale::Type::String
21
+ attribute :list, Sts::NisoSts::List, collection: true
22
+ attribute :std, Sts::NisoSts::ReferenceStandard, collection: true
9
23
 
10
24
  xml do
11
25
  root "definition"
12
26
  namespace "urn:iso:std:iso:30042:ed-1", "tbx"
13
27
 
14
28
  map_content to: :value
29
+ map_element "entailedTerm", to: :entailed_term
30
+ map_element "note", to: :note
31
+ map_element "italic", to: :italic, namespace: nil, prefix: nil
32
+ map_element "sub", to: :sub, namespace: nil, prefix: nil
33
+ map_element "list", to: :list, namespace: nil, prefix: nil
34
+ map_element "std", to: :std, namespace: nil, prefix: nil
35
+ map_element "math", to: :math,
36
+ namespace: "http://www.w3.org/1998/Math/MathML",
37
+ prefix: "mml"
15
38
  end
16
39
  end
17
40
  end
@@ -0,0 +1,26 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ module Sts
6
+ module TbxIsoTml
7
+ class EntailedTerm < Sts::Mapper
8
+ attribute :target, Shale::Type::String
9
+ attribute :xtarget, Shale::Type::String
10
+ attribute :lang, Shale::Type::String
11
+ attribute :value, Shale::Type::String
12
+
13
+ xml do
14
+ root "entailedTerm"
15
+ namespace "urn:iso:std:iso:30042:ed-1", "tbx"
16
+
17
+ map_attribute :target, to: :target
18
+ map_attribute :xtarget, to: :xtarget
19
+ map_attribute :lang, to: :lang,
20
+ namespace: "http://www.w3.org/XML/1998/namespace",
21
+ prefix: "xml"
22
+ map_content to: :value
23
+ end
24
+ end
25
+ end
26
+ end