PureXML/Sources/Schema
Mihaela Mihaljevic 20da41995a
fix(schema): resolve an unprefixed xsi:type in the instance namespace context (#383)
An xsi:type value is a QName: a prefix binds through that prefix, an unprefixed
name through the in-scope default namespace, and with no default namespace an
unprefixed name is in no namespace. PureXML stores each named type under both its
namespaced key and a bare local-name alias (for lenient lookup), so an unprefixed
xsi:type="Test" matched a {targetNS}Test through the alias even when the instance
had no default namespace, wrongly typing an otherwise-undeclared root and
accepting the document (W3C XSTS targetNS00101m; libxml2 rejects it identically).

xsiTypeReference now keys an unprefixed xsi:type to the in-scope default namespace
(none here) rather than returning the bare local name, so xsi:type="Test" names
no-namespace Test, which does not exist; the root then has neither a declaration
nor a usable type and the instance is invalid. A prefixed xsi:type and an
unprefixed one under a default namespace equal to the target namespace are
unaffected, and the child-element builtin-substitution path keeps its bare-name
fallback (xsiTypeName), so an unprefixed builtin still substitutes where valid.

Verified over the full W3C XSTS corpus in release: invalid-instances-accepted
6 -> 5, valid-instances-rejected held at 0 across all 14383 groups, full suite
(1840 tests) and wasm green. An adversarial critic traced every resolveNamedType
branch, including the unprefixed-builtin-via-key case, and confirmed the only
path that no longer resolves corresponds to a spec-invalid reference, so no valid
instance is newly rejected.
2026-06-29 10:10:04 +02:00
..
BuiltinType.swift
ComplexType.swift feat(schema): carry a stable group-definition identity on shared expansions (#363) 2026-06-28 01:53:58 +02:00
ComplexValidator.swift perf(schema): graph-structured-stack content matcher, killing the last 2^K content-model hang (#364) 2026-06-28 05:07:37 +02:00
ComplexValidatorAttributes.swift fix(schema): resolve defaulted/fixed IDREF attributes against IDs 2026-06-22 18:56:36 +02:00
ComplexValidatorContentModel.swift perf(schema): graph-structured-stack content matcher, killing the last 2^K content-model hang (#364) 2026-06-28 05:07:37 +02:00
ComplexValidatorDerivation.swift fix(schema): block an xsi:type that reaches a union declared type through a member (#277) 2026-06-24 21:12:35 +02:00
ComplexValidatorHelpers.swift fix(schema): resolve an unprefixed xsi:type in the instance namespace context (#383) 2026-06-29 10:10:04 +02:00
ComplexValidatorIDs.swift
ComplexValidatorStreaming.swift fix(schema): optional xs:all group requires its members when present 2026-06-22 18:29:09 +02:00
ComplexValidatorXSIType.swift
ContentMatcher.swift fix(schema): saturate effectively-unbounded content-model counters (#192, partial) 2026-06-21 13:16:24 +02:00
ContentModelDeterminism.swift feat(schema): compositional UPA determinism, delete positionCap 2026-06-22 22:19:44 +02:00
ContentModelDeterminismCompositional.swift perf(schema): make the UPA determinism check depth-safe on group-reference chains (#371) 2026-06-28 23:15:32 +02:00
ContentModelDeterminismConflict.swift perf(schema): make the UPA determinism check depth-safe on group-reference chains (#371) 2026-06-28 23:15:32 +02:00
ContentModelEffectiveModel.swift fix(schema): check UPA over an extension's effective content model 2026-06-21 22:12:32 +02:00
ContentModelGroupDependency.swift perf(schema): make the UPA determinism check depth-safe on group-reference chains (#371) 2026-06-28 23:15:32 +02:00
ContentNFABuilder.swift
ContentRTN.swift perf(schema): graph-structured-stack content matcher, killing the last 2^K content-model hang (#364) 2026-06-28 05:07:37 +02:00
ContentRTNMatcher.swift perf(schema): assert the GSS matcher's runtime bound by count, not wall-clock (#369) 2026-06-28 20:36:54 +02:00
DateTimeParser.swift
DateTimeValue.swift
DecimalValue.swift
DerivationMethod.swift
DurationValue.swift
GroupParticleMemo.swift feat(schema): carry a stable group-definition identity on shared expansions (#363) 2026-06-28 01:53:58 +02:00
IdentityConstraint.swift
IdentityFieldSimplicity.swift fix(schema): reject an identity-constraint field that selects a non-simple node (#381) 2026-06-29 09:08:25 +02:00
IdentityFieldType.swift fix(schema): reject identity field whose declared target is a non-simple complex type 2026-06-22 13:10:30 +02:00
IdentityFieldValue.swift
IdentityTupleSet.swift perf(schema): make xsd identity-constraint validation linear (#312) 2026-06-26 02:45:17 +02:00
IdentityValidator.swift fix(schema): reject an identity-constraint field that selects a non-simple node (#381) 2026-06-29 09:08:25 +02:00
IdentityValidatorDefaults.swift
IDTracker.swift
Lexical.swift
OccurrenceRange.swift
ParticleNormalization.swift
ParticleRestriction.swift fix(schema): attribute-wildcard union/intersection per Errata E1-10 (#251) 2026-06-23 04:56:17 +02:00
ParticleRestrictionElement.swift fix(schema): apply cos-st-derived-ok to NameAndTypeOK over a union base (#359) 2026-06-27 23:45:40 +02:00
ParticleRestrictionHelpers.swift
Primitive.swift fix(schema): match a NaN value against a NaN enumeration (value-space identity) (#376) 2026-06-29 05:20:07 +02:00
RelaxNGCompactHelpers.swift
RelaxNGCompactLexer.swift
RelaxNGCompactParser.swift
RelaxNGContentType.swift
RelaxNGDerivative.swift
RelaxNGDiagnostics.swift
RelaxNGFacets.swift
RelaxNGGrammarCheck.swift
RelaxNGGrammarCheckSections.swift
RelaxNGNameClasses.swift
RelaxNGNode.swift
RelaxNGParser.swift
RelaxNGParserIncludes.swift
RelaxNGPattern.swift
RelaxNGRestrictionChecker.swift
RelaxNGRestrictionOverlap.swift
RelaxNGRestrictionPaths.swift
RelaxNGRestrictions.swift
RelaxNGSchema.swift
SchemaAllGroupPlacement.swift feat(schema): locate derivation/cycle-pass schema diagnostics 2026-06-21 16:53:02 +02:00
SchemaAttributeApplicability.swift feat(schema): locate structure-pass schema diagnostics 2026-06-21 15:23:13 +02:00
SchemaAttributeRestriction.swift fix(schema): reject a simpleContent restriction that relaxes a required attribute (#326) 2026-06-26 11:35:33 +02:00
SchemaAttributeUniqueness.swift fix(schema): flatten redefine self-reference and exclude prohibited uses in attribute uniqueness 2026-06-22 03:52:13 +02:00
SchemaCompileValidation.swift refactor(schema): remove unused [String] consistency wrappers (#317) 2026-06-26 08:02:09 +02:00
SchemaCompositionValidations.swift feat(schema): locate composition/redefine-pass schema diagnostics 2026-06-21 19:41:31 +02:00
SchemaContentDerivation.swift fix(schema): a complexContent restriction cannot restrict simple content 2026-06-22 19:40:57 +02:00
SchemaContentOrder.swift
SchemaDerivationControl.swift
SchemaDocument.swift fix(schema): reject an identity-constraint field that selects a non-simple node (#381) 2026-06-29 09:08:25 +02:00
SchemaDocumentHints.swift
SchemaElementDeclarationsConsistent.swift refactor(schema): split Element-Declarations-Consistent out of SchemaStructure 2026-06-22 15:30:58 +02:00
SchemaExtensionAllGroup.swift feat(schema): locate extension/substitution-pass schema diagnostics 2026-06-21 18:35:38 +02:00
SchemaFacetApplicability.swift perf(schema): resolve a simple-type restriction chain in linear, not cubic, time (#373) 2026-06-29 02:55:02 +02:00
SchemaIDAttribute.swift refactor(schema): remove unused [String] consistency wrappers (#317) 2026-06-26 08:02:09 +02:00
SchemaIdentityXPath.swift
SchemaIDValueConstraint.swift feat(schema): locate ID-typed value-constraint errors 2026-06-21 14:37:29 +02:00
SchemaImportNamespace.swift feat(schema): locate reference-resolution schema diagnostics 2026-06-21 18:09:20 +02:00
SchemaNameUniqueness.swift refactor(schema): remove unused [String] consistency wrappers (#317) 2026-06-26 08:02:09 +02:00
SchemaNestedDefinition.swift feat(schema): locate structure-pass schema diagnostics 2026-06-21 15:23:13 +02:00
SchemaNotationValidity.swift feat(schema): locate names/UPA/notation-pass schema diagnostics 2026-06-21 19:16:54 +02:00
SchemaRedefineAttributeGroupRestriction.swift refactor(schema): split redefine attribute-group restriction into its own file 2026-06-22 15:07:53 +02:00
SchemaRedefineSelfReference.swift refactor(schema): split redefine attribute-group restriction into its own file 2026-06-22 15:07:53 +02:00
SchemaReferenceForeignPools.swift
SchemaReferenceResolution.swift fix(schema): an unprefixed type ref to a target-namespace type is undeclared 2026-06-21 23:17:14 +02:00
SchemaReferences.swift feat(schema): locate reference-resolution schema diagnostics 2026-06-21 18:09:20 +02:00
SchemaSimpleTypeFinal.swift feat(schema): locate simple-type-pass schema diagnostics 2026-06-21 15:55:59 +02:00
SchemaSimpleTypeValidity.swift feat(schema): locate simple-type-pass schema diagnostics 2026-06-21 15:55:59 +02:00
SchemaSimpleTypeVariety.swift perf(schema): resolve a simple-type restriction chain in linear, not cubic, time (#373) 2026-06-29 02:55:02 +02:00
SchemaStructure.swift refactor(schema): remove unused [String] consistency wrappers (#317) 2026-06-26 08:02:09 +02:00
SchemaStructureHelpers.swift feat(schema): locate structure-pass schema diagnostics 2026-06-21 15:23:13 +02:00
SchemaSubstitutionType.swift feat(schema): locate extension/substitution-pass schema diagnostics 2026-06-21 18:35:38 +02:00
SchemaUndeclaredNamespace.swift feat(schema): locate reference-resolution schema diagnostics 2026-06-21 18:09:20 +02:00
SchemaWildcardExpressibility.swift fix(schema): attribute-wildcard union/intersection per Errata E1-10 (#251) 2026-06-23 04:56:17 +02:00
SchemaWildcardNamespace.swift
SchemaXSIAttribute.swift feat(schema): locate attribute-pass schema diagnostics 2026-06-21 16:28:10 +02:00
SimpleContentMemo.swift perf(schema): memoize simpleContent base resolution so a chain is linear, not cubic (#374) 2026-06-29 03:26:07 +02:00
SimpleType.swift perf(schema): make xsd identity-constraint validation linear (#312) 2026-06-26 02:45:17 +02:00
StepSiblingIndex.swift perf(schema): make xsd identity-constraint validation linear (#312) 2026-06-26 02:45:17 +02:00
StreamingXSDValidator.swift fix(schema): streaming validator applies default/fixed value constraints 2026-06-20 17:38:45 +02:00
TypeDerivation.swift
XPathQueryCache.swift
XSDAttributeParser.swift fix(schema): bound attribute-group reference depth so a deep chain cannot overflow the stack (#375) 2026-06-29 03:58:18 +02:00
XSDCompiled.swift fix(schema): reject an identity-constraint field that selects a non-simple node (#381) 2026-06-29 09:08:25 +02:00
XSDCompletions.swift perf(schema): graph-structured-stack content matcher, killing the last 2^K content-model hang (#364) 2026-06-28 05:07:37 +02:00
XSDComplexContent.swift perf(schema): bound content-model expansion depth so deep chains cannot overflow the stack (#372) 2026-06-29 01:54:21 +02:00
XSDContext.swift fix(schema): reject an identity-constraint field that selects a non-simple node (#381) 2026-06-29 09:08:25 +02:00
XSDDerivation.swift fix(schema): block an xsi:type that reaches a union declared type through a member (#277) 2026-06-24 21:12:35 +02:00
XSDDerivationTables.swift fix(schema): block an xsi:type that reaches a union declared type through a member (#277) 2026-06-24 21:12:35 +02:00
XSDParser.swift fix(schema): reject an identity-constraint field that selects a non-simple node (#381) 2026-06-29 09:08:25 +02:00
XSDParserHelpers.swift fix(schema): reject an identity-constraint field that selects a non-simple node (#381) 2026-06-29 09:08:25 +02:00
XSDParserParticles.swift perf(schema): bound content-model expansion depth so deep chains cannot overflow the stack (#372) 2026-06-29 01:54:21 +02:00
XSDParserTypeReferences.swift fix(schema): an untyped substitutionGroup member inherits its head's type 2026-06-20 02:47:07 +02:00
XSDParserUnion.swift
XSDSchemaValidations.swift
XSDSimpleContentParser.swift perf(schema): memoize simpleContent base resolution so a chain is linear, not cubic (#374) 2026-06-29 03:26:07 +02:00
XSDSimpleParser.swift fix(schema): reject an unknown \p{...} category or block name (#248) 2026-06-23 02:15:26 +02:00
XSDSimpleParser+Facets.swift
XSDSimpleTypeOrder.swift perf(schema): resolve a simple-type restriction chain in linear, not cubic, time (#373) 2026-06-29 02:55:02 +02:00
XSDSubstitutionMembers.swift
XSDValidations.swift fix(schema): reject an identity-constraint field that selects a non-simple node (#381) 2026-06-29 09:08:25 +02:00
XSDWildcardParser.swift fix(schema): attribute-wildcard union/intersection per Errata E1-10 (#251) 2026-06-23 04:56:17 +02:00