Skip to content

Releases: KWARC/rust-libxml

adjust vcpkg build's directory includes

25 Sep 20:16

Choose a tag to compare

improved bindgen config for c14n

18 Aug 16:24

Choose a tag to compare

This release contains configuration patches for bindgen, particularly for the c14n feature.

See PR #182

c14n and more bindgen headers

13 Jul 21:40

Choose a tag to compare

[0.3.6] (2025-13-07)

Added

  • c14n, thanks to @saks and @tstenner
    • add canonicalize method for Node and Document
    • see tests/c14n.rs for examples
  • Utility node methods, thanks to @saks (nokogiri inspired)
    • add Node::ancestors method
    • add Node::at_xpath method. Similar to findnodes but nokogiri inspired.

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

28 Apr 22:25

Choose a tag to compare

[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 Parser now initializes via bindings::xmlInitParser, called at most once.

Changes

  • cargo build: mark max_align_t as opaque to fix i386 build failure
  • cfg: adapt mutability of error pointer depending on libxml version
  • change the return type of xmlGetNodeType from u32 to the more portable bindings::xmlElementType
  • change the argument type of NodeType::from_int from u32 to the more portable bindings::xmlElementType
  • protect Schema initialization to be closer to thread-safe (note that this wrapper is NOT thread-safe in general)

Removed

  • The use of SchemaParserContext and SchemaValidationContext is currently NOT thread safe.
    Hence, The schema_test has been weakened to run in a single thread (future improvements welcome).

Improved installation and no_ns methods

16 Apr 23:41

Choose a tag to compare

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, PartialEq and Eq traits for Namespace

Changed

  • Call bindgen at build time on Unix platforms (thanks @wetneb)

Improved error reporting for schema validation

18 Jul 14:27

Choose a tag to compare

This release contains the improvements from PR #116 , as well as some minor hygiene maintenance.

[minor] Add Context::findvalue, Node::findvalue

07 Mar 21:43

Choose a tag to compare

See #108 for details.

Also, the release pages here haven't been maintained that carefully, consult the CHANGELOG for details.

Schema support and document serialization

16 Jan 15:18

Choose a tag to compare

[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 serialization
  • Document::SaveOptions containing the currently supported serialization options, as provided internally by libxml
  • Schema holding and managing xmlSchemaPtr as created while parsing by SchemaParserContext
  • SchemaParserContext holding source of XSD and parsing into a Schema while gathering and –in case returning– errors that arise from the XSD parser across the FFI to libxml
  • SchemaValidationContext holding the Schema from resulting SchemaParserContext parse and offering validation methods for Document, 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 through fmt::Display and no longer takes an optional boolean flag. The default behavior is now unformatted serialization - previously to_string(false), while to_string(true) can be realized via
  .to_string_with_options(SaveOptions { format: true, ..SaveOptions::default()})`

See #58 and #64 for implementation details.

BOM-aware XML support

16 Jun 09:42

Choose a tag to compare

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 to utf-8.

RoNode: read-only parallelization with minimal overhead

14 Apr 21:10

Choose a tag to compare

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>()
}