Surface <!ATTLIST> declarations from the parser and validate attributes against them. Reimplemented from the DTD attribute-list spec; no upstream code copied. - DocumentType gains attributeLists (raw ATTLIST bodies per element); the DoctypeScanner captures them and the EventReader plumbs them through. - AttributeListParser parses a body into AttributeDeclaration values (AttributeType: cdata or enumeration; AttributeDefault: required/implied/ fixed/value). - DTDSchema now checks #REQUIRED presence, #FIXED value match (when present), and enumerated-value membership, in addition to content models. - Tokenized types (ID/IDREF/NMTOKEN) parse but are not yet value-enforced. - 5 attribute tests; 75 total.
10 lines
377 B
Swift
10 lines
377 B
Swift
extension PureXML.Validation {
|
|
/// The declared type of a DTD attribute. Tokenized types (ID, IDREF, NMTOKEN,
|
|
/// and so on) are treated as unconstrained character data here, since their
|
|
/// value rules are not yet enforced; only an enumeration constrains the value.
|
|
enum AttributeType: Equatable {
|
|
case cdata
|
|
case enumeration([String])
|
|
}
|
|
}
|