lutaml-xsd 1.2.100 → 1.2.102
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/TODO.conformance.md +40 -0
- data/lib/lutaml/xsd/validation/rule_engine.rb +36 -1
- data/lib/lutaml/xsd/validation/rules/attribute_validation_rule.rb +3 -1
- data/lib/lutaml/xsd/validation/rules/type_validation_rule.rb +4 -1
- data/lib/lutaml/xsd/validation/schema_definition_resolver.rb +26 -2
- data/lib/lutaml/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: c1b37fc4af01d8c2f652a899644d9f85f13fec225d6ae0ce393b7d16f19df5bc
|
|
4
|
+
data.tar.gz: 2b08927d906be739a784888c3e1d9c9fb5a303362cc6dcc565404e0500b4f74d
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 95823a7f86274b2363e65b1a36d0b9aff1078c55196c8f53982d065ec67f0b32b60d1c18436ff8839f65f150373ffa822fa0c4cdaf046f042694ef94279fb0cc
|
|
7
|
+
data.tar.gz: f85b40f50b7ac8d93bfe7341feb8eaf4442ea4ac3b0fb9f3ea51cbb3f832835ac3f36033f9897e816371ba99ddf206f7c271a81389b3bf32370acc2104670968
|
data/TODO.conformance.md
CHANGED
|
@@ -520,7 +520,47 @@ tuple keys, node-set field violations and absent-field rows handled, cross-eleme
|
|
|
520
520
|
stE legs, the #522 attgC four + attgD mostly + attJ018 +
|
|
521
521
|
schF1/P2, stE065/066/096) AND a WHOLESALE 407 regex regression:
|
|
522
522
|
~177 cases — the ENTIRE Unicode-block escape family (~80
|
|
523
|
+
- PARENT-CONTEXT ROUND A (2026-11-08): +1 Errata10 (errC007; suite
|
|
524
|
+
4628->4629 = 98.57%, zero regressions, rspec green). The
|
|
525
|
+
parent-context redesign opens with an ENGINE-LEVEL win: anyType
|
|
526
|
+
content is LAX — a child validates only against a declaration in
|
|
527
|
+
its OWN namespace, so a strictly-unresolvable child of an anyType
|
|
528
|
+
element (including one the namespace fallback would have served
|
|
529
|
+
from a targeted schema) is lax-undeclared and its subtree escapes
|
|
530
|
+
assessment (the suppression rides the existing skip-wildcard walk,
|
|
531
|
+
hereditary like QFE1700a1). The resolver gains resolve_strict
|
|
532
|
+
(exact-namespace only) and the shared anyType reference check.
|
|
533
|
+
errC007's contract is now enforced WITHOUT the namespace-fallback
|
|
534
|
+
narrowing that regressed five substitution/import shapes — those
|
|
535
|
+
lookups never touch this path. Round B (next): positional binding
|
|
536
|
+
for duplicate same-named particles (isDefault079) — ordered
|
|
537
|
+
per-call walk (the resolver's visited_particle? memoizes on the
|
|
538
|
+
instance and would poison repeats), gated on >1 same-named
|
|
539
|
+
particles AND all indexed (@namespaces.key? — the attempt-3
|
|
540
|
+
starvation guard).
|
|
541
|
+
|
|
523
542
|
\p{Is...} per-block tests) plus the reL/reP/reQ/reR/reS/reT
|
|
543
|
+
- ANYSIMPLETYPE-WHITESPACE ROUND (2026-11-07): +1 Additional
|
|
544
|
+
(test93160; suite 4627->4628 = 98.55%, pending measure confirm).
|
|
545
|
+
xs:anySimpleType's whiteSpace is PRESERVE — the ur-simple type
|
|
546
|
+
canonicalizes nothing — but the fixed-compare whitespace rule fell
|
|
547
|
+
through to collapse, so whitespace-padded text equaled the fixed
|
|
548
|
+
value. The element- and attribute-side whitespace maps now send
|
|
549
|
+
anySimpleType to preserve; the fixed compare is a RAW-LEXICAL
|
|
550
|
+
compare (xmllint: the padded actual does not match the fixed).
|
|
551
|
+
PARKED same-day classifications (the per-position binding wall —
|
|
552
|
+
the parent-context redesign charter): isDefault079 (two same-named
|
|
553
|
+
locals with DIFFERENT fixed values — the second child binds to the
|
|
554
|
+
second particle; we mis-bind to the first; xmllint validates),
|
|
555
|
+
QFE1700c1 (skip-suppression must follow the matcher's DETERMINISTIC
|
|
556
|
+
assignment — the ref particle takes its e2 and validates its
|
|
557
|
+
content, not the skip-wildcard hereditary escape), addB065
|
|
558
|
+
(xsi:nil=true on non-nillable silent), addB188 (xsi:type-assessed
|
|
559
|
+
undeclared root skips the attribute check). errC007's namespace
|
|
560
|
+
fallback narrowing REVERTED after 5 regressions (addB132/ctZ007/
|
|
561
|
+
elemZ021b/f/elemZ023 lean on the lenient fallback for
|
|
562
|
+
substitution/import shapes) — parked with the same charter.
|
|
563
|
+
|
|
524
564
|
series — filed leptris-rs#47; moxml 0.6.3 regressed 5 attribute
|
|
525
565
|
- WILDCARD-LAYERING ROUND (2026-11-07): +3 Wildcards (wildZ013b/c
|
|
526
566
|
valid, wildZ013e invalid; suite 4624->4627 = 98.57%, zero
|
|
@@ -58,7 +58,8 @@ module Lutaml
|
|
|
58
58
|
# empty xs:int child escapes assessment too).
|
|
59
59
|
next true if subtree_suppressed
|
|
60
60
|
|
|
61
|
-
skip_here = skip_wildcard_subtree?(parent, xml_element, resolver)
|
|
61
|
+
skip_here = skip_wildcard_subtree?(parent, xml_element, resolver) ||
|
|
62
|
+
lax_any_type_child?(parent, xml_element, resolver)
|
|
62
63
|
next true if skip_here
|
|
63
64
|
|
|
64
65
|
schema_def = resolver.resolve(
|
|
@@ -223,6 +224,40 @@ module Lutaml
|
|
|
223
224
|
end
|
|
224
225
|
end
|
|
225
226
|
|
|
227
|
+
# A child of an ANYTYPE element validates only against a
|
|
228
|
+
# declaration in its OWN namespace (anyType content is lax —
|
|
229
|
+
# errC007's contract); a child with no exact-namespace
|
|
230
|
+
# declaration is lax-undeclared and its subtree escapes
|
|
231
|
+
# assessment. The namespace fallback never serves this
|
|
232
|
+
# decision: a targeted schema's global is a DIFFERENT element
|
|
233
|
+
# than the unqualified child.
|
|
234
|
+
#
|
|
235
|
+
# @return [Boolean]
|
|
236
|
+
def lax_any_type_child?(parent, child, resolver)
|
|
237
|
+
return false unless parent
|
|
238
|
+
|
|
239
|
+
declaration = resolver.resolve(parent.name, parent.namespace_uri)
|
|
240
|
+
return false unless any_type_declaration?(declaration, resolver)
|
|
241
|
+
|
|
242
|
+
resolver.resolve_strict(child.name, child.namespace_uri).nil?
|
|
243
|
+
end
|
|
244
|
+
|
|
245
|
+
# Whether the declaration's effective type is xs:anyType:
|
|
246
|
+
# declared by reference, or the implicit default for a typeless
|
|
247
|
+
# declaration.
|
|
248
|
+
#
|
|
249
|
+
# @return [Boolean]
|
|
250
|
+
def any_type_declaration?(declaration, resolver)
|
|
251
|
+
return false unless
|
|
252
|
+
declaration.is_a?(Lutaml::Xml::Schema::Xsd::Element)
|
|
253
|
+
|
|
254
|
+
return true if resolver.builtin_any_type?(declaration.type.to_s)
|
|
255
|
+
|
|
256
|
+
declaration.type.to_s.empty? &&
|
|
257
|
+
declaration.complex_type.nil? &&
|
|
258
|
+
declaration.simple_type.nil?
|
|
259
|
+
end
|
|
260
|
+
|
|
226
261
|
# Handle errors that occur during rule execution
|
|
227
262
|
#
|
|
228
263
|
# @param rule [ValidationRule] The rule that failed
|
|
@@ -653,7 +653,9 @@ module Lutaml
|
|
|
653
653
|
return :preserve unless builtin_type_name?(reference)
|
|
654
654
|
|
|
655
655
|
local = reference.split(":").last
|
|
656
|
-
|
|
656
|
+
# anySimpleType's whiteSpace is PRESERVE — the ur-simple
|
|
657
|
+
# type canonicalizes nothing.
|
|
658
|
+
return :preserve if ["string", "anySimpleType"].include?(local)
|
|
657
659
|
return :replace if local == "normalizedString"
|
|
658
660
|
|
|
659
661
|
:collapse
|
|
@@ -488,7 +488,10 @@ module Lutaml
|
|
|
488
488
|
end
|
|
489
489
|
|
|
490
490
|
case local
|
|
491
|
-
when "string"
|
|
491
|
+
when "string", "anySimpleType"
|
|
492
|
+
# anySimpleType's whiteSpace is PRESERVE (the ur-simple
|
|
493
|
+
# type canonicalizes nothing) — a fixed compare against
|
|
494
|
+
# it compares the raw lexical (test93160).
|
|
492
495
|
:preserve
|
|
493
496
|
when "normalizedString"
|
|
494
497
|
:replace
|
|
@@ -159,10 +159,14 @@ module Lutaml
|
|
|
159
159
|
@expected_namespaces[element]
|
|
160
160
|
end
|
|
161
161
|
|
|
162
|
+
# The namespace-EXACT resolution — no unique-name fallback. The
|
|
163
|
+
# lax anyType-content decision (errC007) and other
|
|
164
|
+
# namespace-strict consumers use it.
|
|
165
|
+
#
|
|
162
166
|
# @param name [String] local element name
|
|
163
167
|
# @param namespace_uri [String, nil] instance element namespace
|
|
164
168
|
# @return [Lutaml::Xml::Schema::Xsd::Element, nil]
|
|
165
|
-
def
|
|
169
|
+
def resolve_strict(name, namespace_uri)
|
|
166
170
|
return nil if name.nil? || name.empty?
|
|
167
171
|
|
|
168
172
|
candidates = @elements[name]
|
|
@@ -171,13 +175,33 @@ module Lutaml
|
|
|
171
175
|
exact = candidates.find do |_element, namespace, _kind|
|
|
172
176
|
namespace_matches?(namespace, namespace_uri)
|
|
173
177
|
end
|
|
174
|
-
|
|
178
|
+
exact&.first
|
|
179
|
+
end
|
|
180
|
+
|
|
181
|
+
# Whether the type reference names xs:anyType.
|
|
182
|
+
#
|
|
183
|
+
# @param reference [String]
|
|
184
|
+
# @return [Boolean]
|
|
185
|
+
def builtin_any_type?(reference)
|
|
186
|
+
parts = reference.to_s.split(":")
|
|
187
|
+
%w[xs xsd].include?(parts.first) && parts.last == "anyType"
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
# @param name [String] local element name
|
|
191
|
+
# @param namespace_uri [String, nil] instance element namespace
|
|
192
|
+
# @return [Lutaml::Xml::Schema::Xsd::Element, nil]
|
|
193
|
+
def resolve(name, namespace_uri)
|
|
194
|
+
exact = resolve_strict(name, namespace_uri)
|
|
195
|
+
return exact if exact
|
|
175
196
|
|
|
176
197
|
# Unique-name fallback for instances that omit namespaces even
|
|
177
198
|
# though the schema declares one. A foreign namespace never
|
|
178
199
|
# falls back.
|
|
179
200
|
return nil unless namespace_uri.to_s.empty?
|
|
180
201
|
|
|
202
|
+
candidates = @elements[name]
|
|
203
|
+
return nil if candidates.empty?
|
|
204
|
+
|
|
181
205
|
candidates.length == 1 ? candidates.first.first : nil
|
|
182
206
|
end
|
|
183
207
|
|
data/lib/lutaml/xsd/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: lutaml-xsd
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.2.
|
|
4
|
+
version: 1.2.102
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Ribose Inc.
|
|
8
8
|
autorequire:
|
|
9
9
|
bindir: exe
|
|
10
10
|
cert_chain: []
|
|
11
|
-
date: 2026-11-
|
|
11
|
+
date: 2026-11-08 00:00:00.000000000 Z
|
|
12
12
|
dependencies:
|
|
13
13
|
- !ruby/object:Gem::Dependency
|
|
14
14
|
name: liquid
|