Skip to main content

validate

Function validate 

Source
pub fn validate(doc: &Document, dtd: &Dtd) -> Result<(), Vec<DtdError>>
Expand description

Validate doc against dtd. Returns Ok(()) if every declaration was satisfied; otherwise an Err carrying every error found in document order.

libxml2’s xmlValidateDocument historically returned only a single boolean, but its structured-error callback fires for each violation. We surface the full list directly so consumers can dump them via lxml’s dtd.error_log without depending on callback installation.

An empty DTD (dtd.is_empty()) trivially passes.