PureXML/Sources/Schema
Mihaela Mihaljevic 9a1bb652a7 fix(schema): content-free restriction of emptiable base, substitution-group declaration order
Two more Particle Valid (Restriction) over-rejections.

A derived particle that can never contribute a child (its own maxOccurs="0", or
a group whose every member is content-free) accepts only the empty sequence, so
it validly restricts any emptiable base. Checked before the structural cases,
which previously recursed into the members of a maxOccurs="0" group and rejected
it for their own occurrences (particlesW006).

Substitution-group expansion now lists members in declaration order: the closure
walk used a popLast() stack that reversed them, so a reference to a head expanded
to choice(head, m2, m1) and an order-preserving RecurseLax restriction by
choice(m1, m2) could not map (elemZ027a). The choice/choice restriction stays
order-preserving, as the W3C suite requires (choice(b|a) is not a valid
restriction of choice(a|b), particlesT002); only the expansion order is fixed.
The expansion is shared with instance validation and the determinism check, both
order-neutral.

XSTS: valid schemas rejected 4 to 2, no other bucket raised. The pinned XSTS
baselines (never asserted under a plain swift test, the suite being opt-in) are
corrected to the measured 2/520/180/160.
2026-06-14 22:48:12 +02:00
..
BuiltinType.swift feat(schema): built-in xsi:type resolution gated by substitution validity 2026-06-13 21:21:35 +02:00
ComplexType.swift feat(schema): full NameAndTypeOK type derivation in element restriction 2026-06-14 13:47:18 +02:00
ComplexValidator.swift feat(schema): full NameAndTypeOK type derivation in element restriction 2026-06-14 13:47:18 +02:00
ComplexValidatorDerivation.swift fix(schema): enforce element-level block against xsi:type substitution 2026-06-13 18:04:25 +02:00
ComplexValidatorHelpers.swift feat(schema): full NameAndTypeOK type derivation in element restriction 2026-06-14 13:47:18 +02:00
ComplexValidatorIDs.swift fix(schema): enforce document-scoped xs:ID uniqueness and xs:IDREF resolution 2026-06-13 19:17:34 +02:00
ComplexValidatorStreaming.swift fix(xsd): error on unknown xsi:type; cycle-detect type references 2026-06-10 03:10:00 +02:00
ComplexValidatorXSIType.swift feat(schema): built-in xsi:type resolution gated by substitution validity 2026-06-13 21:21:35 +02:00
ContentMatcher.swift feat(schema): full NameAndTypeOK type derivation in element restriction 2026-06-14 13:47:18 +02:00
ContentModelDeterminism.swift feat(schema): enforce Unique Particle Attribution (cos-nonambig) 2026-06-14 09:35:33 +02:00
DateTimeParser.swift feat(schema): validate value-bound facet definitions; accept gMonth --MM-- 2026-06-13 22:10:57 +02:00
DateTimeValue.swift
DecimalValue.swift
DerivationMethod.swift
DurationValue.swift style(schema): drop vestigial day clamp in DurationValue.instant 2026-06-13 18:04:25 +02:00
IdentityConstraint.swift
IdentityValidator.swift feat(schema): built-in xsi:type resolution gated by substitution validity 2026-06-13 21:21:35 +02:00
IDTracker.swift fix(schema): enforce document-scoped xs:ID uniqueness and xs:IDREF resolution 2026-06-13 19:17:34 +02:00
Lexical.swift
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): content-free restriction of emptiable base, substitution-group declaration order 2026-06-14 22:48:12 +02:00
Primitive.swift
RelaxNGCompactHelpers.swift feat(relaxng): fold RNC ~ string concatenation 2026-06-08 17:38:58 +02:00
RelaxNGCompactLexer.swift
RelaxNGCompactParser.swift feat(relaxng): skip RNC >> follow-annotations, completing #79 2026-06-09 03:20:47 +02:00
RelaxNGContentType.swift feat(relaxng): schema-correctness validation, spec suite complete 2026-06-10 11:38:45 +02:00
RelaxNGDerivative.swift feat(relaxng): QName values with dual-context resolution, instance level clean 2026-06-10 10:57:14 +02:00
RelaxNGDiagnostics.swift feat(relaxng): distinguish undeclared attribute from invalid value 2026-06-09 01:11:54 +02:00
RelaxNGFacets.swift
RelaxNGGrammarCheck.swift feat(relaxng): schema-correctness validation, spec suite complete 2026-06-10 11:38:45 +02:00
RelaxNGGrammarCheckSections.swift feat(relaxng): schema-correctness validation, spec suite complete 2026-06-10 11:38:45 +02:00
RelaxNGNameClasses.swift feat(relaxng): ns inheritance, QNames, include-start, combine, data-except 2026-06-10 10:24:46 +02:00
RelaxNGNode.swift feat(relaxng): grammar scoping, parentRef, include overrides, div flattening 2026-06-10 10:34:44 +02:00
RelaxNGParser.swift feat(relaxng): schema-correctness validation, spec suite complete 2026-06-10 11:38:45 +02:00
RelaxNGParserIncludes.swift feat(relaxng): schema-correctness validation, spec suite complete 2026-06-10 11:38:45 +02:00
RelaxNGPattern.swift feat(relaxng): QName values with dual-context resolution, instance level clean 2026-06-10 10:57:14 +02:00
RelaxNGRestrictionChecker.swift feat(relaxng): schema-correctness validation, spec suite complete 2026-06-10 11:38:45 +02:00
RelaxNGRestrictionOverlap.swift feat(relaxng): schema-correctness validation, spec suite complete 2026-06-10 11:38:45 +02:00
RelaxNGRestrictionPaths.swift feat(relaxng): schema-correctness validation, spec suite complete 2026-06-10 11:38:45 +02:00
RelaxNGRestrictions.swift feat(relaxng): schema-correctness validation, spec suite complete 2026-06-10 11:38:45 +02:00
RelaxNGSchema.swift feat(validation): streaming RELAX NG validation 2026-06-09 10:35:42 +02:00
SchemaContentOrder.swift feat(schema): a simpleType must have exactly one of restriction/list/union 2026-06-14 14:30:25 +02:00
SchemaDerivationControl.swift feat(schema): validate final/block derivation-control value space 2026-06-14 14:19:10 +02:00
SchemaDocument.swift feat(schema): validate constraining-facet definitions at compile time 2026-06-13 21:50:51 +02:00
SchemaFacetApplicability.swift feat(schema): validate built-in-typed default/fixed values 2026-06-14 11:55:55 +02:00
SchemaIDAttribute.swift feat(schema): validate the id attribute (xs:ID) at compile time 2026-06-13 22:29:29 +02:00
SchemaIdentityXPath.swift feat(schema): validate identity-constraint selector/field XPath subset 2026-06-14 10:30:06 +02:00
SchemaNameUniqueness.swift feat(schema): resolve keyref refer to a declared key or unique 2026-06-14 08:04:34 +02:00
SchemaReferences.swift feat(schema): resolve keyref refer to a declared key or unique 2026-06-14 08:04:34 +02:00
SchemaStructure.swift feat(schema): a simpleType must have exactly one of restriction/list/union 2026-06-14 14:30:25 +02:00
SchemaWildcardNamespace.swift feat(schema): validate wildcard namespace constraint value space 2026-06-14 11:00:45 +02:00
SimpleType.swift feat(schema): built-in xsi:type resolution gated by substitution validity 2026-06-13 21:21:35 +02:00
StreamingXSDValidator.swift fix(xsd): error on unknown xsi:type; cycle-detect type references 2026-06-10 03:10:00 +02:00
TypeDerivation.swift
XSDAttributeParser.swift fix(schema): resolve <xs:attribute ref> to global attribute declarations 2026-06-13 19:30:11 +02:00
XSDCompletions.swift feat(schema): full NameAndTypeOK type derivation in element restriction 2026-06-14 13:47:18 +02:00
XSDComplexContent.swift
XSDContext.swift fix(schema): content-free restriction of emptiable base, substitution-group declaration order 2026-06-14 22:48:12 +02:00
XSDDerivation.swift feat(schema): full NameAndTypeOK type derivation in element restriction 2026-06-14 13:47:18 +02:00
XSDParser.swift fix(schema): resolve element-ref namespaces by prefix binding, not target namespace 2026-06-14 17:50:26 +02:00
XSDSchemaValidations.swift feat(schema): full NameAndTypeOK type derivation in element restriction 2026-06-14 13:47:18 +02:00
XSDSimpleParser.swift feat(schema): validate pattern facet regular expressions at compile time 2026-06-13 23:52:11 +02:00
XSDValidations.swift fix(schema): enforce document-scoped xs:ID uniqueness and xs:IDREF resolution 2026-06-13 19:17:34 +02:00
XSDWildcardParser.swift