relaton-w3c 1.0.2 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 215e2c9d5f297c9aa8314eac2ed1c9fde29f9921e25ffb55024c826f02119e1d
4
- data.tar.gz: df2f2918cf0e2b6f92139cd270e8e6c4b967b9545fe1373a6ae44f3e4eb00596
3
+ metadata.gz: 5756c84e1bdc95815fce77b2a058687f220340c1ff154b5ee40d1d07934a71c0
4
+ data.tar.gz: 5148b2d1fc04c37f310c3dde66847000941d7056940a9d7d0c1dd2dadea59a39
5
5
  SHA512:
6
- metadata.gz: 2445c87f6ddc4cebf8e0839d5c57261d85244574464c30f3941e17205ffc89f617343e7fa59ab51d1b3ff9971c83313cad074e5f78edf62b48d9d7e32b5230fb
7
- data.tar.gz: 71a59b22bdaa10181ba60faa84fdc28fe50f22a4ba8429d1609a994130e98d6322df244eaebde827e946293b7f68b183f25e0d327053400a3ef6559f984ec974
6
+ metadata.gz: caa8636f7bdb8a257c86acc8755a84fb30fd9f324806940881940346e93d81880a572edde4f5a5041ebd76fa27f00f95c5a3e90ef806ad0c4570e6ec9bece604
7
+ data.tar.gz: e1490c909e083aabdbcbec63f3c361e847101f9e829bc804e73daf31e9acb3a5cc55fb13ecfa6f3b8911fb6565f4182baeb33aad397cf25f73e56bdf3a96c186
@@ -88,7 +88,7 @@
88
88
  <text/>
89
89
  </element>
90
90
  </define>
91
- <define name="LocalizedString">
91
+ <define name="LocalizedString1">
92
92
  <optional>
93
93
  <!-- multiple languages and scripts possible: comma delimit them if so -->
94
94
  <attribute name="language"/>
@@ -98,6 +98,16 @@
98
98
  </optional>
99
99
  <text/>
100
100
  </define>
101
+ <define name="LocalizedString">
102
+ <choice>
103
+ <ref name="LocalizedString1"/>
104
+ <oneOrMore>
105
+ <element name="variant">
106
+ <ref name="LocalizedString1"/>
107
+ </element>
108
+ </oneOrMore>
109
+ </choice>
110
+ </define>
101
111
  <!--
102
112
  Unlike UML, change type to format: type is overloaded
103
113
  Would be need if plain were default value and could omit the attribute
@@ -121,7 +131,7 @@
121
131
  </optional>
122
132
  <ref name="LocalizedStringOrXsAny"/>
123
133
  </define>
124
- <define name="LocalizedStringOrXsAny">
134
+ <define name="LocalizedStringOrXsAny1">
125
135
  <optional>
126
136
  <!-- multiple languages and scripts possible: comma delimit them if so -->
127
137
  <attribute name="language"/>
@@ -136,6 +146,16 @@
136
146
  </choice>
137
147
  </oneOrMore>
138
148
  </define>
149
+ <define name="LocalizedStringOrXsAny">
150
+ <choice>
151
+ <ref name="LocalizedStringOrXsAny1"/>
152
+ <oneOrMore>
153
+ <element name="variant">
154
+ <ref name="LocalizedStringOrXsAny1"/>
155
+ </element>
156
+ </oneOrMore>
157
+ </choice>
158
+ </define>
139
159
  <define name="contributor">
140
160
  <element name="contributor">
141
161
  <zeroOrMore>
@@ -641,9 +661,9 @@
641
661
  <optional>
642
662
  <ref name="status"/>
643
663
  </optional>
644
- <optional>
664
+ <zeroOrMore>
645
665
  <ref name="copyright"/>
646
- </optional>
666
+ </zeroOrMore>
647
667
  <zeroOrMore>
648
668
  <ref name="docrelation"/>
649
669
  </zeroOrMore>
@@ -1001,7 +1021,17 @@
1001
1021
  <optional>
1002
1022
  <ref name="to"/>
1003
1023
  </optional>
1004
- <ref name="owner"/>
1024
+ <oneOrMore>
1025
+ <ref name="owner"/>
1026
+ </oneOrMore>
1027
+ <optional>
1028
+ <ref name="copyright_scope"/>
1029
+ </optional>
1030
+ </element>
1031
+ </define>
1032
+ <define name="copyright_scope">
1033
+ <element name="scope">
1034
+ <text/>
1005
1035
  </element>
1006
1036
  </define>
1007
1037
  <define name="from">
@@ -1,4 +1,11 @@
1
1
  module RelatonW3c
2
2
  class HashConverter < RelatonBib::HashConverter
3
+ class << self
4
+ # @param item_hash [Hash]
5
+ # @return [RelatonW3c::W3cBibliographicItem]
6
+ def bib_item(item_hash)
7
+ W3cBibliographicItem.new item_hash
8
+ end
9
+ end
3
10
  end
4
11
  end
@@ -1,3 +1,3 @@
1
1
  module RelatonW3c
2
- VERSION = "1.0.2".freeze
2
+ VERSION = "1.1.0".freeze
3
3
  end
@@ -1,19 +1,6 @@
1
1
  module RelatonW3c
2
2
  class XMLParser < RelatonBib::XMLParser
3
3
  class << self
4
- # @param xml [String]
5
- # @return [RelatonW3c::W3cBibliographicItem, NilClass]
6
- def from_xml(xml)
7
- doc = Nokogiri::XML xml
8
- doc.remove_namespaces!
9
- item = doc.at("/bibitem|/bibdata")
10
- if item
11
- W3cBibliographicItem.new(item_data(item))
12
- else
13
- warn "[relaton-w3c] can't find bibitem or bibdata element in the XML"
14
- end
15
- end
16
-
17
4
  private
18
5
 
19
6
  # Override RelatonBib::XMLParser.item_data method.
@@ -27,6 +14,12 @@ module RelatonW3c
27
14
  data[:doctype] = ext.at("./doctype")&.text
28
15
  data
29
16
  end
17
+
18
+ # @param item_hash [Hash]
19
+ # @return [RelatonBib::BibliographicItem]
20
+ def bib_item(item_hash)
21
+ W3cBibliographicItem.new item_hash
22
+ end
30
23
  end
31
24
  end
32
25
  end
@@ -39,5 +39,5 @@ Gem::Specification.new do |spec|
39
39
  spec.add_development_dependency "vcr"
40
40
  spec.add_development_dependency "webmock"
41
41
 
42
- spec.add_dependency "relaton-bib", ">= 1.0.4"
42
+ spec.add_dependency "relaton-bib", ">= 1.1.0"
43
43
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: relaton-w3c
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-26 00:00:00.000000000 Z
11
+ date: 2020-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: debase
@@ -114,14 +114,14 @@ dependencies:
114
114
  requirements:
115
115
  - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: 1.0.4
117
+ version: 1.1.0
118
118
  type: :runtime
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
122
  - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: 1.0.4
124
+ version: 1.1.0
125
125
  description: 'RelatonIso: retrieve W3C Standards for bibliographic using the IsoBibliographicItem
126
126
  model'
127
127
  email: