PureXML/docs/validation-field-registry.txt
Mihaela Mihaljevic 380160cc2b refactor(validation): decompose XSD instance validation into composable rules
The two monolithic XSD content/identity rules only satisfied the OpenAPIKit
validation idiom at the wrong granularity: no per-constraint removability,
no isolable failing/near-miss tests. Split them into 32 named rules, each
finding tagged at its origin and cached per XSDContext so the walk still
runs once per document (the #101 decision against duplicating XSD's
recursive type resolution still holds). Wired the streaming path's ID/IDREF
and identity checks through the same framework instead of calling the
validators imperatively, and added the unwrapAndLookup combinator the rule
already named as required.

Also includes the mandated repo-wide swiftformat/swiftlint pass.
2026-07-12 14:12:17 +02:00

66 lines
4.0 KiB
Plaintext

# validation-rules.md field coverage registry.
# Each MODEL names a validation document or subject type. FIELD lines map stored
# properties (or Node enum cases) to rule ids or layer rule names. IGNORE lines
# document computed or out-of-scope constructs excluded from the coverage law.
# The meta-test in ValidationFieldCoverageTests must stay in sync with this file.
MODEL PureXML.Validation.DTDSchema
FIELD models dtdContentModel,dtdUndeclaredElement,dtdStandaloneElementWhitespace
FIELD attributes dtdRequiredAttributes,dtdFixedAttributeValues,dtdEnumeratedAttributeValues,dtdTokenizedAttributeTypes,dtdNotationAttributes,dtdUndeclaredAttributes,dtdStandaloneAttributes
FIELD notations dtdNotationAttributes,dtdDeclarationValidity
FIELD unparsedEntities dtdTokenizedAttributeTypes
FIELD doctypeName dtdRootElementType
FIELD declarationErrors dtdDeclarationValidity
FIELD standalone dtdStandaloneAttributes,dtdStandaloneElementWhitespace
FIELD externalElementModels dtdStandaloneElementWhitespace
FIELD externalAttributes dtdStandaloneAttributes
FIELD parseAdvisories dtdParseAdvisories
IGNORE isEmpty derived summary; no independent constraint
MODEL PureXML.Validation.XSDContext
FIELD types xsdTypeReferenceResolves,xsdContentModelStructure,xsdXsiTypeSubstitutionValid,xsdXsiTypeOverrideResolves,xsdStreamingShallowValidity
FIELD constraints xsdIdentityConstraintXPathsValid,xsdIdentityKeyFieldPresent,xsdIdentityValueUnique,xsdIdentityKeyrefResolves,xsdIdentityFieldCardinality,xsdIdentityFieldMustBeSimple
FIELD rootDeclaration xsdContentModelStructure
FIELD nillableElements xsdNilAttributeRequiresNillable
FIELD elementConstraints xsdNilElementNoFixedConstraint,xsdFixedElementNoChildren,xsdFixedElementValueMatches
FIELD abstractTypes xsdXsiTypeSubstitutionValid
FIELD typeBlock xsdXsiTypeSubstitutionValid
FIELD elementBlock xsdXsiTypeSubstitutionValid
FIELD typeDerivation xsdXsiTypeSubstitutionValid
MODEL PureXML.Model.Element
FIELD name dtdContentModel,dtdUndeclaredElement,dtdUndeclaredAttributes,htmlRequiredParent,htmlVoidElementsAreEmpty,xsdContentModelStructure
FIELD attributes uniqueAttributes,dtdRequiredAttributes,dtdFixedAttributeValues,dtdEnumeratedAttributeValues,dtdTokenizedAttributeTypes,dtdNotationAttributes,dtdUndeclaredAttributes,dtdStandaloneAttributes
FIELD children dtdContentModel,htmlVoidElementsAreEmpty,htmlRequiredParent,xsdContentModelStructure
IGNORE text derived from direct text and CDATA children
MODEL PureXML.Model.Attribute
FIELD name uniqueAttributes,dtdUndeclaredAttributes,dtdRequiredAttributes,dtdFixedAttributeValues,dtdEnumeratedAttributeValues,dtdTokenizedAttributeTypes,dtdNotationAttributes
FIELD value dtdFixedAttributeValues,dtdEnumeratedAttributeValues,dtdTokenizedAttributeTypes,dtdNotationAttributes,dtdIdentifierIntegrity
MODEL PureXML.Model.Node
CASE document dtdDeclarationValidity,dtdRootElementType,dtdIdentifierIntegrity,htmlUniqueIdentifiers,xsdContentModelStructure,xsdIdentityConstraintXPathsValid
CASE element uniqueAttributes,dtdContentModel,dtdRequiredAttributes,dtdFixedAttributeValues,dtdEnumeratedAttributeValues,dtdTokenizedAttributeTypes,dtdNotationAttributes,dtdUndeclaredElement,dtdUndeclaredAttributes,dtdStandaloneAttributes,dtdStandaloneElementWhitespace,htmlVoidElementsAreEmpty,htmlRequiredParent,xsdContentModelStructure
CASE text dtdContentModel
CASE cdata dtdContentModel
IGNORE comment no DTD or XSD constraints on comments
IGNORE processingInstruction no DTD or XSD constraints on processing instructions
MODEL PureXML.Validation.ConformanceCase
FIELD name conformanceMatchesExpected
FIELD actual conformanceMatchesExpected
FIELD expected conformanceMatchesExpected
MODEL PureXML.Schema.SchemaTypeFact
FIELD name xsdFinalRespected,xsdRestrictionsAreSubsets
FIELD derivation xsdFinalRespected,xsdRestrictionsAreSubsets
MODEL PureXML.Schema.CompiledSchemaFacts
FIELD types xsdFinalRespected,xsdRestrictionsAreSubsets
FIELD typeDerivation xsdFinalRespected,xsdRestrictionsAreSubsets
FIELD typeFinal xsdFinalRespected
MODEL PureXML.Schema.ResolvedElement
FIELD element xsdStreamingShallowValidity
FIELD type xsdStreamingShallowValidity