Releases: KWARC/rust-libxml
adjust vcpkg build's directory includes
improved bindgen config for c14n
c14n and more bindgen headers
[0.3.6] (2025-13-07)
Added
- c14n, thanks to @saks and @tstenner
- add
canonicalizemethod forNodeandDocument - see
tests/c14n.rsfor examples
- add
- Utility node methods, thanks to @saks (nokogiri inspired)
- add
Node::ancestorsmethod - add
Node::at_xpathmethod. Similar tofindnodesbut nokogiri inspired.
- add
This work still hasn't been extended to RoNode, contributions welcome.
Changes
- Added more low-level headers from bindgen for wrapper uses interested in unsafe low-level libxml2 calls.
The bindgen coverage has been in flux since the v0.3.4 release, as we stabilize the new build approach.
Stabilize bindgen-at-build on more platforms
[0.3.5] (2025-28-04)
This release stabilizes the new "bindgen during build" approach of v0.3.4 to more platforms.
Support for newer libxml2 versions has been improved.
- CI support for v2.12.9, v2.13.8, v2.14.1
Thanks go to @wetneb, @charmitro and @TreyE for contributing.
Added
- cargo build: expose libxml2 version to main build script;
- creating a new
Parsernow initializes viabindings::xmlInitParser, called at most once.
Changes
- cargo build: mark
max_align_tas opaque to fix i386 build failure - cfg: adapt mutability of error pointer depending on libxml version
- change the return type of
xmlGetNodeTypefromu32to the more portablebindings::xmlElementType - change the argument type of
NodeType::from_intfromu32to the more portablebindings::xmlElementType - protect
Schemainitialization to be closer to thread-safe (note that this wrapper is NOT thread-safe in general)
Removed
- The use of
SchemaParserContextandSchemaValidationContextis currently NOT thread safe.
Hence, Theschema_testhas been weakened to run in a single thread (future improvements welcome).
Improved installation and no_ns methods
Thanks go to @wetneb, @anwaralameddin, @rudolphfroger, @jcamiel, @imcsk8 for contributions to this release.
Added
- Node methods:
get_property_no_ns(alias:get_attribute_no_ns),get_properties_ns(alias:get_attributes_ns),has_property_no_ns(alias:has_attribute_no_ns),remove_property_no_ns(alias:remove_attribute_no_ns),get_property_node_ns(alias:get_attribute_node_ns),get_property_node_no_ns(alias:get_attribute_node_no_ns) - Added implementations of
Hash,PartialEqandEqtraits forNamespace
Changed
- Call bindgen at build time on Unix platforms (thanks @wetneb)
Improved error reporting for schema validation
This release contains the improvements from PR #116 , as well as some minor hygiene maintenance.
[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_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()})`
BOM-aware XML support
Thanks to @Alexhuszagh for the upgrades in this release, see #33 for details.
Added
- BOM-aware Unicode support
- New
Parsermethods allowing to specify an explicit encoding:parse_file_with_encoding,parse_string_with_encoding,is_well_formed_html_with_encoding
Changed
- Default encodings in
Parserare 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>()
}