Schema support and document serialization
[0.2.13] 2020-16-01
Thanks to @jangernert for the upgrades to Document serialization.
Thanks to @lweberk for contributing the Schema featureset and to @cbarber for refining the FFI interop.
Added
Document::to_string_with_optionsallowing to customize document serializationDocument::SaveOptionscontaining the currently supported serialization options, as provided internally by libxmlSchemaholding and managingxmlSchemaPtras created while parsing bySchemaParserContextSchemaParserContextholding source of XSD and parsing into aSchemawhile gathering and –in case returning– errors that arise from the XSD parser across the FFI to libxmlSchemaValidationContextholding theSchemafrom resultingSchemaParserContextparse and offering validation methods forDocument,Nodeor file path to XML, while gathering and –in case returning– validation errors from the XML validator across the FFI to libxml
Changed
- the
Document::to_string()serialization method is now implemented throughfmt::Displayand no longer takes an optional boolean flag. The default behavior is now unformatted serialization - previouslyto_string(false), whileto_string(true)can be realized via
.to_string_with_options(SaveOptions { format: true, ..SaveOptions::default()})`