PureXML/Sources/Schema
Mihaela Mihaljevic 1fe670581f feat(schema): key the instance derivation/substitution backbone by namespaced identity; re-land blockDefault; invalid-instances-accepted 89 to 81 (#186, #147)
The instance-validity derivation and substitution tables were keyed by bare
local name, so two same-local-name types or elements in different namespaces
collided. In multi-document validation this let one schema's block/derivation
facts shadow another's, and it blocked honouring blockDefault (whose re-land
widened that collision into an over-rejection).

Key the instance subsystem by namespaced identity {ns}local instead. The shared
DerivationTables keeps its bare-keyed fields for the schema-validity machinery
(Particle-Valid-Restriction and the consistency rules, which resolve QNames to
bare names and walk the same backbone) and gains parallel ns* fields built in
the same pass, resolving each container's components through its target
namespace and prefix bindings. Only the instance consumers
(blockedSubstitutionError, notDerivedSubstitutionError, abstractTypeError, the
substitution-group closure, and referenceParticle) read the ns* tables, via a
derivationKey(fromReference:) that reduces a type:{ns}local reference, a bare
name, or an element ref to a {ns}local backbone key. A key miss stays permissive
(no constraint, substitution allowed), so the re-keying cannot over-reject.

With the namespaced backbone in place, blockDefault is re-landed FP-free: a
schema's blockDefault supplies the {disallowed substitutions} of every element
and complex type without an explicit block (own block overrides; block="" clears;
intersected with the methods each component admits), so blockDefault="extension"
bars an extension substitution and "#all" bars all, without one namespace's
defaults shadowing another's.

The pure re-keying preserves single-document behaviour exactly (the corpus is
overwhelmingly single-namespace, where {ns}local and bare coincide): all four
XSTS buckets held at vsr=0 / isa=69 / vir=0 / ivi=89 after re-keying alone.
blockDefault then drove invalid-instances-accepted 89 to 81, no false positive
(valid-instances-rejected and valid-schemas-rejected held at 0), no other bucket
moved. An adversarial review exercised same- and cross-namespace substitutions,
no-targetNamespace keys, simple-type restriction, transitive substitution groups,
and blockDefault override/over-block cases, and the prior multi-document
cross-namespace blockDefault over-rejection is now accepted while a same-namespace
blocked substitution is still rejected (precise, not merely permissive).
2026-06-18 12:41:18 +02:00
..
BuiltinType.swift fix(schema): compare identity-constraint fields across the decimal value space; invalid-instances-accepted 95 to 94 (#147) 2026-06-18 11:01:05 +02:00
ComplexType.swift fix(schema): intersect a complex type's attribute wildcard sources; invalid-instances-accepted 94 to 89 (#147) 2026-06-18 11:21:32 +02:00
ComplexValidator.swift feat(schema): key the instance derivation/substitution backbone by namespaced identity; re-land blockDefault; invalid-instances-accepted 89 to 81 (#186, #147) 2026-06-18 12:41:18 +02:00
ComplexValidatorAttributes.swift fix(schema): advance XSTS valid-instances-rejected to 4 (#146) 2026-06-16 22:22:05 +02:00
ComplexValidatorContentModel.swift fix(schema): enforce NameAndTypeOK nillable clause in particle restriction (#145) 2026-06-17 17:25:10 +02:00
ComplexValidatorDerivation.swift feat(schema): key the instance derivation/substitution backbone by namespaced identity; re-land blockDefault; invalid-instances-accepted 89 to 81 (#186, #147) 2026-06-18 12:41:18 +02:00
ComplexValidatorHelpers.swift fix(schema): process xsd:anyType wildcards as lax; invalid-instances-accepted 101 to 95 (#146, #147) 2026-06-18 10:44:33 +02:00
ComplexValidatorIDs.swift
ComplexValidatorStreaming.swift fix(schema): process xsd:anyType wildcards as lax; invalid-instances-accepted 101 to 95 (#146, #147) 2026-06-18 10:44:33 +02:00
ComplexValidatorXSIType.swift fix(schema): advance XSTS valid-instances-rejected to 4 (#146) 2026-06-16 22:22:05 +02:00
ContentMatcher.swift fix(schema): enforce NameAndTypeOK nillable clause in particle restriction (#145) 2026-06-17 17:25:10 +02:00
ContentModelDeterminism.swift
DateTimeParser.swift
DateTimeValue.swift
DecimalValue.swift
DerivationMethod.swift
DurationValue.swift
IdentityConstraint.swift fix(schema): resolve identity-constraint XPath prefixes against the schema (#147) 2026-06-17 00:03:13 +02:00
IdentityValidator.swift fix(schema): compare identity-constraint fields across the decimal value space; invalid-instances-accepted 95 to 94 (#147) 2026-06-18 11:01:05 +02:00
IDTracker.swift
Lexical.swift
ParticleNormalization.swift
ParticleRestriction.swift fix(schema): eliminate the last false positive (particlesZ001); false-positives = 0 (#148) 2026-06-17 19:56:57 +02:00
ParticleRestrictionElement.swift feat(schema): enforce particle element type restriction and bypass prohibited attributes 2026-06-15 18:10:21 +02:00
ParticleRestrictionHelpers.swift fix(schema): eliminate the last false positive (particlesZ001); false-positives = 0 (#148) 2026-06-17 19:56:57 +02:00
Primitive.swift fix(schema): validate notation declarations and enumeration restrictions 2026-06-15 22:27:04 +02:00
RelaxNGCompactHelpers.swift
RelaxNGCompactLexer.swift
RelaxNGCompactParser.swift
RelaxNGContentType.swift
RelaxNGDerivative.swift
RelaxNGDiagnostics.swift
RelaxNGFacets.swift fix(schema): advance XSTS valid-instances-rejected to 4 (#146) 2026-06-16 22:22:05 +02:00
RelaxNGGrammarCheck.swift
RelaxNGGrammarCheckSections.swift
RelaxNGNameClasses.swift
RelaxNGNode.swift
RelaxNGParser.swift
RelaxNGParserIncludes.swift
RelaxNGPattern.swift
RelaxNGRestrictionChecker.swift
RelaxNGRestrictionOverlap.swift
RelaxNGRestrictionPaths.swift
RelaxNGRestrictions.swift
RelaxNGSchema.swift feat(validation,schema): composable validation framework and cross-document composition 2026-06-16 09:57:43 +02:00
SchemaAllGroupPlacement.swift
SchemaAttributeApplicability.swift fix(schema): a local element must have a name or a ref; invalid-schemas-accepted 80 to 79 (#145) 2026-06-18 00:34:50 +02:00
SchemaAttributeRestriction.swift fix(schema): a restriction's attribute wildcard must subset the base's (#145) 2026-06-17 18:46:04 +02:00
SchemaAttributeUniqueness.swift fix(schema): an attribute's type must be a simple type (au-props-correct); invalid-schemas-accepted 96 to 95 (#145) 2026-06-17 22:12:01 +02:00
SchemaCompileValidation.swift fix(schema): generalize redefine self-reference to attributeGroups + bound the walk; invalid-schemas-accepted 75 to 74 (#161) 2026-06-18 01:15:16 +02:00
SchemaCompositionValidations.swift fix(schema): generalize redefine self-reference to attributeGroups + bound the walk; invalid-schemas-accepted 75 to 74 (#161) 2026-06-18 01:15:16 +02:00
SchemaContentOrder.swift fix(schema): require a content derivation in simpleContent/complexContent (#145) 2026-06-17 14:58:58 +02:00
SchemaDerivationControl.swift feat(schema): key the instance derivation/substitution backbone by namespaced identity; re-land blockDefault; invalid-instances-accepted 89 to 81 (#186, #147) 2026-06-18 12:41:18 +02:00
SchemaDocument.swift feat(schema): key the instance derivation/substitution backbone by namespaced identity; re-land blockDefault; invalid-instances-accepted 89 to 81 (#186, #147) 2026-06-18 12:41:18 +02:00
SchemaExtensionAllGroup.swift fix(schema): enforce element value-constraint content type (cos-valid-default); invalid-schemas-accepted 99 to 96 (#145) 2026-06-17 22:00:23 +02:00
SchemaFacetApplicability.swift fix(schema): validate value constraints against inline types (#145) 2026-06-17 15:45:06 +02:00
SchemaIDAttribute.swift feat(schema): locate compile diagnostics with validation coding paths (#169) 2026-06-16 10:26:11 +02:00
SchemaIdentityXPath.swift fix(schema): an identity-constraint xpath may not use an undeclared prefix; invalid-schemas-accepted 77 to 75 (#145) 2026-06-18 01:01:12 +02:00
SchemaIDValueConstraint.swift
SchemaImportNamespace.swift fix(schema): a redefined type must derive from itself, not a same-named foreign type (src-redefine.5); invalid-schemas-accepted 84 to 81 (#161) 2026-06-17 23:00:07 +02:00
SchemaNameUniqueness.swift fix(schema): a redefined schema's targetNamespace must match the redefiner (src-redefine); invalid-schemas-accepted 74 to 71 (#161) 2026-06-18 01:25:34 +02:00
SchemaNestedDefinition.swift feat(schema): a nested simpleType or attributeGroup may not be named (localSimpleType) 2026-06-15 15:41:48 +02:00
SchemaNotationValidity.swift fix(schema): hold xsd:notation to its (annotation?) content model (#145) 2026-06-17 14:17:27 +02:00
SchemaRedefineSelfReference.swift fix(schema): generalize redefine self-reference to attributeGroups + bound the walk; invalid-schemas-accepted 75 to 74 (#161) 2026-06-18 01:15:16 +02:00
SchemaReferenceForeignPools.swift feat(validation,schema): composable validation framework and cross-document composition 2026-06-16 09:57:43 +02:00
SchemaReferenceResolution.swift feat(validation,schema): composable validation framework and cross-document composition 2026-06-16 09:57:43 +02:00
SchemaReferences.swift fix(schema): an import namespace must match the imported targetNamespace (src-import.3); invalid-schemas-accepted 87 to 84 (#161) 2026-06-17 22:47:24 +02:00
SchemaSimpleTypeFinal.swift fix(schema): inherit finalDefault as a simple type's final (#145) 2026-06-17 13:59:19 +02:00
SchemaSimpleTypeValidity.swift fix(schema): require a list or union to declare its member types (#145) 2026-06-17 14:11:26 +02:00
SchemaStructure.swift fix(schema): include and redefine require a schemaLocation; invalid-schemas-accepted 71 to 69 (#145) 2026-06-18 01:33:00 +02:00
SchemaStructureHelpers.swift fix(schema): a local complexType must be anonymous; invalid-schemas-accepted 81 to 80 (#145) 2026-06-18 00:17:35 +02:00
SchemaSubstitutionType.swift feat(validation,schema): composable validation framework and cross-document composition 2026-06-16 09:57:43 +02:00
SchemaWildcardNamespace.swift
SimpleType.swift fix(schema): advance XSTS valid-instances-rejected to 4 (#146) 2026-06-16 22:22:05 +02:00
StreamingXSDValidator.swift fix(schema): advance XSTS valid-instances-rejected to 4 (#146) 2026-06-16 22:22:05 +02:00
TypeDerivation.swift
XSDAttributeParser.swift fix(schema): advance XSTS valid-instances-rejected to 4 (#146) 2026-06-16 22:22:05 +02:00
XSDCompletions.swift fix(schema): enforce NameAndTypeOK nillable clause in particle restriction (#145) 2026-06-17 17:25:10 +02:00
XSDComplexContent.swift fix(schema): advance XSTS valid-instances-rejected to 4 (#146) 2026-06-16 22:22:05 +02:00
XSDContext.swift feat(schema): key the instance derivation/substitution backbone by namespaced identity; re-land blockDefault; invalid-instances-accepted 89 to 81 (#186, #147) 2026-06-18 12:41:18 +02:00
XSDDerivation.swift feat(schema): key the instance derivation/substitution backbone by namespaced identity; re-land blockDefault; invalid-instances-accepted 89 to 81 (#186, #147) 2026-06-18 12:41:18 +02:00
XSDDerivationTables.swift feat(schema): key the instance derivation/substitution backbone by namespaced identity; re-land blockDefault; invalid-instances-accepted 89 to 81 (#186, #147) 2026-06-18 12:41:18 +02:00
XSDParser.swift feat(schema): key the instance derivation/substitution backbone by namespaced identity; re-land blockDefault; invalid-instances-accepted 89 to 81 (#186, #147) 2026-06-18 12:41:18 +02:00
XSDParserHelpers.swift feat(schema): key the instance derivation/substitution backbone by namespaced identity; re-land blockDefault; invalid-instances-accepted 89 to 81 (#186, #147) 2026-06-18 12:41:18 +02:00
XSDParserParticles.swift feat(schema): key the instance derivation/substitution backbone by namespaced identity; re-land blockDefault; invalid-instances-accepted 89 to 81 (#186, #147) 2026-06-18 12:41:18 +02:00
XSDParserTypeReferences.swift fix(schema): process xsd:anyType wildcards as lax; invalid-instances-accepted 101 to 95 (#146, #147) 2026-06-18 10:44:33 +02:00
XSDParserUnion.swift feat(schema): key the instance derivation/substitution backbone by namespaced identity; re-land blockDefault; invalid-instances-accepted 89 to 81 (#186, #147) 2026-06-18 12:41:18 +02:00
XSDSchemaValidations.swift feat(validation,schema): composable validation framework and cross-document composition 2026-06-16 09:57:43 +02:00
XSDSimpleParser.swift refactor(schema): surface facet/pattern validity as a Validation, not a parse-time report (#161) 2026-06-18 00:02:20 +02:00
XSDSimpleParser+Facets.swift fix(schema): advance XSTS valid-instances-rejected to 4 (#146) 2026-06-16 22:22:05 +02:00
XSDSubstitutionMembers.swift feat(schema): key the instance derivation/substitution backbone by namespaced identity; re-land blockDefault; invalid-instances-accepted 89 to 81 (#186, #147) 2026-06-18 12:41:18 +02:00
XSDValidations.swift fix(schema): advance XSTS valid-instances-rejected to 4 (#146) 2026-06-16 22:22:05 +02:00
XSDWildcardParser.swift fix(schema): intersect a complex type's attribute wildcard sources; invalid-instances-accepted 94 to 89 (#147) 2026-06-18 11:21:32 +02:00