xsd 2.7.4 → 2.7.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -1
- data/lib/xsd/base_object.rb +1 -1
- data/lib/xsd/objects/element.rb +21 -7
- data/lib/xsd/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7c16048b771894d38405e3b63828e12ee144fc08195ea8000b4af88e54928a8a
|
4
|
+
data.tar.gz: bffa90cda6f88776e90aff1e8beaaee1a6574ea98a871cb195fc5fd690873883
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57f15db00816d658965e935e1a546df73dadf2e1efe0e388c0a7280fdd139d6a5daa6a6dac366ec7d50fb647afceb5bb0d931a1c598b8718f238c862198f7777
|
7
|
+
data.tar.gz: 0a3606861353e20d98965bc4f197ed8e04f8613aa52588b88f10991ea2712ff8c9a8219d3da8f1361fd8a4cfb3be82b1ca1046a6f489cf5eeded5bbd934888d2
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
|
-
## [2.7.
|
1
|
+
## [2.7.6] - 2024-04-22
|
2
2
|
|
3
3
|
- Return <xs:any> and <xs:anyAttribute> from collect_elements/collect_attributes
|
4
4
|
- Make multiple_allowed? available on all definitions with max occurs
|
5
5
|
- Don't return duplicated attributes from complex restriction
|
6
|
+
- Fix base_complex_type on restriction without base
|
7
|
+
- Improve substitutable elements detection
|
6
8
|
|
7
9
|
## [2.6.3] - 2024-04-13
|
8
10
|
|
data/lib/xsd/base_object.rb
CHANGED
@@ -343,7 +343,7 @@ module XSD
|
|
343
343
|
name = link[:property] ? send(link[:property]) : nil
|
344
344
|
if name
|
345
345
|
return @cache[method] = object_by_name(link[:type], name)
|
346
|
-
elsif is_a?(Restriction) && method
|
346
|
+
elsif is_a?(Restriction) && %i[base_simple_type base_complex_type].include?(method)
|
347
347
|
# handle restriction without base
|
348
348
|
return nil
|
349
349
|
end
|
data/lib/xsd/objects/element.rb
CHANGED
@@ -130,14 +130,28 @@ module XSD
|
|
130
130
|
complex_type&.mixed_content? || false
|
131
131
|
end
|
132
132
|
|
133
|
-
# Get elements
|
133
|
+
# Get substitutable elements
|
134
134
|
# @return Array<Element>
|
135
|
-
def
|
136
|
-
|
137
|
-
|
138
|
-
|
139
|
-
|
140
|
-
|
135
|
+
def substitutable_elements
|
136
|
+
@substitutable_elements ||= begin
|
137
|
+
if ref
|
138
|
+
reference.substitutable_elements
|
139
|
+
elsif !global? || %w[#all substitution].include?(block)
|
140
|
+
[]
|
141
|
+
else
|
142
|
+
# TODO: we search substituted element only in the same schema with head element, is this enough?
|
143
|
+
# TODO: maybe don't collect all elements but search with xpath first?
|
144
|
+
schema.collect_elements.select do |element|
|
145
|
+
strip_prefix(element.substitution_group) == name
|
146
|
+
end
|
147
|
+
end
|
148
|
+
end
|
149
|
+
end
|
150
|
+
|
151
|
+
# Check is this attribute is global (immediate child of schema element)
|
152
|
+
# @return Boolean
|
153
|
+
def global?
|
154
|
+
parent.is_a?(Schema)
|
141
155
|
end
|
142
156
|
|
143
157
|
# Get base data type
|
data/lib/xsd/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xsd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 2.7.
|
4
|
+
version: 2.7.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- d.arkhipov
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-04-
|
11
|
+
date: 2024-04-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: builder
|