PureXML/Sources/Schema
Mihaela Mihaljevic 31a4ebacfb fix(schema): extend the xsi:type not-derived check to atomic substitutes; invalid-instances-accepted 66 to 60 (#181, #147)
cvc-elt.4.3.2.1 requires an xsi:type to name a type derived from the element's
declared type. The not-derived check covered only complex substitutes, so an
xsi:type naming an atomic type unrelated to the declared atomic type, such as a
sibling restriction or the declared type's own ancestor, was accepted.

notDerivedSubstitutionError now admits atomic simple substitutes too (via
isAtomicOrComplex, which excludes list/union, handled separately). It still fires
only when both the substitute and the declared type are recorded in the
namespaced derivation backbone and derivationMethods finds no path between them.
Built-in types and the ur-types are absent from the backbone, so a built-in
substitute or declared type leaves the check silent: a valid built-in derivation
such as xsi:type="xs:int" on an xs:decimal element is never flagged, which was
the source of an earlier false-positive regression. A genuine user restriction
chain stays inside the backbone the whole way down, so a validly derived
substitute is accepted.

invalid-instances-accepted 66 to 60, no false positive (valid-instances-rejected
and valid-schemas-rejected held at 0), no other bucket moved. An adversarial
review probed built-in derivation in both directions, deep and cross-namespace
restriction chains, and sibling/ancestor substitutes, and found no over-rejection.
2026-06-18 13:37:49 +02:00
..
BuiltinType.swift
ComplexType.swift
ComplexValidator.swift
ComplexValidatorAttributes.swift
ComplexValidatorContentModel.swift
ComplexValidatorDerivation.swift fix(schema): extend the xsi:type not-derived check to atomic substitutes; invalid-instances-accepted 66 to 60 (#181, #147) 2026-06-18 13:37:49 +02:00
ComplexValidatorHelpers.swift
ComplexValidatorIDs.swift
ComplexValidatorStreaming.swift
ComplexValidatorXSIType.swift
ContentMatcher.swift
ContentModelDeterminism.swift
DateTimeParser.swift
DateTimeValue.swift
DecimalValue.swift
DerivationMethod.swift
DurationValue.swift
IdentityConstraint.swift
IdentityValidator.swift
IDTracker.swift
Lexical.swift
ParticleNormalization.swift
ParticleRestriction.swift
ParticleRestrictionElement.swift
ParticleRestrictionHelpers.swift
Primitive.swift
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
SchemaAttributeApplicability.swift
SchemaAttributeRestriction.swift
SchemaAttributeUniqueness.swift
SchemaCompileValidation.swift
SchemaCompositionValidations.swift
SchemaContentOrder.swift
SchemaDerivationControl.swift
SchemaDocument.swift
SchemaExtensionAllGroup.swift
SchemaFacetApplicability.swift
SchemaIDAttribute.swift
SchemaIdentityXPath.swift
SchemaIDValueConstraint.swift
SchemaImportNamespace.swift
SchemaNameUniqueness.swift
SchemaNestedDefinition.swift
SchemaNotationValidity.swift
SchemaRedefineSelfReference.swift
SchemaReferenceForeignPools.swift
SchemaReferenceResolution.swift
SchemaReferences.swift
SchemaSimpleTypeFinal.swift
SchemaSimpleTypeValidity.swift
SchemaStructure.swift
SchemaStructureHelpers.swift
SchemaSubstitutionType.swift
SchemaWildcardNamespace.swift
SimpleType.swift
StreamingXSDValidator.swift
TypeDerivation.swift
XSDAttributeParser.swift
XSDCompletions.swift
XSDComplexContent.swift
XSDContext.swift
XSDDerivation.swift
XSDDerivationTables.swift
XSDParser.swift
XSDParserHelpers.swift
XSDParserParticles.swift
XSDParserTypeReferences.swift
XSDParserUnion.swift
XSDSchemaValidations.swift
XSDSimpleParser.swift
XSDSimpleParser+Facets.swift
XSDSubstitutionMembers.swift
XSDValidations.swift
XSDWildcardParser.swift