Skip to main content

parse_and_validate

Function parse_and_validate 

Source
pub fn parse_and_validate(xml: &[u8]) -> Result<Document, RedispatchXmlError>
Expand description

Parse a Redispatch 2.0 XML document and run structural + semantic validation in one step.

Equivalent to calling parse followed by crate::validate, but more ergonomic when you always want validation.

ยงErrors

Returns the first RedispatchXmlError encountered during parsing. If parsing succeeds but validation finds errors, returns the first RedispatchXmlError::StructuralError.