lutaml-xsd 1.2.101 → 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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 6105bb86be0d4abbb820b3362454d8b05d2323366b35b6d1e6225feafc12dd57
4
- data.tar.gz: 639b6495bc87a3d3b6a8ec3edac0dfc4457da4af3dba1bef20e4d2c464628c54
3
+ metadata.gz: c1b37fc4af01d8c2f652a899644d9f85f13fec225d6ae0ce393b7d16f19df5bc
4
+ data.tar.gz: 2b08927d906be739a784888c3e1d9c9fb5a303362cc6dcc565404e0500b4f74d
5
5
  SHA512:
6
- metadata.gz: 7da7d36525dd07c46f9b81e9e1219f1faf5882c871cca810026b76b65f712cf8387e92ecee363a8f0a4ad23b75b42e7b5a1bcd41cf6a8b1c2793812b58dfaf1d
7
- data.tar.gz: 6475b579cbaa25e35cfcdb497e60c501425337e65676406aec619fbc83a386fb66cf5f94b5e7c4d77a96e79b0ae13bd1818517ca2e10191ae9a31976b5f0fb44
6
+ metadata.gz: 95823a7f86274b2363e65b1a36d0b9aff1078c55196c8f53982d065ec67f0b32b60d1c18436ff8839f65f150373ffa822fa0c4cdaf046f042694ef94279fb0cc
7
+ data.tar.gz: f85b40f50b7ac8d93bfe7341feb8eaf4442ea4ac3b0fb9f3ea51cbb3f832835ac3f36033f9897e816371ba99ddf206f7c271a81389b3bf32370acc2104670968
data/TODO.conformance.md CHANGED
@@ -520,6 +520,25 @@ 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
524
543
  - ANYSIMPLETYPE-WHITESPACE ROUND (2026-11-07): +1 Additional
525
544
  (test93160; suite 4627->4628 = 98.55%, pending measure confirm).
@@ -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
@@ -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 resolve(name, namespace_uri)
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
- return exact&.first if exact
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
 
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lutaml
4
4
  module Xsd
5
- VERSION = "1.2.101"
5
+ VERSION = "1.2.102"
6
6
  end
7
7
  end
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.101
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-07 00:00:00.000000000 Z
11
+ date: 2026-11-08 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: liquid