sts 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (52) hide show
  1. checksums.yaml +7 -0
  2. data/.github/workflows/rake.yml +15 -0
  3. data/.github/workflows/release.yml +23 -0
  4. data/.gitignore +11 -0
  5. data/.rspec +3 -0
  6. data/CODE_OF_CONDUCT.md +84 -0
  7. data/Gemfile +12 -0
  8. data/README.adoc +36 -0
  9. data/Rakefile +12 -0
  10. data/lib/sts/niso_sts/back.rb +18 -0
  11. data/lib/sts/niso_sts/body.rb +18 -0
  12. data/lib/sts/niso_sts/document_identification.rb +25 -0
  13. data/lib/sts/niso_sts/front.rb +18 -0
  14. data/lib/sts/niso_sts/list.rb +16 -0
  15. data/lib/sts/niso_sts/metadata_iso.rb +41 -0
  16. data/lib/sts/niso_sts/non_normative_note.rb +20 -0
  17. data/lib/sts/niso_sts/page_count.rb +16 -0
  18. data/lib/sts/niso_sts/paragraph.rb +16 -0
  19. data/lib/sts/niso_sts/reference.rb +24 -0
  20. data/lib/sts/niso_sts/reference_list.rb +24 -0
  21. data/lib/sts/niso_sts/reference_standard.rb +24 -0
  22. data/lib/sts/niso_sts/section.rb +32 -0
  23. data/lib/sts/niso_sts/standard.rb +24 -0
  24. data/lib/sts/niso_sts/standard_identification.rb +25 -0
  25. data/lib/sts/niso_sts/standard_ref.rb +18 -0
  26. data/lib/sts/niso_sts/term_display.rb +22 -0
  27. data/lib/sts/niso_sts/term_section.rb +24 -0
  28. data/lib/sts/niso_sts/title_wrap.rb +25 -0
  29. data/lib/sts/niso_sts.rb +21 -0
  30. data/lib/sts/tbx_iso_tml/definition.rb +18 -0
  31. data/lib/sts/tbx_iso_tml/example.rb +18 -0
  32. data/lib/sts/tbx_iso_tml/external_graphic.rb +18 -0
  33. data/lib/sts/tbx_iso_tml/external_source.rb +20 -0
  34. data/lib/sts/tbx_iso_tml/geographical_usage.rb +18 -0
  35. data/lib/sts/tbx_iso_tml/grammatical_gender.rb +19 -0
  36. data/lib/sts/tbx_iso_tml/grammatical_number.rb +19 -0
  37. data/lib/sts/tbx_iso_tml/lang_set.rb +48 -0
  38. data/lib/sts/tbx_iso_tml/normative_authorization.rb +19 -0
  39. data/lib/sts/tbx_iso_tml/note.rb +18 -0
  40. data/lib/sts/tbx_iso_tml/part_of_speech.rb +19 -0
  41. data/lib/sts/tbx_iso_tml/see.rb +20 -0
  42. data/lib/sts/tbx_iso_tml/source.rb +18 -0
  43. data/lib/sts/tbx_iso_tml/term.rb +20 -0
  44. data/lib/sts/tbx_iso_tml/term_entry.rb +26 -0
  45. data/lib/sts/tbx_iso_tml/term_information_group.rb +42 -0
  46. data/lib/sts/tbx_iso_tml/term_type.rb +27 -0
  47. data/lib/sts/tbx_iso_tml.rb +23 -0
  48. data/lib/sts/version.rb +5 -0
  49. data/lib/sts.rb +15 -0
  50. data/sig/sts.rbs +4 -0
  51. data/sts.gemspec +41 -0
  52. metadata +180 -0
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: 6cf9370f41e856bec3105aae63dee1ec0b7de2b0455b82e22efbcaac5356214b
4
+ data.tar.gz: e38776ce218347afda6384f3cd8e0f1b2d3a73ad9797e274ceb4fd9b5eed421f
5
+ SHA512:
6
+ metadata.gz: dc92899284afb3487523d40c6b62850b6b01dfcf87c0a60fff32d66196f3c7aedfda620e0c75a61e5cdc949fce99d0a02ed2a02e9bc55a553637dce0763c51b8
7
+ data.tar.gz: 36abf1f049426ea1453259cc0fe738ce113944aa37ee0d8ef4b892b02a7bb3c596ab1ff1000a2eb9c77faa45f9d2ce88d4ba8351125939a6b150ad5546c35276
@@ -0,0 +1,15 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: rake
4
+
5
+ on:
6
+ push:
7
+ branches: [ master, main ]
8
+ tags: [ v* ]
9
+ pull_request:
10
+
11
+ jobs:
12
+ rake:
13
+ uses: metanorma/ci/.github/workflows/generic-rake.yml@main
14
+ secrets:
15
+ pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
@@ -0,0 +1,23 @@
1
+ # Auto-generated by Cimas: Do not edit it manually!
2
+ # See https://github.com/metanorma/cimas
3
+ name: release
4
+
5
+ on:
6
+ workflow_dispatch:
7
+ inputs:
8
+ next_version:
9
+ description: |
10
+ Next release version. Possible values: x.y.z, major, minor, patch or pre|rc|etc
11
+ required: true
12
+ default: 'skip'
13
+ repository_dispatch:
14
+ types: [ do-release ]
15
+
16
+ jobs:
17
+ release:
18
+ uses: metanorma/ci/.github/workflows/rubygems-release.yml@main
19
+ with:
20
+ next_version: ${{ github.event.inputs.next_version }}
21
+ secrets:
22
+ rubygems-api-key: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
23
+ pat_token: ${{ secrets.METANORMA_CI_PAT_TOKEN }}
data/.gitignore ADDED
@@ -0,0 +1,11 @@
1
+ /.bundle/
2
+ /.yardoc
3
+ /_yardoc/
4
+ /coverage/
5
+ /doc/
6
+ /pkg/
7
+ /spec/reports/
8
+ /tmp/
9
+
10
+ # rspec failure tracking
11
+ .rspec_status
data/.rspec ADDED
@@ -0,0 +1,3 @@
1
+ --format documentation
2
+ --color
3
+ --require spec_helper
@@ -0,0 +1,84 @@
1
+ # Contributor Covenant Code of Conduct
2
+
3
+ ## Our Pledge
4
+
5
+ We as members, contributors, and leaders pledge to make participation in our community a harassment-free experience for everyone, regardless of age, body size, visible or invisible disability, ethnicity, sex characteristics, gender identity and expression, level of experience, education, socio-economic status, nationality, personal appearance, race, religion, or sexual identity and orientation.
6
+
7
+ We pledge to act and interact in ways that contribute to an open, welcoming, diverse, inclusive, and healthy community.
8
+
9
+ ## Our Standards
10
+
11
+ Examples of behavior that contributes to a positive environment for our community include:
12
+
13
+ * Demonstrating empathy and kindness toward other people
14
+ * Being respectful of differing opinions, viewpoints, and experiences
15
+ * Giving and gracefully accepting constructive feedback
16
+ * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ * Focusing on what is best not just for us as individuals, but for the overall community
18
+
19
+ Examples of unacceptable behavior include:
20
+
21
+ * The use of sexualized language or imagery, and sexual attention or
22
+ advances of any kind
23
+ * Trolling, insulting or derogatory comments, and personal or political attacks
24
+ * Public or private harassment
25
+ * Publishing others' private information, such as a physical or email
26
+ address, without their explicit permission
27
+ * Other conduct which could reasonably be considered inappropriate in a
28
+ professional setting
29
+
30
+ ## Enforcement Responsibilities
31
+
32
+ Community leaders are responsible for clarifying and enforcing our standards of acceptable behavior and will take appropriate and fair corrective action in response to any behavior that they deem inappropriate, threatening, offensive, or harmful.
33
+
34
+ Community leaders have the right and responsibility to remove, edit, or reject comments, commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of Conduct, and will communicate reasons for moderation decisions when appropriate.
35
+
36
+ ## Scope
37
+
38
+ This Code of Conduct applies within all community spaces, and also applies when an individual is officially representing the community in public spaces. Examples of representing our community include using an official e-mail address, posting via an official social media account, or acting as an appointed representative at an online or offline event.
39
+
40
+ ## Enforcement
41
+
42
+ Instances of abusive, harassing, or otherwise unacceptable behavior may be reported to the community leaders responsible for enforcement at ronald.tse@ribose.com. All complaints will be reviewed and investigated promptly and fairly.
43
+
44
+ All community leaders are obligated to respect the privacy and security of the reporter of any incident.
45
+
46
+ ## Enforcement Guidelines
47
+
48
+ Community leaders will follow these Community Impact Guidelines in determining the consequences for any action they deem in violation of this Code of Conduct:
49
+
50
+ ### 1. Correction
51
+
52
+ **Community Impact**: Use of inappropriate language or other behavior deemed unprofessional or unwelcome in the community.
53
+
54
+ **Consequence**: A private, written warning from community leaders, providing clarity around the nature of the violation and an explanation of why the behavior was inappropriate. A public apology may be requested.
55
+
56
+ ### 2. Warning
57
+
58
+ **Community Impact**: A violation through a single incident or series of actions.
59
+
60
+ **Consequence**: A warning with consequences for continued behavior. No interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, for a specified period of time. This includes avoiding interactions in community spaces as well as external channels like social media. Violating these terms may lead to a temporary or permanent ban.
61
+
62
+ ### 3. Temporary Ban
63
+
64
+ **Community Impact**: A serious violation of community standards, including sustained inappropriate behavior.
65
+
66
+ **Consequence**: A temporary ban from any sort of interaction or public communication with the community for a specified period of time. No public or private interaction with the people involved, including unsolicited interaction with those enforcing the Code of Conduct, is allowed during this period. Violating these terms may lead to a permanent ban.
67
+
68
+ ### 4. Permanent Ban
69
+
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
+
72
+ **Consequence**: A permanent ban from any sort of public interaction within the community.
73
+
74
+ ## Attribution
75
+
76
+ This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 2.0,
77
+ available at https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.
78
+
79
+ Community Impact Guidelines were inspired by [Mozilla's code of conduct enforcement ladder](https://github.com/mozilla/diversity).
80
+
81
+ [homepage]: https://www.contributor-covenant.org
82
+
83
+ For answers to common questions about this code of conduct, see the FAQ at
84
+ https://www.contributor-covenant.org/faq. Translations are available at https://www.contributor-covenant.org/translations.
data/Gemfile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ source "https://rubygems.org"
4
+
5
+ # Specify your gem's dependencies in sts.gemspec
6
+ gemspec
7
+
8
+ gem "rake", "~> 13.0"
9
+
10
+ gem "rspec", "~> 3.0"
11
+
12
+ gem "rubocop", "~> 1.21"
data/README.adoc ADDED
@@ -0,0 +1,36 @@
1
+ = Ruby library for NISO STS and ISOSTS
2
+
3
+ == Purpose
4
+
5
+ The `sts` Ruby gem allows you to work with NISO STS (0.2+) and ISOSTS documents.
6
+
7
+ NOTE: This is a work-in-progress.
8
+
9
+ This library now parses the reference
10
+ https://www.iso.org/schema/nisosts/v0.2/doc/tbx/examples/tbx-examples.html[TBX-ISO-TML version 1.1 sample file]
11
+ in the NISO STS format (`tbx-nisosts-0.2.xml`).
12
+
13
+ == Library
14
+
15
+ === Usage
16
+
17
+ The following code parses a NISO STS XML document.
18
+
19
+ [source,ruby]
20
+ ----
21
+ require 'sts'
22
+ doc = IO.read('spec/fixtures/tbx-nisosts-0.2.xml')
23
+ sts = Sts::NisoSts::Standard.from_xml(doc)
24
+ puts sts.to_xml(pretty: true)
25
+ # => STS file round-tripped
26
+ ----
27
+
28
+ == Credits
29
+
30
+ This gem is developed, maintained and funded by
31
+ https://www.ribose.com[Ribose Inc.]
32
+
33
+ == License
34
+
35
+ The gem is available as open source under the terms of the
36
+ https://opensource.org/licenses/BSD-2-Clause[2-Clause BSD License].
data/Rakefile ADDED
@@ -0,0 +1,12 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "bundler/gem_tasks"
4
+ require "rspec/core/rake_task"
5
+
6
+ RSpec::Core::RakeTask.new(:spec)
7
+
8
+ require "rubocop/rake_task"
9
+
10
+ RuboCop::RakeTask.new
11
+
12
+ task default: %i[spec rubocop]
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "reference_list"
6
+
7
+ module Sts
8
+ module NisoSts
9
+ class Back < Shale::Mapper
10
+ attribute :ref_list, ReferenceList
11
+
12
+ xml do
13
+ root "back"
14
+ map_element "ref-list", to: :ref_list
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "section"
6
+
7
+ module Sts
8
+ module NisoSts
9
+ class Body < Shale::Mapper
10
+ attribute :sec, Section, collection: true
11
+
12
+ xml do
13
+ root "body"
14
+ map_element "sec", to: :sec
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ module Sts
6
+ module NisoSts
7
+ class DocumentIdentification < Shale::Mapper
8
+ attribute :sdo, Shale::Type::String
9
+ attribute :proj_id, Shale::Type::String
10
+ attribute :language, Shale::Type::String
11
+ attribute :release_version, Shale::Type::String
12
+ attribute :urn, Shale::Type::String
13
+
14
+ xml do
15
+ root "doc-iden"
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
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "metadata_iso"
6
+
7
+ module Sts
8
+ module NisoSts
9
+ class Front < Shale::Mapper
10
+ attribute :iso_meta, MetadataIso
11
+
12
+ xml do
13
+ root "front"
14
+ map_element "iso-meta", to: :iso_meta
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ module Sts
6
+ module NisoSts
7
+ class List < Shale::Mapper
8
+ attribute :text, Shale::Type::String
9
+
10
+ xml do
11
+ root "list"
12
+ map_content to: :text
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,41 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
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
+
10
+ module Sts
11
+ module NisoSts
12
+ class MetadataIso < Shale::Mapper
13
+ attribute :title_wrap, TitleWrap
14
+ attribute :content_language, Shale::Type::String
15
+ attribute :std_ident, StandardIdentification
16
+ attribute :doc_ident, DocumentIdentification
17
+ attribute :std_ref, StandardRef
18
+ attribute :doc_ref, Shale::Type::String
19
+ attribute :pub_date, Shale::Type::String
20
+ attribute :release_date, Shale::Type::String
21
+ attribute :comm_ref, Shale::Type::String
22
+ attribute :secretariat, Shale::Type::String
23
+ attribute :page_count, PageCount
24
+
25
+ xml do
26
+ root "iso-meta"
27
+ map_element "title-wrap", to: :title_wrap
28
+ map_element "content-language", to: :content_language
29
+ map_element "std-ident", to: :std_ident
30
+ map_element "doc-ident", to: :doc_ident
31
+ map_element "std-ref", to: :std_ref
32
+ map_element "doc-ref", to: :doc_ref
33
+ map_element "pub-date", to: :pub_date
34
+ map_element "release-date", to: :release_date
35
+ map_element "comm-ref", to: :comm_ref
36
+ map_element "secretariat", to: :secretariat
37
+ map_element "page-count", to: :page_count
38
+ end
39
+ end
40
+ end
41
+ end
@@ -0,0 +1,20 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "paragraph"
6
+
7
+ module Sts
8
+ module NisoSts
9
+ class NonNormativeNote < Shale::Mapper
10
+ attribute :p, Paragraph
11
+ attribute :label, Shale::Type::String
12
+
13
+ xml do
14
+ root "non-normative-note"
15
+ map_element "p", to: :p
16
+ map_element "label", to: :label
17
+ end
18
+ end
19
+ end
20
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ module Sts
6
+ module NisoSts
7
+ class PageCount < Shale::Mapper
8
+ attribute :count, Shale::Type::Integer
9
+
10
+ xml do
11
+ root "page-count"
12
+ map_attribute "count", to: :count
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,16 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ module Sts
6
+ module NisoSts
7
+ class Paragraph < Shale::Mapper
8
+ attribute :text, Shale::Type::String
9
+
10
+ xml do
11
+ root "p"
12
+ map_content to: :text
13
+ end
14
+ end
15
+ end
16
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "reference_standard"
6
+
7
+ module Sts
8
+ module NisoSts
9
+ class Reference < Shale::Mapper
10
+ attribute :content_type, Shale::Type::String
11
+ attribute :id, Shale::Type::String
12
+ attribute :label, Shale::Type::String
13
+ attribute :std, ReferenceStandard, collection: true
14
+
15
+ xml do
16
+ root "ref"
17
+ map_attribute "content-type", to: :content_type
18
+ map_attribute "id", to: :id
19
+ map_element "label", to: :label
20
+ map_element "std", to: :std
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "reference"
6
+
7
+ module Sts
8
+ module NisoSts
9
+ class ReferenceList < Shale::Mapper
10
+ attribute :content_type, Shale::Type::String
11
+ attribute :id, Shale::Type::String
12
+ attribute :title, Shale::Type::String
13
+ attribute :ref, Reference, collection: true
14
+
15
+ xml do
16
+ root "ref-list"
17
+ map_attribute "content-type", to: :content_type
18
+ map_attribute "id", to: :id
19
+ map_element "title", to: :title
20
+ map_element "ref", to: :ref
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ module Sts
6
+ module NisoSts
7
+ class ReferenceStandard < Shale::Mapper
8
+ attribute :type, Shale::Type::String
9
+ attribute :std_id, Shale::Type::String
10
+ attribute :content, Shale::Type::String
11
+ # attribute :std_ref, Shale::Type::String
12
+ # attribute :title, Shale::Type::String
13
+
14
+ xml do
15
+ root "std"
16
+ map_attribute "type", to: :type
17
+ map_attribute "std-id", to: :std_id
18
+ map_content to: :content
19
+ # map_element "std-ref", to: :std_ref
20
+ # map_element "title", to: :title
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,32 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "paragraph"
6
+ require_relative "list"
7
+ require_relative "term_section"
8
+
9
+ module Sts
10
+ module NisoSts
11
+ class Section < Shale::Mapper
12
+ attribute :id, Shale::Type::String
13
+ attribute :label, Shale::Type::String
14
+ attribute :title, Shale::Type::String
15
+ attribute :type, Shale::Type::String
16
+ attribute :p, Paragraph, collection: true
17
+ attribute :list, List, collection: true
18
+ attribute :term_sec, TermSection, collection: true
19
+
20
+ xml do
21
+ root "standard"
22
+ map_element "title", to: :title
23
+ map_element "label", to: :label
24
+ map_attribute "sec-type", to: :type
25
+ map_attribute "id", to: :id
26
+ map_element "p", to: :p
27
+ map_element "term-sec", to: :term_sec
28
+ map_element "list", to: :list
29
+ end
30
+ end
31
+ end
32
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "front"
6
+ require_relative "body"
7
+ require_relative "back"
8
+
9
+ module Sts
10
+ module NisoSts
11
+ class Standard < Shale::Mapper
12
+ attribute :front, Front
13
+ attribute :body, Body
14
+ attribute :back, Back
15
+
16
+ xml do
17
+ root "standard"
18
+ map_element "front", to: :front
19
+ map_element "body", to: :body
20
+ map_element "back", to: :back
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ module Sts
6
+ module NisoSts
7
+ class StandardIdentification < Shale::Mapper
8
+ attribute :originator, Shale::Type::String
9
+ attribute :doc_type, Shale::Type::String
10
+ attribute :doc_number, Shale::Type::String
11
+ attribute :edition, Shale::Type::String
12
+ attribute :version, Shale::Type::String
13
+
14
+ xml do
15
+ root "std-iden"
16
+
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
22
+ end
23
+ end
24
+ end
25
+ end
@@ -0,0 +1,18 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ module Sts
6
+ module NisoSts
7
+ class StandardRef < Shale::Mapper
8
+ attribute :type, Shale::Type::String
9
+ attribute :value, Shale::Type::String
10
+
11
+ xml do
12
+ root "std-ref"
13
+ map_attribute "type", to: :type
14
+ map_content to: :value
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,22 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "paragraph"
6
+ require_relative "non_normative_note"
7
+
8
+ module Sts
9
+ module NisoSts
10
+ class TermDisplay < Shale::Mapper
11
+ attribute :p, Paragraph, collection: true
12
+ attribute :non_normative_note, NonNormativeNote, collection: true
13
+
14
+ xml do
15
+ root "term-display"
16
+
17
+ map_element "p", to: :p
18
+ map_element "non-normative-note", to: :non_normative_note
19
+ end
20
+ end
21
+ end
22
+ end
@@ -0,0 +1,24 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "../tbx_iso_tml"
6
+ require_relative "term_display"
7
+
8
+ module Sts
9
+ module NisoSts
10
+ class TermSection < Shale::Mapper
11
+ attribute :term_entry, TbxIsoTml::TermEntry # , collection: true
12
+ attribute :term_display, TermDisplay # , collection: true
13
+
14
+ xml do
15
+ root "term-sec"
16
+
17
+ map_element "term-display", to: :term_display
18
+ map_element "termEntry", to: :term_entry,
19
+ namespace: "urn:iso:std:iso:30042:ed-1",
20
+ prefix: "tbx"
21
+ end
22
+ end
23
+ end
24
+ end
@@ -0,0 +1,25 @@
1
+ # frozen_string_literal: true
2
+
3
+ require "shale"
4
+
5
+ require_relative "reference_list"
6
+
7
+ module Sts
8
+ module NisoSts
9
+ class TitleWrap < Shale::Mapper
10
+ attribute :main, Shale::Type::String
11
+ attribute :full, Shale::Type::String
12
+ attribute :lang, Shale::Type::String
13
+
14
+ xml do
15
+ root "title-wrap"
16
+ map_attribute "lang", to: :lang,
17
+ namespace: "http://www.w3.org/XML/1998/namespace",
18
+ prefix: "xml"
19
+
20
+ map_element "main", to: :main
21
+ map_element "full", to: :full
22
+ end
23
+ end
24
+ end
25
+ end