PureXML/Tests
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
..
Fixtures chore: scaffold PureXML pure-Swift XML package 2026-06-07 23:20:20 +02:00
CanonicalTests.swift feat(canonical): Canonical XML (C14N) serialization 2026-06-08 06:13:02 +02:00
CatalogTests.swift feat(catalog): OASIS XML Catalog resolution 2026-06-08 06:03:02 +02:00
DTDAttributeTests.swift feat(validation): add DTD attribute (ATTLIST) validation 2026-06-08 02:07:01 +02:00
DTDIdentifierTests.swift feat(validation): add DTD ID/IDREF/IDREFS validation 2026-06-08 02:13:11 +02:00
DTDTests.swift feat(parser): optional DTD with internal entities and billion-laughs defense 2026-06-08 01:17:09 +02:00
DTDValidationTests.swift feat(validation): add DTD content-model validation 2026-06-08 01:59:00 +02:00
EncodingTests.swift feat(parsing): full encoding support (UTF-32, ISO-8859-1, Windows-1252) 2026-06-08 02:39:25 +02:00
EntityResolverTests.swift feat(dtd): external and parameter entities, secure by default 2026-06-08 03:08:20 +02:00
HTMLDocumentTests.swift feat(html): add HTML5 document tree construction with insertion modes 2026-06-08 09:24:11 +02:00
HTMLTests.swift feat(html): lenient HTML parser and serializer 2026-06-08 07:12:42 +02:00
ModelTests.swift chore: scaffold PureXML pure-Swift XML package 2026-06-07 23:20:20 +02:00
NamespaceTests.swift feat(parser): resolve XML namespaces at the start-element boundary 2026-06-08 01:03:29 +02:00
ParityEdgeTests.swift feat(parity): C14N 2.0 text trimming, catalog delegation, XPath number formatting 2026-06-08 09:37:16 +02:00
ParsingTests.swift feat(parser): add bounded-by-default limits (depth, name, content) 2026-06-08 00:40:34 +02:00
PatternTests.swift feat(pattern): streaming xmlPattern matching 2026-06-08 05:49:13 +02:00
PushParserTests.swift feat(parsing): resumable push / feed streaming API 2026-06-08 07:21:22 +02:00
RegexTests.swift feat(regex): XML Schema regular-expression engine 2026-06-08 06:18:50 +02:00
RelaxNGCompactTests.swift feat(relaxng): add compact syntax (RNC) and include/externalRef 2026-06-08 09:13:09 +02:00
RelaxNGTests.swift feat(schema): RELAX NG pattern model, parser, and derivative validation 2026-06-08 06:49:37 +02:00
SaveOptionsTests.swift feat(emit): XML declaration save-option parity 2026-06-08 02:57:27 +02:00
SAXTests.swift feat(parsing): add SAX2 push-callback API 2026-06-08 02:26:04 +02:00
SchemaConformanceTests.swift test(schema): schema conformance fixtures, completing XSD and RELAX NG 2026-06-08 06:52:43 +02:00
SchematronTests.swift feat(validation): Schematron rule validation 2026-06-08 05:58:55 +02:00
SerializerTests.swift refactor(emitter): make the serializer iterative and fix mixed content 2026-06-08 00:31:05 +02:00
TextReaderTests.swift feat(parse): xmlTextReader pull cursor 2026-06-08 03:18:00 +02:00
TreeNodeTests.swift feat(model): mutable parent-aware tree (libxml2 tree.h parity) 2026-06-08 03:13:59 +02:00
ValidationFrameworkTests.swift feat(validation): composable validation framework + structural rule 2026-06-08 12:00:34 +02:00
ValidationTests.swift feat(validation): composable validation framework + structural rule 2026-06-08 12:00:34 +02:00
WriterTests.swift feat(emitting): add an incremental XML writer (xmlTextWriter) 2026-06-08 02:32:39 +02:00
XIncludeTests.swift feat(xinclude): XInclude, URI resolution, and xml:base 2026-06-08 06:08:31 +02:00
XMLCharacterTests.swift feat(parsing): spec-exact XML character classification (chvalid parity) 2026-06-08 02:52:42 +02:00
XPathAxisTests.swift feat(xpath): all thirteen axes via parent-aware navigation 2026-06-08 05:15:14 +02:00
XPathContextTests.swift feat(xpath): explicit evaluation context entry point 2026-06-08 05:40:52 +02:00
XPathExpressionTests.swift feat(xpath): expression engine and the four-type model 2026-06-08 05:33:13 +02:00
XPathFunctionTests.swift feat(xpath): full XPath 1.0 function library 2026-06-08 05:38:39 +02:00
XPathTests.swift feat(xpath): all thirteen axes via parent-aware navigation 2026-06-08 05:15:14 +02:00
XPointerTests.swift feat(xpointer): element() and xpointer() schemes 2026-06-08 05:52:23 +02:00
XSDComplexTypeTests.swift feat(schema): XSD complex types and particles 2026-06-08 06:33:51 +02:00
XSDCompositionTests.swift feat(xsd): add list/union simple types, attribute groups, and element/group refs 2026-06-08 08:28:17 +02:00
XSDDatatypeTests.swift feat(schema): XSD simple-type datatype library with facets 2026-06-08 06:29:37 +02:00
XSDIdentityTests.swift feat(xsd): add identity constraints (unique, key, keyref) 2026-06-08 08:58:36 +02:00
XSDImportTests.swift feat(xsd): add include/import/redefine, substitution groups, and xsi:type 2026-06-08 08:46:24 +02:00
XSDSchemaTests.swift feat(schema): XSD schema-document parser and end-to-end validation 2026-06-08 06:40:03 +02:00
XSLTParityTests.swift feat(xslt): add xsl:include/import, xsl:output, comment, and processing-instruction 2026-06-08 08:08:38 +02:00
XSLTParserTests.swift feat(xslt): stylesheet model and parser 2026-06-08 06:57:11 +02:00
XSLTTests.swift feat(xslt): add xsl:include/import, xsl:output, comment, and processing-instruction 2026-06-08 08:08:38 +02:00