sts 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/release.yml +1 -1
- data/.rubocop.yml +12 -0
- data/Gemfile +6 -0
- data/lib/sts/mapper.rb +442 -0
- data/lib/sts/niso_sts/app.rb +49 -0
- data/lib/sts/niso_sts/app_group.rb +19 -0
- data/lib/sts/niso_sts/back.rb +12 -2
- data/lib/sts/niso_sts/body.rb +2 -2
- data/lib/sts/niso_sts/caption.rb +47 -0
- data/lib/sts/niso_sts/custom_meta.rb +23 -0
- data/lib/sts/niso_sts/custom_meta_group.rb +18 -0
- data/lib/sts/niso_sts/def.rb +19 -0
- data/lib/sts/niso_sts/def_item.rb +24 -0
- data/lib/sts/niso_sts/def_list.rb +28 -0
- data/lib/sts/niso_sts/display_formula.rb +27 -0
- data/lib/sts/niso_sts/document_identification.rb +7 -7
- data/lib/sts/niso_sts/ext_link.rb +20 -0
- data/lib/sts/niso_sts/figure.rb +40 -0
- data/lib/sts/niso_sts/fn.rb +24 -0
- data/lib/sts/niso_sts/fn_group.rb +19 -0
- data/lib/sts/niso_sts/front.rb +9 -2
- data/lib/sts/niso_sts/graphic.rb +29 -0
- data/lib/sts/niso_sts/inline_formula.rb +22 -0
- data/lib/sts/niso_sts/list.rb +9 -1
- data/lib/sts/niso_sts/list_item.rb +25 -0
- data/lib/sts/niso_sts/meta_note.rb +24 -0
- data/lib/sts/niso_sts/metadata_iso.rb +2 -2
- data/lib/sts/niso_sts/metadata_std.rb +59 -0
- data/lib/sts/niso_sts/mixed_citation.rb +27 -0
- data/lib/sts/niso_sts/non_normative_example.rb +22 -0
- data/lib/sts/niso_sts/non_normative_note.rb +4 -2
- data/lib/sts/niso_sts/object_id.rb +23 -0
- data/lib/sts/niso_sts/page_count.rb +2 -2
- data/lib/sts/niso_sts/paragraph.rb +36 -2
- data/lib/sts/niso_sts/permissions.rb +20 -0
- data/lib/sts/niso_sts/reference.rb +4 -1
- data/lib/sts/niso_sts/reference_list.rb +6 -1
- data/lib/sts/niso_sts/reference_standard.rb +17 -6
- data/lib/sts/niso_sts/section.rb +43 -9
- data/lib/sts/niso_sts/standard.rb +14 -1
- data/lib/sts/niso_sts/standard_identification.rb +13 -7
- data/lib/sts/niso_sts/standard_ref.rb +2 -2
- data/lib/sts/niso_sts/std_cross_reference.rb +18 -0
- data/lib/sts/niso_sts/std_id.rb +24 -0
- data/lib/sts/niso_sts/std_id_group.rb +19 -0
- data/lib/sts/niso_sts/term_display.rb +2 -2
- data/lib/sts/niso_sts/term_section.rb +10 -3
- data/lib/sts/niso_sts/title.rb +22 -0
- data/lib/sts/niso_sts/title_wrap.rb +6 -2
- data/lib/sts/niso_sts.rb +1 -0
- data/lib/sts/tbx_iso_tml/bold.rb +18 -0
- data/lib/sts/tbx_iso_tml/caption.rb +17 -0
- data/lib/sts/tbx_iso_tml/col.rb +23 -0
- data/lib/sts/tbx_iso_tml/definition.rb +24 -1
- data/lib/sts/tbx_iso_tml/entailed_term.rb +26 -0
- data/lib/sts/tbx_iso_tml/example.rb +16 -1
- data/lib/sts/tbx_iso_tml/external_graphic.rb +2 -2
- data/lib/sts/tbx_iso_tml/external_source.rb +2 -2
- data/lib/sts/tbx_iso_tml/fn.rb +23 -0
- data/lib/sts/tbx_iso_tml/fn_group.rb +19 -0
- data/lib/sts/tbx_iso_tml/geographical_usage.rb +2 -2
- data/lib/sts/tbx_iso_tml/grammatical_gender.rb +2 -2
- data/lib/sts/tbx_iso_tml/grammatical_number.rb +2 -2
- data/lib/sts/tbx_iso_tml/italic.rb +20 -0
- data/lib/sts/tbx_iso_tml/lang_set.rb +11 -7
- data/lib/sts/tbx_iso_tml/math.rb +62 -0
- data/lib/sts/tbx_iso_tml/mfenced.rb +43 -0
- data/lib/sts/tbx_iso_tml/mfrac.rb +33 -0
- data/lib/sts/tbx_iso_tml/mi.rb +19 -0
- data/lib/sts/tbx_iso_tml/mrow.rb +46 -0
- data/lib/sts/tbx_iso_tml/mspace.rb +18 -0
- data/lib/sts/tbx_iso_tml/mstyle.rb +29 -0
- data/lib/sts/tbx_iso_tml/msub.rb +34 -0
- data/lib/sts/tbx_iso_tml/msup.rb +27 -0
- data/lib/sts/tbx_iso_tml/munder.rb +20 -0
- data/lib/sts/tbx_iso_tml/munderover.rb +24 -0
- data/lib/sts/tbx_iso_tml/named_content.rb +20 -0
- data/lib/sts/tbx_iso_tml/normative_authorization.rb +2 -2
- data/lib/sts/tbx_iso_tml/note.rb +31 -2
- data/lib/sts/tbx_iso_tml/part_of_speech.rb +2 -2
- data/lib/sts/tbx_iso_tml/see.rb +2 -2
- data/lib/sts/tbx_iso_tml/semantics.rb +29 -0
- data/lib/sts/tbx_iso_tml/source.rb +6 -1
- data/lib/sts/tbx_iso_tml/sup.rb +24 -0
- data/lib/sts/tbx_iso_tml/table.rb +32 -0
- data/lib/sts/tbx_iso_tml/table_wrap.rb +32 -0
- data/lib/sts/tbx_iso_tml/table_wrap_foot.rb +19 -0
- data/lib/sts/tbx_iso_tml/tbody.rb +26 -0
- data/lib/sts/tbx_iso_tml/td.rb +60 -0
- data/lib/sts/tbx_iso_tml/term.rb +31 -2
- data/lib/sts/tbx_iso_tml/term_entry.rb +2 -3
- data/lib/sts/tbx_iso_tml/term_information_group.rb +5 -2
- data/lib/sts/tbx_iso_tml/term_type.rb +2 -2
- data/lib/sts/tbx_iso_tml/th.rb +50 -0
- data/lib/sts/tbx_iso_tml/thead.rb +26 -0
- data/lib/sts/tbx_iso_tml/tr.rb +22 -0
- data/lib/sts/tbx_iso_tml/xref.rb +26 -0
- data/lib/sts/tbx_iso_tml.rb +8 -0
- data/lib/sts/version.rb +1 -1
- data/lib/sts.rb +1 -0
- data/sts.gemspec +2 -8
- metadata +61 -59
@@ -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 <
|
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 <
|
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
|
-
|
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 <
|
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
|
-
|
12
|
-
|
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
|
data/lib/sts/niso_sts/section.rb
CHANGED
@@ -1,31 +1,65 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
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"
|
15
|
+
|
16
|
+
module Sts
|
17
|
+
module TbxIsoTml
|
18
|
+
class TableWrap < Sts::Mapper; end
|
19
|
+
end
|
20
|
+
end
|
8
21
|
|
9
22
|
module Sts
|
10
23
|
module NisoSts
|
11
|
-
class
|
24
|
+
class Title < Sts::Mapper; end
|
25
|
+
|
26
|
+
class Section < Sts::Mapper
|
12
27
|
attribute :id, Shale::Type::String
|
28
|
+
attribute :specific_use, Shale::Type::String
|
13
29
|
attribute :label, Shale::Type::String
|
14
|
-
attribute :title,
|
30
|
+
attribute :title, Title
|
15
31
|
attribute :type, Shale::Type::String
|
16
|
-
attribute :
|
32
|
+
attribute :paragraphs, Paragraph, collection: true
|
17
33
|
attribute :list, List, collection: true
|
18
34
|
attribute :term_sec, TermSection, collection: true
|
35
|
+
attribute :ref_list, ReferenceList, collection: true
|
36
|
+
attribute :non_normative_note, NonNormativeNote, collection: true
|
37
|
+
attribute :non_normative_example, NonNormativeExample, collection: true
|
38
|
+
attribute :sec, Section, collection: true
|
39
|
+
attribute :figures, Figure, collection: true
|
40
|
+
attribute :fig, Figure, collection: true
|
41
|
+
|
42
|
+
attribute :table_wrap, Sts::TbxIsoTml::TableWrap, collection: true
|
19
43
|
|
20
44
|
xml do
|
21
|
-
root "
|
22
|
-
|
23
|
-
map_element "label", to: :label
|
24
|
-
map_attribute "sec-type", to: :type
|
45
|
+
root "sec"
|
46
|
+
|
25
47
|
map_attribute "id", to: :id
|
26
|
-
|
48
|
+
map_attribute "sec-type", to: :type
|
49
|
+
map_attribute "specific-use", to: :specific_use
|
50
|
+
|
51
|
+
map_element "label", to: :label
|
52
|
+
map_element "title", to: :title
|
53
|
+
map_element "p", to: :paragraphs
|
54
|
+
map_element "sec", to: :sec
|
27
55
|
map_element "term-sec", to: :term_sec
|
28
56
|
map_element "list", to: :list
|
57
|
+
map_element "figure", to: :figures
|
58
|
+
map_element "fig", to: :fig
|
59
|
+
map_element "ref-list", to: :ref_list
|
60
|
+
map_element "table-wrap", to: :table_wrap
|
61
|
+
map_element "non-normative-note", to: :non_normative_note
|
62
|
+
map_element "non-normative-example", to: :non_normative_example
|
29
63
|
end
|
30
64
|
end
|
31
65
|
end
|
@@ -8,13 +8,26 @@ require_relative "back"
|
|
8
8
|
|
9
9
|
module Sts
|
10
10
|
module NisoSts
|
11
|
-
class Standard <
|
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
|
-
|
3
|
+
require_relative "../mapper"
|
4
|
+
|
5
|
+
require_relative "std_id_group"
|
4
6
|
|
5
7
|
module Sts
|
6
8
|
module NisoSts
|
7
|
-
class StandardIdentification <
|
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
|
18
|
-
map_element
|
19
|
-
map_element
|
20
|
-
map_element
|
21
|
-
map_element
|
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
|
-
|
3
|
+
require_relative "../mapper"
|
4
4
|
|
5
5
|
module Sts
|
6
6
|
module NisoSts
|
7
|
-
class StandardRef <
|
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
|
-
|
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 <
|
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
|
-
|
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 <
|
11
|
-
attribute :
|
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,16 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative "../mapper"
|
4
4
|
|
5
5
|
require_relative "reference_list"
|
6
6
|
|
7
7
|
module Sts
|
8
8
|
module NisoSts
|
9
|
-
class TitleWrap <
|
9
|
+
class TitleWrap < Sts::Mapper
|
10
|
+
attribute :intro, Shale::Type::String
|
10
11
|
attribute :main, Shale::Type::String
|
11
12
|
attribute :full, Shale::Type::String
|
13
|
+
attribute :compl, Shale::Type::String
|
12
14
|
attribute :lang, Shale::Type::String
|
13
15
|
|
14
16
|
xml do
|
@@ -17,8 +19,10 @@ module Sts
|
|
17
19
|
namespace: "http://www.w3.org/XML/1998/namespace",
|
18
20
|
prefix: "xml"
|
19
21
|
|
22
|
+
map_element "intro", to: :intro
|
20
23
|
map_element "main", to: :main
|
21
24
|
map_element "full", to: :full
|
25
|
+
map_element "compl", to: :compl
|
22
26
|
end
|
23
27
|
end
|
24
28
|
end
|
data/lib/sts/niso_sts.rb
CHANGED
@@ -11,6 +11,7 @@ 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"
|
@@ -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 <
|
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
|
@@ -2,16 +2,31 @@
|
|
2
2
|
|
3
3
|
require "shale"
|
4
4
|
|
5
|
+
require_relative "../mapper"
|
6
|
+
require_relative "entailed_term"
|
7
|
+
|
8
|
+
require_relative "../niso_sts/inline_formula"
|
9
|
+
|
5
10
|
module Sts
|
6
11
|
module TbxIsoTml
|
7
|
-
class Example <
|
12
|
+
class Example < Sts::Mapper
|
13
|
+
attribute :id, Shale::Type::String
|
8
14
|
attribute :value, Shale::Type::String
|
15
|
+
attribute :entailed_term, EntailedTerm
|
16
|
+
attribute :inline_formula, Sts::NisoSts::InlineFormula
|
9
17
|
|
10
18
|
xml do
|
11
19
|
root "example"
|
12
20
|
namespace "urn:iso:std:iso:30042:ed-1", "tbx"
|
13
21
|
|
14
22
|
map_content to: :value
|
23
|
+
|
24
|
+
map_attribute "id", to: :id
|
25
|
+
|
26
|
+
map_element "entailedTerm", to: :entailed_term
|
27
|
+
map_element "inline-formula", to: :inline_formula,
|
28
|
+
namespace: nil,
|
29
|
+
prefix: nil
|
15
30
|
end
|
16
31
|
end
|
17
32
|
end
|
@@ -1,10 +1,10 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
-
|
3
|
+
require_relative "../mapper"
|
4
4
|
|
5
5
|
module Sts
|
6
6
|
module TbxIsoTml
|
7
|
-
class ExternalSource <
|
7
|
+
class ExternalSource < Sts::Mapper
|
8
8
|
attribute :target, Shale::Type::String
|
9
9
|
attribute :value, Shale::Type::String
|
10
10
|
|
@@ -0,0 +1,23 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require "shale"
|
4
|
+
|
5
|
+
require_relative "../niso_sts/paragraph"
|
6
|
+
|
7
|
+
module Sts
|
8
|
+
module TbxIsoTml
|
9
|
+
class Fn < Sts::Mapper
|
10
|
+
attribute :id, Shale::Type::String
|
11
|
+
attribute :label, Shale::Type::String
|
12
|
+
attribute :p, Sts::NisoSts::Paragraph
|
13
|
+
|
14
|
+
xml do
|
15
|
+
root "fn"
|
16
|
+
|
17
|
+
map_attribute "id", to: :id
|
18
|
+
map_element "label", to: :label
|
19
|
+
map_element "p", to: :p
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
23
|
+
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 TbxIsoTml
|
9
|
+
class FnGroup < Sts::Mapper
|
10
|
+
attribute :fn, Sts::TbxIsoTml::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
|