sts 0.1.0 → 0.2.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) 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/app.rb +49 -0
  7. data/lib/sts/niso_sts/app_group.rb +19 -0
  8. data/lib/sts/niso_sts/back.rb +12 -2
  9. data/lib/sts/niso_sts/body.rb +2 -2
  10. data/lib/sts/niso_sts/caption.rb +47 -0
  11. data/lib/sts/niso_sts/custom_meta.rb +23 -0
  12. data/lib/sts/niso_sts/custom_meta_group.rb +18 -0
  13. data/lib/sts/niso_sts/def.rb +19 -0
  14. data/lib/sts/niso_sts/def_item.rb +24 -0
  15. data/lib/sts/niso_sts/def_list.rb +28 -0
  16. data/lib/sts/niso_sts/display_formula.rb +27 -0
  17. data/lib/sts/niso_sts/document_identification.rb +7 -7
  18. data/lib/sts/niso_sts/ext_link.rb +20 -0
  19. data/lib/sts/niso_sts/figure.rb +40 -0
  20. data/lib/sts/niso_sts/fn.rb +24 -0
  21. data/lib/sts/niso_sts/fn_group.rb +19 -0
  22. data/lib/sts/niso_sts/front.rb +9 -2
  23. data/lib/sts/niso_sts/graphic.rb +29 -0
  24. data/lib/sts/niso_sts/inline_formula.rb +22 -0
  25. data/lib/sts/niso_sts/list.rb +9 -1
  26. data/lib/sts/niso_sts/list_item.rb +25 -0
  27. data/lib/sts/niso_sts/meta_note.rb +24 -0
  28. data/lib/sts/niso_sts/metadata_iso.rb +2 -2
  29. data/lib/sts/niso_sts/metadata_std.rb +59 -0
  30. data/lib/sts/niso_sts/mixed_citation.rb +27 -0
  31. data/lib/sts/niso_sts/non_normative_example.rb +22 -0
  32. data/lib/sts/niso_sts/non_normative_note.rb +4 -2
  33. data/lib/sts/niso_sts/object_id.rb +23 -0
  34. data/lib/sts/niso_sts/page_count.rb +2 -2
  35. data/lib/sts/niso_sts/paragraph.rb +36 -2
  36. data/lib/sts/niso_sts/permissions.rb +20 -0
  37. data/lib/sts/niso_sts/reference.rb +4 -1
  38. data/lib/sts/niso_sts/reference_list.rb +6 -1
  39. data/lib/sts/niso_sts/reference_standard.rb +17 -6
  40. data/lib/sts/niso_sts/section.rb +43 -9
  41. data/lib/sts/niso_sts/standard.rb +14 -1
  42. data/lib/sts/niso_sts/standard_identification.rb +13 -7
  43. data/lib/sts/niso_sts/standard_ref.rb +2 -2
  44. data/lib/sts/niso_sts/std_cross_reference.rb +18 -0
  45. data/lib/sts/niso_sts/std_id.rb +24 -0
  46. data/lib/sts/niso_sts/std_id_group.rb +19 -0
  47. data/lib/sts/niso_sts/term_display.rb +2 -2
  48. data/lib/sts/niso_sts/term_section.rb +10 -3
  49. data/lib/sts/niso_sts/title.rb +22 -0
  50. data/lib/sts/niso_sts/title_wrap.rb +6 -2
  51. data/lib/sts/niso_sts.rb +1 -0
  52. data/lib/sts/tbx_iso_tml/bold.rb +18 -0
  53. data/lib/sts/tbx_iso_tml/caption.rb +17 -0
  54. data/lib/sts/tbx_iso_tml/col.rb +23 -0
  55. data/lib/sts/tbx_iso_tml/definition.rb +24 -1
  56. data/lib/sts/tbx_iso_tml/entailed_term.rb +26 -0
  57. data/lib/sts/tbx_iso_tml/example.rb +16 -1
  58. data/lib/sts/tbx_iso_tml/external_graphic.rb +2 -2
  59. data/lib/sts/tbx_iso_tml/external_source.rb +2 -2
  60. data/lib/sts/tbx_iso_tml/fn.rb +23 -0
  61. data/lib/sts/tbx_iso_tml/fn_group.rb +19 -0
  62. data/lib/sts/tbx_iso_tml/geographical_usage.rb +2 -2
  63. data/lib/sts/tbx_iso_tml/grammatical_gender.rb +2 -2
  64. data/lib/sts/tbx_iso_tml/grammatical_number.rb +2 -2
  65. data/lib/sts/tbx_iso_tml/italic.rb +20 -0
  66. data/lib/sts/tbx_iso_tml/lang_set.rb +11 -7
  67. data/lib/sts/tbx_iso_tml/math.rb +62 -0
  68. data/lib/sts/tbx_iso_tml/mfenced.rb +43 -0
  69. data/lib/sts/tbx_iso_tml/mfrac.rb +33 -0
  70. data/lib/sts/tbx_iso_tml/mi.rb +19 -0
  71. data/lib/sts/tbx_iso_tml/mrow.rb +46 -0
  72. data/lib/sts/tbx_iso_tml/mspace.rb +18 -0
  73. data/lib/sts/tbx_iso_tml/mstyle.rb +29 -0
  74. data/lib/sts/tbx_iso_tml/msub.rb +34 -0
  75. data/lib/sts/tbx_iso_tml/msup.rb +27 -0
  76. data/lib/sts/tbx_iso_tml/munder.rb +20 -0
  77. data/lib/sts/tbx_iso_tml/munderover.rb +24 -0
  78. data/lib/sts/tbx_iso_tml/named_content.rb +20 -0
  79. data/lib/sts/tbx_iso_tml/normative_authorization.rb +2 -2
  80. data/lib/sts/tbx_iso_tml/note.rb +31 -2
  81. data/lib/sts/tbx_iso_tml/part_of_speech.rb +2 -2
  82. data/lib/sts/tbx_iso_tml/see.rb +2 -2
  83. data/lib/sts/tbx_iso_tml/semantics.rb +29 -0
  84. data/lib/sts/tbx_iso_tml/source.rb +6 -1
  85. data/lib/sts/tbx_iso_tml/sup.rb +24 -0
  86. data/lib/sts/tbx_iso_tml/table.rb +32 -0
  87. data/lib/sts/tbx_iso_tml/table_wrap.rb +32 -0
  88. data/lib/sts/tbx_iso_tml/table_wrap_foot.rb +19 -0
  89. data/lib/sts/tbx_iso_tml/tbody.rb +26 -0
  90. data/lib/sts/tbx_iso_tml/td.rb +60 -0
  91. data/lib/sts/tbx_iso_tml/term.rb +31 -2
  92. data/lib/sts/tbx_iso_tml/term_entry.rb +2 -3
  93. data/lib/sts/tbx_iso_tml/term_information_group.rb +5 -2
  94. data/lib/sts/tbx_iso_tml/term_type.rb +2 -2
  95. data/lib/sts/tbx_iso_tml/th.rb +50 -0
  96. data/lib/sts/tbx_iso_tml/thead.rb +26 -0
  97. data/lib/sts/tbx_iso_tml/tr.rb +22 -0
  98. data/lib/sts/tbx_iso_tml/xref.rb +26 -0
  99. data/lib/sts/tbx_iso_tml.rb +8 -0
  100. data/lib/sts/version.rb +1 -1
  101. data/lib/sts.rb +1 -0
  102. data/sts.gemspec +2 -8
  103. metadata +61 -59
