release: 0.3.15#207
Merged
Merged
Conversation
Pin the [Unreleased] section to 0.3.15 (2026-07-06) and bump the crate version 0.3.14 -> 0.3.15. Opens a fresh empty [Unreleased] section. Landed since 0.3.14 (via #205 and #206): Added * reader::TextReader — safe xmlTextReader pull parser for very large documents; expand() (borrowed RoNode) / expand_to_document() (owned, namespace-reconciled Document) materialize one subtree at a time. * xpath checked evaluators (evaluate_checked / node_evaluate_checked / node_evaluate_readonly_checked) surfacing libxml2's structured XPathError, incl. the >10M-nodeset "growing nodeset hit limit". Changed * FxHash-style hasher for the xmlNodePtr->Node cache (~28-30% wall on node/math-heavy docs); dependency-free (std::hash only), output-identical. Fixed * get_properties/_ns read values directly from the attr node (xmlNodeGetContent) instead of a quadratic by-name xmlGetProp re-scan. * Two SIGSEGV hardenings that bypassed catch_unwind: NULL-guard the c_helpers raw-pointer field accessors (segfault at 8) and the CStr::from_ptr surface against strlen(NULL) (segfault at 0). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…us type
`xmlTextReaderNodeType` yields an `xmlReaderTypes` value that coincides with
`xmlElementType` only for 1..=12. The reader-only events collide with unrelated
element types — END_ELEMENT (15) == XML_ELEMENT_DECL, WHITESPACE (13) ==
XML_HTML_DOCUMENT_NODE, SIGNIFICANT_WHITESPACE (14) == XML_DTD_NODE — so passing
them straight through `NodeType::from_int` mislabeled every closing `</x>` as an
`ElementDecl`, contradicting the method's own doc contract ("end-of-element →
None, distinguishing an opening `<x>` from a closing `</x>`"). Only translate the
coinciding range; reader-only events have no `NodeType` equivalent → None.
`is_element()` is unaffected (None and ElementDecl both differ from ElementNode).
Found while adding TextReader error/edge tests (also here): from_file on a
missing path → Err, malformed XML surfaces Err from read (not a silent Ok(false)),
read_to_next with no match reaches EOF → Ok(false), and node_type open-vs-close.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The *_checked evaluators' Ok path was exercised transitively (the thin evaluate/node_evaluate wrappers delegate to them), but the Err/classification path — the whole reason the API exists for very large documents — had no tests. Add: an invalid expression yields a populated XPathError (message + non-zero code) while the thin wrapper still errors; is_nodeset_limit recognizes exactly libxml2's growing-nodeset/OOM messages (constructed directly, since a real >10M node-set is impractical to materialize); and the node-relative checked evaluators (both &Node and RoNode) resolve against the context node and surface errors identically. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Cuts 0.3.15: pins the
[Unreleased]CHANGELOG section to0.3.15 (2026-07-06),opens a fresh empty
[Unreleased], and bumpsCargo.toml0.3.14 → 0.3.15.Everything in the release already merged to
mainvia #205 and #206; this is theversion/CHANGELOG bump only (no code changes). Contents:
Added
reader::TextReader— safexmlTextReaderpull parser for very large documents;expand()(borrowedRoNode) /expand_to_document()(owned, namespace-reconciledDocument) materialize one subtree at a time.xpathchecked evaluators (evaluate_checked/node_evaluate_checked/node_evaluate_readonly_checked) surfacing libxml2's structuredXPathError,incl. the >10M-nodeset "growing nodeset hit limit".
Changed
xmlNodePtr -> Nodecache (~28–30% wall on node/math-heavydocs); dependency-free (
std::hashonly), output-identical.Fixed
get_properties/_nsread values directly from the attr node (xmlNodeGetContent)instead of a quadratic by-name
xmlGetPropre-scan.catch_unwind-bypassing SIGSEGV hardenings: NULL-guard thec_helpersraw-pointer field accessors (
segfault at 8) and theCStr::from_ptrsurface againststrlen(NULL)(segfault at 0).After merge: tag
v0.3.15on the merge commit, thencargo publish.🤖 Generated with Claude Code