Repository navigation
Closed
Description
Design intent (network streaming)
Imagine an Excel file arriving over the network. A streaming parser should:
- Read bytes / XML tokens incrementally as they arrive
- Recognize a local complete format unit (one BIFF record, one cell/row element, …)
- Immediately emit that unit as a
Package - Let a renderer stream-render packages without waiting for the whole file
So: Network Stream → Parser (incremental) → Package (complete local fragment) → Renderer.
What is still wrong after #33 / PR #34
-
Reader/BinaryandReader/Xmlformat types are not Packages
BinaryPackage/XmlPackageare thin wrappers around the real format objects (XlsBiffRecord, worksheet XML handling). The format entities themselves should be the packages. -
Parsing is still bulk, not network-incremental
- Binary: workbook stream is fully buffered (
ReadStream()→byte[]) before records are walked - OpenXML:
ZipWorker.Extractunpacks the entire ZIP to disk before any sheet XML is read
That cannot progressively emit packages while data is still in flight.
- Binary: workbook stream is fully buffered (
-
Consumers still think in “whole workbook → DataSet”
Progressive render needs a package stream API first;DataSetcan remain a batch consumer on top.
Target shape
Binary
- BIFF record types are
BinaryPackage(inheritance or the record hierarchy lives under the package model) BinaryPackageParserreads aStreamand emits a package as soon astype+size+bodyfor one record is complete (no need to buffer the entire workbook stream up front when the source allows)- OLE directory/FAT positioning is an IO concern; once the workbook stream is positioned, record parse is strictly streaming
XML (OpenXML)
- Sheet semantic units under
Reader/XmlareXmlPackage(cell / row / merge / hyperlink / …) XmlPackageParseremits a package when a local XML fragment is complete (e.g. finished</c>or</row>)- Prefer streaming ZIP entry inflate for
sheetN.xmlinstead of full-archive extract to temp
Renderer contract
IEnumerable<IPackage>/ pull parserTryRead(out IPackage)suitable for progressive UI or markdown emission- Batch
DataSetbuilder remains optional downstream
Acceptance criteria
- Format entities in Binary/Xml are Packages (not wrapped by a parallel unrelated type tree)
- Binary parser can emit record packages from a forward-only workbook stream without requiring a full prior
byte[]copy of that stream (API-level; buffering only one record) - Xml parser emits packages at local completeness boundaries (cell/row/…)
- OpenXML sheet reading can use a streamed ZIP entry (document remaining gaps if full OPC streaming is phased)
-
src/test.shstays green - Document how a progressive renderer would subscribe to the package stream
Related
- refactor excel formart reader as package-packageparser system #1 original package-parser request
- Refactor package/parser to streaming BinaryPackage + XmlPackage model #33 first streaming refactor (insufficient — wrappers + bulk IO)
Metadata
Metadata
Assignees
Labels
No labels
Activity
Make Binary/Xml format entities true streaming packages (#35) (#36)