xsd 2.7.0 → 2.7.2
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/objects/element.rb +0 -6
- data/lib/xsd/objects/restriction.rb +12 -2
- data/lib/xsd/shared/min_max_occurs.rb +6 -0
- data/lib/xsd/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ac666b4ba9690ed163376b0232dec21ba29c7098f2362b6ba9b1d5751fa60ca2
|
4
|
+
data.tar.gz: 8eedebb55d21670bf6620a892073b8c4af9a269e39be1f20e66a1873749c1c76
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: def1638cb816c68f2539611eb5ff2fd5328d729dab3ea530546f54e362f08fb39c06c325f2d734f934231404242adb85f560458c2a1ca8570f482a10fe4e0144
|
7
|
+
data.tar.gz: f62492a9cec4f219cb2b966d033b66c7d7a5f1cfdb7c27ac0bef5a5d7fdc3a3aa3265e5ea8c41fba8069433041fc210ceb7521f60304e3a0704a721bf1b0f567
|
data/CHANGELOG.md
CHANGED
@@ -1,6 +1,8 @@
|
|
1
|
-
## [2.7.
|
1
|
+
## [2.7.2] - 2024-04-17
|
2
2
|
|
3
3
|
- Return <xs:any> and <xs:anyAttribute> from collect_elements/collect_attributes
|
4
|
+
- Make multiple_allowed? available on all definitions with max occurs
|
5
|
+
- Don't return duplicated attributes from complex restriction
|
4
6
|
|
5
7
|
## [2.6.3] - 2024-04-13
|
6
8
|
|
data/lib/xsd/objects/element.rb
CHANGED
@@ -100,12 +100,6 @@ module XSD
|
|
100
100
|
!required?
|
101
101
|
end
|
102
102
|
|
103
|
-
# Determine if element may occur multiple times
|
104
|
-
# @return Boolean
|
105
|
-
def multiple_allowed?
|
106
|
-
computed_max_occurs == :unbounded || computed_max_occurs > 1
|
107
|
-
end
|
108
|
-
|
109
103
|
# Determine if element has complex content
|
110
104
|
# @return Boolean
|
111
105
|
def complex_content?
|
@@ -62,8 +62,18 @@ module XSD
|
|
62
62
|
# @param [Boolean] include_base
|
63
63
|
# @return Array<Element>
|
64
64
|
def collect_elements(include_base = false)
|
65
|
-
#
|
66
|
-
|
65
|
+
# Don't include elements from base by default, that will lead to element duplicates because
|
66
|
+
# elements in complex restriction MUST be all listen in restricting type
|
67
|
+
super(include_base)
|
68
|
+
end
|
69
|
+
|
70
|
+
# Get all available attributes on the current stack level, optionally including base type attributes
|
71
|
+
# @param [Boolean] include_base
|
72
|
+
# @return Array<Attribute>
|
73
|
+
def collect_attributes(include_base = true)
|
74
|
+
result = super(include_base)
|
75
|
+
# Filter restricted attributes to avoid duplicates from restricting and restricted type
|
76
|
+
result.inject({}) { |hash, item| hash[item.name] = item; hash }.values if include_base
|
67
77
|
end
|
68
78
|
end
|
69
79
|
end
|
data/lib/xsd/version.rb
CHANGED