@@ -0,0 +1,19 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ require_relative "paragraph"
6
+
7
+ module Sts
8
+ module NisoSts
9
+ class Def < Sts::Mapper
10
+ attribute :paragraph, Paragraph
11
+
12
+ xml do
13
+ root "def"
14
+
15
+ map_element "p", to: :paragraph
16
+ end
17
+ end
18
+ end
19
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ require_relative "def"
6
+ require_relative "../tbx_iso_tml/term"
7
+
8
+ module Sts
9
+ module NisoSts
10
+ class DefItem < Sts::Mapper
11
+ attribute :specific_use, Shale::Type::String
12
+ attribute :term, TbxIsoTml::Term
13
+ attribute :definition, Def
14
+
15
+ xml do
16
+ root "def-item"
17
+
18
+ map_attribute "specific-use", to: :specific_use
19
+ map_element "term", to: :term, render_nil: true
20
+ map_element "def", to: :definition
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,28 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ require_relative "def_item"
6
+
7
+ module Sts
8
+ module NisoSts
9
+ class DefList < Sts::Mapper
10
+ attribute :title, Shale::Type::String
11
+ attribute :specific_use, Shale::Type::String
12
+ attribute :list_type, Shale::Type::String
13
+ attribute :def_item, DefItem, collection: true
14
+ attribute :def_list, DefList
15
+
16
+ xml do
17
+ root "def-list"
18
+
19
+ map_attribute "list-type", to: :list_type
20
+ map_attribute "specific-use", to: :specific_use
21
+
22
+ map_element "title", to: :title
23
+ map_element "def-item", to: :def_item
24
+ map_element "def-list", to: :def_list
25
+ end
26
+ end
27
+ end
28
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "../mapper"
6
+ require_relative "../tbx_iso_tml/math"
7
+
8
+ module Sts
9
+ module NisoSts
10
+ class DisplayFormula < Sts::Mapper
11
+ attribute :id, Shale::Type::String
12
+ attribute :label, Shale::Type::String
13
+ attribute :math, TbxIsoTml::Math
14
+
15
+ xml do
16
+ root "disp-formula"
17
+
18
+ map_attribute "id", to: :id
19
+
20
+ map_element "label", to: :label
21
+ map_element "math", to: :math,
22
+ namespace: "http://www.w3.org/1998/Math/MathML",
23
+ prefix: "mml"
24
+ end
25
+ end
26
+ end
27
+ 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 DocumentIdentification < Shale::Mapper
7
+ class DocumentIdentification < Sts::Mapper
8
8
  attribute :sdo, Shale::Type::String
9
9
  attribute :proj_id, Shale::Type::String
10
10
  attribute :language, Shale::Type::String
@@ -14,11 +14,11 @@ module Sts
14
14
  xml do
15
15
  root "doc-iden"
16
16
 
17
- map_element 'sdo', to: :sdo
18
- map_element 'proj-id', to: :proj_id
19
- map_element 'language', to: :language
20
- map_element 'release-version', to: :release_version
21
- map_element 'urn', to: :urn
17
+ map_element "sdo", to: :sdo
18
+ map_element "proj-id", to: :proj_id
19
+ map_element "language", to: :language
20
+ map_element "release-version", to: :release_version
21
+ map_element "urn", to: :urn
22
22
  end
23
23
  end
24
24
  end
@@ -0,0 +1,20 @@
1
+ # frozen_striing_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ module Sts
6
+ module NisoSts
7
+ class ExtLink < Sts::Mapper
8
+ attribute :ext_link_type, Shale::Type::String
9
+ attribute :content, Shale::Type::String
10
+
11
+ xml do
12
+ root "ext-link"
13
+
14
+ map_content to: :content
15
+
16
+ map_attribute "ext-link-type", to: :ext_link_type
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,40 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ require_relative "caption"
6
+ require_relative "graphic"
7
+ require_relative "def_list"
8
+
9
+ # <fig id="fig-1" orientation="portrait">
10
+ # <label>Figure 1</label>
11
+ # <caption...>
12
+ # <graphic...>
13
+ # </fig>
14
+
15
+ module Sts
16
+ module NisoSts
17
+ class Caption < Sts::Mapper; end
18
+
19
+ class Figure < Sts::Mapper
20
+ attribute :id, Shale::Type::String
21
+ attribute :orientation, Shale::Type::String
22
+ attribute :caption, Caption
23
+ attribute :def_list, DefList
24
+ attribute :label, Shale::Type::String
25
+ attribute :graphic, Graphic, collection: true
26
+
27
+ xml do
28
+ root "fig"
29
+
30
+ map_attribute "id", to: :id
31
+ map_attribute "orientation", to: :orientation
32
+
33
+ map_element "label", to: :label
34
+ map_element "caption", to: :caption
35
+ map_element "graphic", to: :graphic
36
+ map_element "def-list", to: :def_list
37
+ end
38
+ end
39
+ end
40
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ require_relative "paragraph"
6
+
7
+ module Sts
8
+ module NisoSts
9
+ class Fn < Sts::Mapper
10
+ attribute :id, Shale::Type::String
11
+ attribute :label, Shale::Type::String
12
+ attribute :paragraph, Paragraph
13
+
14
+ xml do
15
+ root "fn"
16
+
17
+ map_attribute "id", to: :id
18
+
19
+ map_element "label", to: :label
20
+ map_element "p", to: :paragraph
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 "fn"
6
+
7
+ module Sts
8
+ module NisoSts
9
+ class FnGroup < Sts::Mapper
10
+ attribute :fn, Fn, collection: true
11
+
12
+ xml do
13
+ root "fn-group"
14
+
15
+ map_element "fn", to: :fn
16
+ end
17
+ end
18
+ end
19
+ end
@@ -1,17 +1,24 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "shale"
3
+ require_relative "../mapper"
4
4
 
