Releases: KWARC/rust-libxml
Releases · KWARC/rust-libxml
Improved error reporting for schema validation
[minor] Add Context::findvalue, Node::findvalue
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_options
allowing to customize document serializationDocument::SaveOptions
containing the currently supported serialization options, as provided internally by libxmlSchema
holding and managingxmlSchemaPtr
as created while parsing bySchemaParserContext
SchemaParserContext
holding source of XSD and parsing into aSchema
while gathering and –in case returning– errors that arise from the XSD parser across the FFI to libxmlSchemaValidationContext
holding theSchema
from resultingSchemaParserContext
parse and offering validation methods forDocument
,Node
or 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::Display
and 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()})`
BOM-aware XML support
Thanks to @Alexhuszagh for the upgrades in this release, see #33 for details.
Added
- BOM-aware Unicode support
- New
Parser
methods allowing to specify an explicit encoding:parse_file_with_encoding
,parse_string_with_encoding
,is_well_formed_html_with_encoding
Changed
- Default encodings in
Parser
are now left for libxml to guess internally, rather than defaulted toutf-8
.
RoNode: read-only parallelization with minimal overhead
Introducing a rayon
-compatible primtive, RoNode
, which allows for parallel read-only document scans. See #53 for details
Example use:
fn dfs_parallel_count(node: RoNode) -> i32 {
1 + node
.get_child_nodes()
.into_par_iter()
.map(dfs_parallel)
.sum::<i32>()
}
MacOS build fix
Minor release for better cross-platform crate builds. See #48 for details
Minor, added Node::null
Added
Node::null
placeholder that avoids the tricky memory management ofNode::mock
that can lead to memory leaks. Really a poor substitute for the betterOption<Node>
type with aNone
value, which is recommended instead.
Multi-document workflow patches
Now using weaker references for an object's owner Document
. See #42 for details
Minor release, Node::findnodes
Improve XPath API, with minor internal refactor. See #41 for details.
Expose libxml2 pointer getters to public API
- Expose the underlying libxml2 data structures in the public crate interface, to enable a first libxslt crate proof of concept.