Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In-memory document parser #29

Closed
ianprime0509 opened this issue Nov 23, 2023 · 1 comment
Closed

In-memory document parser #29

ianprime0509 opened this issue Nov 23, 2023 · 1 comment
Labels
enhancement New feature or request

Comments

@ianprime0509
Copy link
Owner

The current parser options are primarily oriented towards streaming a document from a file or other reader source. However, one of the design goals behind Scanner was to additionally enable a more optimized in-memory, zero copy document parser for cases where that is feasible.

To that end, a new type can be created (one potential name is Parser) which accepts a full XML document as a slice and uses Scanner to go through the document one codepoint at a time, yielding events which can reference the underlying document rather than copying data as Reader does today. These events would reference the raw document data, so additional functions would be needed to apply transformations such as entity expansion and end-of-line normalization to the raw data if needed.

@ianprime0509
Copy link
Owner Author

Implemented in #36 via StaticDocument.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant