PureXML/Sources/Schema
Mihaela Mihaljevic 94e16b1d7d
fix(schema): block an xsi:type that reaches a union declared type through a member (#277)
cvc-elt.4.3 defers to cos-st-derived-OK, whose clause 2.2.4 makes a type
validly derived from a union when it is validly derived from one of the
union's member types. The block check followed only the named base chain,
so when the declared type was a union and the substitute reached it through
a member by a blocked derivation method, the check found no path and stayed
silent, wrongly accepting the substitution (W3C XSTS elemT074: block on the
element is restriction and the xsi:type restricts a union member).

Record a union's direct member types during schema compilation and follow a
derivation through a member when the base chain does not reach the union.
The member clause is existential: bar the substitution only when every
confirmed derivation path to a member is blocked, so a substitute that is
itself a member (its self-membership path uses no method) or reaches one
member by an unblocked method is accepted whatever other members it reaches
by a blocked method. The check adds a rejection only on a positively
confirmed path, so an unresolved, inline-anonymous, or nested-union member
leaves it silent: a bounded, disclosed under-rejection, never a false
positive.

Drops XSTS invalid-instances-accepted 15 to 14 with valid-schemas-rejected
and valid-instances-rejected held at 0 over the full archive. An adversarial
over-rejection review caught a first cut that order-shadowed the
self-membership path; the existential form rules it out and the case is a
regression test.
2026-06-24 21:12:35 +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): attribute-wildcard union/intersection per Errata E1-10 (#251) 2026-06-23 04:56:17 +02:00
ComplexValidator.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
ComplexValidatorAttributes.swift fix(schema): resolve defaulted/fixed IDREF attributes against IDs 2026-06-22 18:56:36 +02:00
ComplexValidatorContentModel.swift fix(schema): optional xs:all group requires its members when present 2026-06-22 18:29:09 +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): streaming validator applies default/fixed value constraints 2026-06-20 17:38:45 +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 fix(schema): advance XSTS valid-instances-rejected to 4 (#146) 2026-06-16 22:22:05 +02:00
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 fix(schema): reject a redefine whose self-reference duplicates a particle (UPA) (#253) 2026-06-24 00:06:23 +02:00
ContentModelEffectiveModel.swift fix(schema): check UPA over an extension's effective content model 2026-06-21 22:12:32 +02:00
ContentNFABuilder.swift fix(schema): count content-model occurrences 2026-06-19 23:32:04 +02:00
DateTimeParser.swift fix(schema): reject year 0000 in dateTime, date, gYearMonth, gYear 2026-06-20 01:31:14 +02:00
DateTimeValue.swift
DecimalValue.swift
DerivationMethod.swift
DurationValue.swift
GroupParticleMemo.swift perf(schema): memoize group expansion in the compiled content model 2026-06-22 23:24:19 +02:00
IdentityConstraint.swift fix(schema): resolve identity-constraint XPath prefixes against the schema (#147) 2026-06-17 00:03:13 +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 fix(schema): default/fixed value for identity-constraint fields; invalid-instances-accepted 50 to 45 (#147) 2026-06-18 14:47:47 +02:00
IdentityValidator.swift fix(schema): reject identity field whose declared target is a non-simple complex type 2026-06-22 13:10:30 +02:00
IdentityValidatorDefaults.swift fix(schema): default/fixed value for identity-constraint fields; invalid-instances-accepted 50 to 45 (#147) 2026-06-18 14:47:47 +02:00
IDTracker.swift
Lexical.swift
OccurrenceRange.swift fix(schema): count content-model occurrences 2026-06-19 23:32:04 +02:00
ParticleNormalization.swift fix(schema): normalize content model, scope occurrence subsumption in particle restriction 2026-06-14 17:18:38 +02:00
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): restriction may not narrow an element to an extension-derived type 2026-06-20 18:34:50 +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 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 feat(schema): locate attribute-pass schema diagnostics 2026-06-21 16:28:10 +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 fix(schema): reject a redefine whose self-reference duplicates a particle (UPA) (#253) 2026-06-24 00:06:23 +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 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 fix(schema): block an xsi:type that reaches a union declared type through a member (#277) 2026-06-24 21:12:35 +02:00
SchemaDocumentHints.swift fix(schema): default/fixed value for identity-constraint fields; invalid-instances-accepted 50 to 45 (#147) 2026-06-18 14:47:47 +02:00
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 feat(schema): locate structure-pass schema diagnostics 2026-06-21 15:23:13 +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 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 feat(schema): locate names/UPA/notation-pass schema diagnostics 2026-06-21 19:16:54 +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 feat(validation,schema): composable validation framework and cross-document composition 2026-06-16 09:57:43 +02:00
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
SchemaStructure.swift refactor(schema): split Element-Declarations-Consistent out of SchemaStructure 2026-06-22 15:30:58 +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 feat(schema): validate wildcard namespace constraint value space 2026-06-14 11:00:45 +02:00
SchemaXSIAttribute.swift feat(schema): locate attribute-pass schema diagnostics 2026-06-21 16:28:10 +02:00
SimpleType.swift fix(schema): advance XSTS valid-instances-rejected to 4 (#146) 2026-06-16 22:22:05 +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 fix(schema): default/fixed value for identity-constraint fields; invalid-instances-accepted 50 to 45 (#147) 2026-06-18 14:47:47 +02:00
XSDAttributeParser.swift fix(schema): exclude use="prohibited" attributes from effective uses at instance time; invalid-instances-accepted 43 to 39 (#147) 2026-06-18 15:28:35 +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): attribute-wildcard union/intersection per Errata E1-10 (#251) 2026-06-23 04:56:17 +02:00
XSDContext.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
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): block an xsi:type that reaches a union declared type through a member (#277) 2026-06-24 21:12:35 +02:00
XSDParserHelpers.swift fix(schema): default/fixed value for identity-constraint fields; invalid-instances-accepted 50 to 45 (#147) 2026-06-18 14:47:47 +02:00
XSDParserParticles.swift perf(schema): memoize group expansion in the compiled content model 2026-06-22 23:24:19 +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 docs: align stale figures with code and the enforced XSTS gate 2026-06-19 23:32:04 +02:00
XSDSchemaValidations.swift feat(validation,schema): composable validation framework and cross-document composition 2026-06-16 09:57:43 +02:00
XSDSimpleContentParser.swift Reject invalid simpleContent inline restrictions 2026-06-18 22:01:01 +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 fix(schema): advance XSTS valid-instances-rejected to 4 (#146) 2026-06-16 22:22:05 +02:00
XSDSubstitutionMembers.swift fix(schema): stop blocked substitution chaining 2026-06-19 08:37:19 +02:00
XSDValidations.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
XSDWildcardParser.swift fix(schema): attribute-wildcard union/intersection per Errata E1-10 (#251) 2026-06-23 04:56:17 +02:00