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.
17 lines
662 B
Swift
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
|
|
}
|
|
}
|
|
}
|