A default/fixed value on an element or attribute whose type names a user-declared type in the schema's own target namespace must be a valid value of that type (XSD 1.0 e-props-correct.2 / a-props-correct.2). The check runs after the named types are compiled and validates with the compiled SimpleType validator (the one instance validation uses), so whitespace and facet handling match. Built-ins are handled at structure time; imported, foreign, and inline anonymous types are left alone via a namespace gate. This exposed a pre-existing compile defect: a simpleType restriction read its base only from the base attribute, so an inline anonymous <simpleType> base (a list or union with no base attribute) was dropped and the type collapsed to an atomic string, making a length facet count characters instead of list items. The restriction branch now resolves the inline child as its base, preserving list and union variety. This corrects both schema-time value checking and instance validation. XSTS: invalid schemas accepted 462 to 454; invalid instances accepted 160 to 158; no other bucket raised. |
||
|---|---|---|
| .. | ||
| Canonical | ||
| Catalog | ||
| Emitting | ||
| HTML | ||
| Model | ||
| Parsing | ||
| Pattern | ||
| Regex | ||
| Schema | ||
| Stream | ||
| Validation | ||
| XInclude | ||
| XPath | ||
| XPointer | ||
| XSLT | ||
| API.swift | ||
| Lint.swift | ||
| PureXML.swift | ||
| QuickFix.swift | ||