PureXML/Sources/Validation
Mihaela Mihaljevic 1fbe359ada feat(validation): composable validation framework + structural rule
Slice 1 of #92. Introduce the OpenAPIKit-idiom validation framework, replacing
the imperative if-tree structural validator:

- ValidationError (reason + coding path) renders "<reason> at path: root/row/cell";
  ValidationErrorCollection gathers every failure and is thrown once.
- Validation<Subject, Document> is the atomic, composable rule value, with the
  multi-error and single-error Bool inits (the latter auto-forms "Failed to
  satisfy: <description>"). Predicate-gated, type-directed via an erased
  AnyValidation that guards an optional from matching a non-optional rule.
- The framework is parameterized over both Subject and Document so the structural,
  DTD, XSD, and Schematron layers share one machinery (Document = Void for rules
  that need only their subject).
- Validator<Document> walks the node tree, building the coding path, with blank /
  default factories and fluent validating / withoutValidating.
- The combinator algebra (&&, ||, comparison lifts, take, lift, unwrap, all) as
  free functions returning closures.

The structural duplicate-attribute rule is reborn as Validation<Element, Void>.
Combinators and the erased wrapper are unit-tested as pure functions per the rule.

The legacy Validation.Issue stays only for the not-yet-migrated schema validators
and is retired in a later slice.
2026-06-08 12:00:34 +02:00
..
AttributeDeclaration.swift feat(validation): add DTD attribute (ATTLIST) validation 2026-06-08 02:07:01 +02:00
AttributeDefault.swift feat(validation): add DTD attribute (ATTLIST) validation 2026-06-08 02:07:01 +02:00
AttributeListParser.swift feat(validation): add DTD ID/IDREF/IDREFS validation 2026-06-08 02:13:11 +02:00
AttributeType.swift feat(validation): add DTD ID/IDREF/IDREFS validation 2026-06-08 02:13:11 +02:00
ContentModel.swift feat(validation): add DTD content-model validation 2026-06-08 01:59:00 +02:00
ContentModelMatcher.swift feat(validation): add DTD content-model validation 2026-06-08 01:59:00 +02:00
ContentModelParser.swift feat(validation): add DTD content-model validation 2026-06-08 01:59:00 +02:00
DTDSchema.swift feat(validation): add DTD ID/IDREF/IDREFS validation 2026-06-08 02:13:11 +02:00
Issue.swift feat(validation): composable validation framework + structural rule 2026-06-08 12:00:34 +02:00
Occurrence.swift feat(validation): add DTD content-model validation 2026-06-08 01:59:00 +02:00
Particle.swift feat(validation): add DTD content-model validation 2026-06-08 01:59:00 +02:00
Schematron.swift feat(validation): Schematron rule validation 2026-06-08 05:58:55 +02:00
SchematronModel.swift feat(validation): Schematron rule validation 2026-06-08 05:58:55 +02:00
SchematronParser.swift feat(validation): Schematron rule validation 2026-06-08 05:58:55 +02:00
Severity.swift chore: scaffold PureXML pure-Swift XML package 2026-06-07 23:20:20 +02:00
StructuralValidations.swift feat(validation): composable validation framework + structural rule 2026-06-08 12:00:34 +02:00
Validation.swift feat(validation): composable validation framework + structural rule 2026-06-08 12:00:34 +02:00
ValidationCombinators.swift feat(validation): composable validation framework + structural rule 2026-06-08 12:00:34 +02:00
ValidationCore.swift feat(validation): composable validation framework + structural rule 2026-06-08 12:00:34 +02:00
Validator.swift feat(validation): composable validation framework + structural rule 2026-06-08 12:00:34 +02:00