You signed in with another tab or window.Reload to refresh your session.You signed out in another tab or window.Reload to refresh your session.You switched accounts on another tab or window.Reload to refresh your session.Dismiss alert
gosax is a Go library for XML SAX (Simple API for XML) parsing, supporting read-only functionality. This library isdesigned for efficient and memory-conscious XML parsing, drawing inspiration from various sources to provide aperformant parser.
Features
Read-only SAX parsing: Stream and process XML documents without loading the entire document into memory.
Efficient parsing: Utilizes techniques inspired byquick-xml andpkg/json for high performance.
SWAR (SIMD Within A Register): Optimizations for fast text processing, inspired bymemchr.
Compatibility with encoding/xml: Includes utility functions to bridgegosax types withencoding/xml types, facilitating easy integration with existing code that uses the standard library.
When migrating fromencoding/xml togosax, note that self-closing tags are handled differently. To mimicencoding/xml behavior, setgosax.Reader.EmitSelfClosingTag totrue. This ensures self-closing tags are recognized and processed correctly.
Using TokenE
If you are used toencoding/xml'sToken, start withgosax.TokenE.Note: Usinggosax.TokenE andgosax.Token involves memory allocation due to interfaces.