openpyxl.preserve.xmlscan
paper-xlsx 0.2.1 API reference
Namespace-tracking streaming scanner over ORIGINAL worksheet XML bytes.
Produces the byte spans the splice writer needs — top-level region elements, rows, cells — plus the shared-formula/array/metadata inventory that gates edits. Everything it does not understand is left as bytes for the splice to copy verbatim.
Guard set: DOCTYPE refused; non-UTF-8 refused; the target grammar is matched only via the EXACT parent chain worksheet→sheetData→row→c (ancestor containment admits legal decoys in cell-level extLst and mc:AlternateContent — measured silent wrong-edits); prefixed or non-main default namespaces refuse (the unguarded failure mode is silent value deletion accepted by both loaders); r-less rows/cells refuse. Every refusal happens before any output is written.