Resolve workbook relationship namespace prefixes - #367
Merged
MathNya merged 1 commit intoSep 14, 2026
Merged
Conversation
Owner
|
@colin-kiegel |
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.
Summary
Fixes #366.
Resolve workbook relationship elements by the package-relationships namespace URI and the local name
Relationship, rather than matching the raw XML spelling. This allows arbitrary namespace prefixes such asns0:andpkg:without accepting same-named elements from unrelated namespaces.The production change is confined to
src/reader/xlsx/workbook_rels.rs; it uses the existing quick-xml dependency'sNsReader. Attribute reading, target normalization and pivot-cache handling remain unchanged. No dependencies or public APIs change.Regression coverage
On the unchanged upstream base (
4195480ede258a27eebdd202ede0e4457aff8822, version 3.1.1), the default-namespace integration case passes and both prefixed cases fail with an empty A1 instead of the expected text. All three pass with this patch.Verification
cargo test --locked --offline: passes (340 tests, including 79 doctests; 23 existing ignored tests).cargo clippy --locked --offline -- -D warnings: passes (the upstream CI command).cargo clippy --locked --offline --test workbook_relationship_namespaces -- -D warnings: passes.cargo +nightly-2026-09-11 fmt --all --check: passes.git diff --check: passes.An additional
cargo clippy --locked --offline --all-targets --all-features -- -D warningsrun reports five existing test-code findings: fourfloat_cmpfindings insrc/helper/color.rsand oneuninlined_format_argsfinding insrc/structs/pivot_table_definition.rs. The same five findings reproduce on the unchanged upstream base with the same toolchain and lockfile; they are not changed by this PR.Tests and clippy run with Rust 1.98.1 in a disposable, non-root, network-isolated container. Formatting uses a date-pinned nightly to honor the repository's rustfmt configuration. The generated local lockfile is not committed, consistent with the repository policy.
Scope and disclosure
This is an AI-assisted fix and test implementation (gpt-6-astra high). The reproducer is fully synthetic.
This PR deliberately preserves the reader's existing self-closing-element handling; paired start/end relationship tags, other package XML readers and XML encoding support are outside this prefix-resolution fix.