lutaml-xsd 1.2.91 → 1.2.93

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: 2e393ac1e891791490925386f06e9f862e04287ab8866248e63075bcb22c16db
4
- data.tar.gz: 383756510350cd3d61ffe29751e5ff06985efb4fab626c91e218db1546976bd8
3
+ metadata.gz: 6ad03adc4f701faa3d3c132f2704c5dc7e01033e7403750352156cbe7a2333a9
4
+ data.tar.gz: b861d33acb72791876fee6e23ba03bc94a662d570b127056803a75de319a2a4a
5
5
  SHA512:
6
- metadata.gz: bd0a4bb5ccb6da00c0adb3eb0f7621e45c431bcaa0cfdaa2d8c47e5775a411b77eff718a47b6b2ee5dd357ec8bb890b541589c6ba557b9e80af3ed0d3fc8aecd
7
- data.tar.gz: 2a0a5ca5c6da7a35161eacf0a40bd1c4b8e50297d9659e6b696478edc6cecebebf6725d1ba70974978f43e5286ff4d2e0a4fdd85ba4e83535ebe7c2b7d1cabf3
6
+ metadata.gz: 1d64f1ba11d11333972f2cbdbe32c083d423effecefea95b3aca7b99200c0edc314a0861502129ec0a7f58c77a0e7e34474473f2600fd91e6314d25fb83c2949
7
+ data.tar.gz: 3e1f6cfbda1193da0844c8e25c6579503c1ceab084acb5d00674e1682c344326167ff00e5f07881655c898a21fed46f9c0e316174a63d3f4491341085cf4126a
data/TODO.conformance.md CHANGED
@@ -515,6 +515,19 @@ tuple keys, node-set field violations and absent-field rows handled, cross-eleme
515
515
  checks bind the no-ns int ct-A to the ns-b boolean children —
516
516
  'true' vs xsd:int — the per-child type plumbing under hint
517
517
  layering), full type-redefine body semantics.
518
+ - RIDE-407 PIN-BACK (2026-11-05): the leptris 1.9.407.0 + moxml
519
+ 0.6.3 + lutaml-model 0.8.166 train carried fixes (the FULL #45
520
+ stE legs, the #522 attgC four + attgD mostly + attJ018 +
521
+ schF1/P2, stE065/066/096) AND a WHOLESALE 407 regex regression:
522
+ ~177 cases — the ENTIRE Unicode-block escape family (~80
523
+ \p{Is...} per-block tests) plus the reL/reP/reQ/reR/reS/reT
524
+ series — filed leptris-rs#47; moxml 0.6.3 regressed 5 attribute
525
+ cases (addB059/196c/197c, attO009/011) — filed moxml#529. THE
526
+ STACK IS PINNED BACK to the known-good 1.9.406.0/0.6.2/0.8.161
527
+ (98.28% restored, zero regressions vs the 406 baseline). The
528
+ 407 wins ride again when #47 and #529 land. NET: no score
529
+ change; the pin protects the register.
530
+
518
531
  - SIMPLE-TYPE-CHILDREN ROUND (2026-11-05, third attempt — the first
519
532
  two regressed 15 at scale): +1 DataTypes (dtZ86723; suite
520
533
  4613->4614 = 98.25%, zero regressions, rspec green). A simple
@@ -170,7 +170,18 @@ module Lutaml
170
170
  schema = Lutaml::Xml::Schema::Xsd.parse(
171
171
  File.read(kase.schema_path), location: kase.schema_path
172
172
  )
173
- Repository.new(schema.target_namespace.to_s => schema)
173
+ # Location registration (moxml#522): the engine lane's
174
+ # compile consults the schema's file path — without it
175
+ # the facade cannot resolve the instance's
176
+ # xsi:schemaLocation hint documents, and strict admission
177
+ # answers against the head unit alone. The path goes in
178
+ # the LOCATIONS table (second argument), never the
179
+ # namespace table: a path key in all_schemas re-indexes
180
+ # the schema and flips substitution-group verdicts.
181
+ Repository.new(
182
+ { schema.target_namespace.to_s => schema },
183
+ { kase.schema_path => schema },
184
+ )
174
185
  end
175
186
  end
176
187
  end
@@ -604,7 +604,12 @@ module Lutaml
604
604
  return nil unless repository
605
605
 
606
606
  local = particle.ref.to_s.split(":").last
607
- (owner_ns && repository.resolve_global(local, owner_ns)) ||
607
+ exact_ns = repository&.ref_namespace(particle)
608
+ exact_target =
609
+ if exact_ns || owner_ns
610
+ repository.resolve_global(local, exact_ns || owner_ns)
611
+ end
612
+ exact_target ||
608
613
  repository.resolve(local, child.namespace_uri) ||
609
614
  repository.resolve(local, nil)
610
615
  end
@@ -65,6 +65,11 @@ module Lutaml
65
65
  # redefined enumeration). The facet walk never recurses into
66
66
  # named bases, so the body's base reference terminates here.
67
67
  @redefined_simple_bodies = {}
68
+ # Exact namespaces for PREFIXED ref particles, from the
69
+ # owning schema's xmlns declarations (lutaml-model 0.8.167
70
+ # retains them — #1131). The prefix IS the semantics: a ref
71
+ # names the declaration its prefix binds, exactly.
72
+ @ref_namespaces = {}.compare_by_identity
68
73
  @elements = index_elements
69
74
  end
70
75
 
@@ -597,6 +602,96 @@ module Lutaml
597
602
  schema.to_xml]
598
603
  end
599
604
 
