PureXML/Sources/Parsing/ValidityFinding.swift
Mihaela Mihaljevic d0175d5ca0 refactor(validation): located structured validity findings
DocumentType.validityFindings carries ValidityFinding values (reason
plus subject) instead of strings, DTDSchema.declarationErrors holds
ready ValidationErrors, and every declaration-level finding renders at
its declaration's coding path (x, r/@a) instead of at the document
root, matching the XSD consistency-errors precedent. Texts unchanged.
2026-06-10 10:45:17 +02:00

17 lines
662 B
Swift

public extension PureXML.Parsing {
/// One validity (not well-formedness) discovery made while parsing: a
/// reason and, when known, the declared name it is about, which becomes
/// the error's coding path when the validation framework reports it.
struct ValidityFinding: Equatable, Sendable {
public var reason: String
/// The element or declaration name the finding addresses, or nil when
/// it belongs to the document as a whole.
public var subject: String?
public init(_ reason: String, subject: String? = nil) {
self.reason = reason
self.subject = subject
}
}
}