Skip to content

Commit

Permalink
Enable .xlsx parsing for namespaced definedName values
Browse files Browse the repository at this point in the history
This continues using a pattern for parsing namespaced xlsx files introduced in pr
tafia#73 and thereby allows parsing of namespaced .xlsx
files with definedName values.

`xml.read_text` requires the fully namespaced name.  Since that isn't
always equal to the local_name, the pattern introduced has been to
use `e.local_name` for making comparisons to the raw value of interest and then `e.name()`
instead of that raw value for xml.read_text .
  • Loading branch information
dhbradshaw committed Nov 10, 2021
1 parent a72491b commit 2503fb2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/xlsx.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ impl<RS: Read + Seek> Xlsx<RS> {
{
let name = a.unescape_and_decode_value(&xml)?;
val_buf.clear();
let value = xml.read_text(b"definedName", &mut val_buf)?;
let value = xml.read_text(e.name(), &mut val_buf)?;
defined_names.push((name, value));
}
}
Expand Down

0 comments on commit 2503fb2

Please sign in to comment.