5
5
  require_relative "metadata_iso"
6
+ require_relative "metadata_std"
6
7
 
7
8
  module Sts
8
9
  module NisoSts
9
- class Front < Shale::Mapper
10
+ class Section < Sts::Mapper; end
11
+
12
+ class Front < Sts::Mapper
10
13
  attribute :iso_meta, MetadataIso
14
+ attribute :std_meta, MetadataStd
15
+ attribute :sec, Section, collection: true
11
16
 
12
17
  xml do
13
18
  root "front"
14
19
  map_element "iso-meta", to: :iso_meta
20
+ map_element "std-meta", to: :std_meta
21
+ map_element "sec", to: :sec
15
22
  end
16
23
  end
17
24
  end
@@ -0,0 +1,29 @@
1
+ require_relative "../mapper"
2
+
3
+ require_relative "object_id"
4
+
5
+ # rubocop:disable Layout/LineLength
6
+ # <graphic xlink:href="e1d18be9.001.gif">
7
+ # <object-id pub-id-type="fpi">+//ISO 9070/RA::A00007::GE::DIN German Institute for
8
+ # Standardization::Standards//NONSGML ISO 13849-1:2006-11-00::Figure 1//EN</object-id>
9
+ # <object-id pub-id-type="publisher-id">fig-1</object-id>
10
+ # </graphic>
11
+ # rubocop:enable Layout/LineLength
12
+
13
+ module Sts
14
+ module NisoSts
15
+ class Graphic < Sts::Mapper
16
+ attribute :href, Shale::Type::String
17
+ attribute :object_id, ObjectId, collection: true
18
+
19
+ xml do
20
+ root "graphic"
21
+
22
+ map_attribute "href", to: :href,
23
+ namespace: "http://www.w3.org/1999/xlink",
24
+ prefix: "xlink"
25
+ map_element "object-id", to: :object_id
26
+ end
27
+ end
28
+ end
29
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "../mapper"
6
+ require_relative "../tbx_iso_tml/math"
7
+
8
+ module Sts
9
+ module NisoSts
10
+ class InlineFormula < Sts::Mapper
11
+ attribute :math, TbxIsoTml::Math
12
+
13
+ xml do
14
+ root "inline-formula"
15
+
16
+ map_element "math", to: :math,
17
+ namespace: "http://www.w3.org/1998/Math/MathML",
18
+ prefix: "mml"
19
+ end
20
+ end
21
+ end
22
+ end
@@ -2,14 +2,22 @@
2
2
 
3
3
  require "shale"
4
4
 
5
+ require_relative "list_item"
6
+ require_relative "../mapper"
7
+
5
8
  module Sts
6
9
  module NisoSts