605
+ # Exact namespaces for every PREFIXED ref particle in the
606
+ # document, resolved through the document's own xmlns
607
+ # declarations (lutaml-model 0.8.167+ retains them — #1131).
608
+ # The prefix IS the semantics: a ref names the declaration its
609
+ # prefix binds. Documents parsed by older lutaml-models carry
610
+ # no declarations and simply contribute nothing.
611
+ #
612
+ # @return [void]
613
+ def register_ref_namespaces(schema)
614
+ declarations = schema.respond_to?(:xmlns_declarations) &&
615
+ schema.xmlns_declarations
616
+ return unless declarations.is_a?(Hash)
617
+
618
+ descend = lambda do |node, depth|
619
+ return if depth > 10
620
+ return unless node
621
+
622
+ if node.is_a?(Array)
623
+ node.each { |child| descend.call(child, depth) }
624
+ return
625
+ end
626
+
627
+ if node.is_a?(Lutaml::Xml::Schema::Xsd::Element)
628
+ ref = node.ref.to_s
629
+ if ref.include?(":")
630
+ uri = declarations[ref.split(":").first]
631
+ @ref_namespaces[node] = uri if uri
632
+ end
633
+ return
634
+ end
635
+ if node.is_a?(Lutaml::Xml::Schema::Xsd::Group)
636
+ declaration =
637
+ resolve_group((node.ref || node.name).to_s.split(":").last)
638
+ container = declaration &&
639
+ (Array(declaration.sequence).first ||
640
+ Array(declaration.choice).first ||
641
+ Array(declaration.all).first)
642
+ descend.call(container, depth + 1) if container
643
+ return
644
+ end
645
+
646
+ containers = {
647
+ Lutaml::Xml::Schema::Xsd::Schema =>
648
+ %i[element complex_type simple_type attribute
649
+ attribute_group group import include redefine],
650
+ Lutaml::Xml::Schema::Xsd::ComplexType =>
651
+ %i[sequence choice all group complex_content
652
+ simple_content],
653
+ Lutaml::Xml::Schema::Xsd::ExtensionComplexContent =>
654
+ %i[sequence choice all group],
655
+ Lutaml::Xml::Schema::Xsd::RestrictionComplexContent =>
656
+ %i[sequence choice all group],
657
+ Lutaml::Xml::Schema::Xsd::ComplexContent =>
658
+ %i[extension restriction],
659
+ Lutaml::Xml::Schema::Xsd::SimpleContent =>
660
+ %i[extension restriction],
661
+ Lutaml::Xml::Schema::Xsd::Sequence =>
662
+ %i[element any sequence choice group],
663
+ Lutaml::Xsd::Sequence =>
664
+ %i[element any sequence choice group],
665
+ Lutaml::Xml::Schema::Xsd::Choice =>
666
+ %i[element any sequence choice group],
667
+ Lutaml::Xsd::Choice =>
668
+ %i[element any sequence choice group],
669
+ Lutaml::Xml::Schema::Xsd::All => %i[element],
670
+ Lutaml::Xsd::All => %i[element],
671
+ }[node.class]
672
+ return unless containers
673
+
674
+ containers.each do |accessor|
675
+ Array(node.public_send(accessor)).each do |child|
676
+ descend.call(child, depth + 1)
677
+ end
678
+ end
679
+ end
680
+ descend.call(schema, 0)
681
+ end
682
+
683
+ public
684
+
685
+ # The exact namespace a PREFIXED ref particle names, when the
686
+ # owning document's prefix map is retained (0.8.167+); nil
687
+ # otherwise (the owner-namespace heuristic applies).
688
+ #
689
+ # @param particle [Object]
690
+ # @return [String, nil]
691
+ def ref_namespace(particle)
692
+ @ref_namespaces[particle]
693
+ end
694
+
600
695
  def index_schema(index, schema, held_signatures = [],
601
696
  chameleon_namespace = nil,
602
697
  chameleon_includer = nil)
@@ -607,6 +702,7 @@ module Lutaml
607
702
  chameleon = raw_namespace.to_s.empty? && chameleon_namespace
608
703
  namespace = chameleon ? chameleon_namespace : raw_namespace
609
704
  defaults_schema = chameleon ? chameleon_includer : schema
705
+ register_ref_namespaces(schema)
610
706
  Array(schema.element).each do |element|
611
707
  index_element(index, element, namespace, :top, defaults_schema)
612
708
  # A global element's INLINE complexType carries local
@@ -254,9 +254,14 @@ module Lutaml
254
254
  # matches no-namespace declarations, and a hint-loaded
255
255
  # document can supply a foreign namesake. The owner probe
256
256
  # is GLOBAL-only: a ref names a global declaration, and an
257
- # inline namesake must not satisfy it.
257
+ # inline namesake must not satisfy it. A RETAINED prefix
258
+ # map (lutaml-model 0.8.167+, #1131) resolves the ref
259
+ # EXACTLY — the prefix is the semantics.
260
+ exact_ns = repository&.ref_namespace(particle)
258
261
  declaration =
259
- (owner_ns && repository&.resolve_global(local, owner_ns)) ||
262
+ if exact_ns || owner_ns
263
+ repository&.resolve_global(local, exact_ns || owner_ns)
264
+ end ||
260
265
  repository&.resolve(local, child.namespace_uri) ||
261
266
  repository&.resolve(local, nil)
262
267
  # An unresolvable ref (particlesQ032: a no-namespace document
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Lutaml
4
4
  module Xsd
5
- VERSION = "1.2.91"
5
+ VERSION = "1.2.93"
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lutaml-xsd
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.91
4
+ version: 1.2.93
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ribose Inc.