7
- class List < Shale::Mapper
10
+ class List < Sts::Mapper
8
11
  attribute :text, Shale::Type::String
12
+ attribute :list_type, Shale::Type::String
13
+ attribute :list_item, ListItem, collection: true
9
14
 
10
15
  xml do
11
16
  root "list"
17
+
12
18
  map_content to: :text
19
+ map_attribute "list-type", to: :list_type
20
+ map_element "list-item", to: :list_item, namespace: nil, prefix: nil
13
21
  end
14
22
  end
15
23
  end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+ require_relative "list"
5
+
6
+ module Sts
7
+ module NisoSts
8
+ class Paragraph < Sts::Mapper; end
9
+ class List < Sts::Mapper; end
10
+
11
+ class ListItem < Sts::Mapper
12
+ attribute :label, Shale::Type::String
13
+ attribute :p, Sts::NisoSts::Paragraph
14
+ attribute :list, List
15
+
16
+ xml do
17
+ root "list-item"
18
+
19
+ map_element :label, to: :label
20
+ map_element :p, to: :p
21
+ map_element :list, to: :list
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ require_relative "paragraph"
6
+
7
+ module Sts
8
+ module NisoSts
9
+ class MetaNote < Sts::Mapper
10
+ attribute :id, Shale::Type::String
11
+ attribute :content_type, Shale::Type::String
12
+ attribute :p, Paragraph, collection: true
13
+ attribute :title, Shale::Type::String
14
+
15
+ xml do
16
+ root "meta-note"
17
+ map_attribute "id", to: :id
18
+ map_attribute "content-type", to: :content_type
19
+ map_element "p", to: :p
20
+ map_element "title", to: :title
21
+ end
22
+ end
23
+ end
24
+ end
@@ -1,6 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "shale"
3
+ require_relative "../mapper"
4
4
  require_relative "title_wrap"
5
5
  require_relative "document_identification"
6
6
  require_relative "standard_identification"
@@ -9,7 +9,7 @@ require_relative "page_count"
9
9
 
10
10
  module Sts
11
11
  module NisoSts
12
- class MetadataIso < Shale::Mapper
12
+ class MetadataIso < Sts::Mapper
13
13
  attribute :title_wrap, TitleWrap
14
14
  attribute :content_language, Shale::Type::String
15
15
  attribute :std_ident, StandardIdentification
@@ -0,0 +1,59 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+ require_relative "title_wrap"
5
+ require_relative "document_identification"
6
+ require_relative "standard_identification"
7
+ require_relative "standard_ref"
8
+ require_relative "page_count"
9
+ require_relative "std_cross_reference"
10
+ require_relative "meta_note"
11
+ require_relative "custom_meta_group"
12
+ require_relative "permissions"
13
+
14
+ module Sts
15
+ module NisoSts
16
+ class MetadataStd < Sts::Mapper
17
+ attribute :id, Shale::Type::String
18
+ attribute :title_wrap, TitleWrap, collection: true
19
+ attribute :content_language, Shale::Type::String
20
+ attribute :std_ident, StandardIdentification
21
+ attribute :doc_ident, DocumentIdentification
22
+ attribute :std_ref, StandardRef, collection: true
23
+ attribute :doc_ref, Shale::Type::String
24
+ attribute :pub_date, Shale::Type::String
25
+ attribute :release_date, Shale::Type::String
26
+ attribute :release_version, Shale::Type::String
27
+ attribute :comm_ref, Shale::Type::String
28
+ attribute :secretariat, Shale::Type::String
29
+ attribute :page_count, PageCount
30
+ attribute :ics, Shale::Type::String
31
+ attribute :std_xref, StdCrossReference
32
+ attribute :permissions, Permissions
33
+ attribute :meta_note, MetaNote, collection: true
34
+ attribute :custom_meta_group, CustomMetaGroup, collection: true
35
+
36
+ xml do
37
+ root "std-meta"
38
+ map_attribute "id", to: :id
39
+ map_element "title-wrap", to: :title_wrap
40
+ map_element "content-language", to: :content_language
41
+ map_element "std-ident", to: :std_ident
42
+ map_element "doc-ident", to: :doc_ident
43
+ map_element "std-ref", to: :std_ref
44
+ map_element "doc-ref", to: :doc_ref
45
+ map_element "pub-date", to: :pub_date
46
+ map_element "release-date", to: :release_date
47
+ map_element "release-version", to: :release_version
48
+ map_element "comm-ref", to: :comm_ref, render_nil: true
49
+ map_element "secretariat", to: :secretariat, render_nil: true
50
+ map_element "page-count", to: :page_count
51
+ map_element "ics", to: :ics
52
+ map_element "std-xref", to: :std_xref
53
+ map_element "permissions", to: :permissions
54
+ map_element "meta-note", to: :meta_note
55
+ map_element "custom-meta-group", to: :custom_meta_group
56
+ end
57
+ end
58
+ end
59
+ end
@@ -0,0 +1,27 @@
1
+ # frozen_striing_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ require_relative "ext_link"
6
+ require_relative "reference_standard"
7
+
8
+ module Sts
9
+ module NisoSts
10
+ class MixedCitation < Sts::Mapper
11
+ attribute :content, Shale::Type::String
12
+ attribute :bold, Shale::Type::String
13
+ attribute :std, ReferenceStandard
14
+ attribute :ext_link, ExtLink
15
+
16
+ xml do
17
+ root "mixed-citation"
18
+
19
+ map_content to: :content
20
+
21
+ map_element "bold", to: :bold
22
+ map_element "std", to: :std
23
+ map_element "ext-link", to: :ext_link
24
+ end
25
+ end
26
+ end
27
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "../mapper"
4
+
5
+ require_relative "paragraph"
6
+
7
+ module Sts
8
+ module NisoSts
9
+ class NonNormativeExample < Sts::Mapper
10
+ attribute :id, Shale::Type::String
11
+ attribute :p, Paragraph
12
+ attribute :label, Shale::Type::String
13
+
14
+ xml do
15
+ root "non-normative-example"
16
+ map_attribute "id", to: :id
17
+ map_element "p", to: :p
18
+ map_element "label", to: :label
19
+ end
20
+ end
21
+ end
22
+ end
@@ -1,17 +1,19 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require "shale"
3
+ require_relative "../mapper"
4
4
 
5
5
  require_relative "paragraph"
6
6
 
7
7
  module Sts
8
8
  module NisoSts
9
- class NonNormativeNote < Shale::Mapper
9
+ class NonNormativeNote < Sts::Mapper
10
+ attribute :id, Shale::Type::String
10
11
  attribute :p, Paragraph
11
12
  attribute :label, Shale::Type::String
12
13
 
13
14
  xml do
14
15
  root "non-normative-note"
16
+ map_attribute "id", to: :id
15
17
  map_element "p", to: :p
16
18
  map_element "label", to: :label
17
19
  end
@@ -0,0 +1,23 @@
1
+ # rubocop:disable Layout/LineLength
2
+ # <object-id pub-id-type="fpi">+//ISO 9070/RA::A00007::GE::DIN German Institute for
3
+ # Standardization::Standards//NONSGML ISO 13849-1:2006-11-00::Figure 1//EN</object-id>
4
+ # <object-id pub-id-type="publisher-id">fig-1</object-id>
5
+ # rubocop:enable Layout/LineLength
6
+
7
+ require_relative "../mapper"
8
+
9
+ module Sts
10
+ module NisoSts
11
+ class ObjectId < Sts::Mapper
12
+ attribute :pub_id_type, Shale::Type::String
13
+ attribute :content, Shale::Type::String
14
+
15
+ xml do
16
+ root "object-id"
17
+
18
+ map_attribute "pub-id-type", to: :pub_id_type
19
+ map_content to: :content
20
+ end
21
+ end
22
+ end
23
+ 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 PageCount < Shale::Mapper
7
+ class PageCount < Sts::Mapper
8
8
  attribute :count, Shale::Type::Integer
9
9
 
10
10
  xml do
@@ -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