Story

Show HN: Standards compliant SAX-style XML parser for JavaScript

federicocarboni Thursday, November 06, 2025

A while ago I wanted to write some tools to process EPUBs in JavaScript, the format is basically zipped XML so I immediately looked for a parser. There are quite a few XML parsers for JavaScript but I was disappointed to find out that basically none of them support the full XML specification, namespace support was not very good and they were quite slow for what they did.

None of the parsers I saw around support proper entity expansion or check the internal DTD for syntax errors. This approximation is not benign, if the XML data processed is passed to other software it could be interpreted differently.

And that's the story of why I made my own.

Though not definitive, I also ran some benchmarks against other libraries:

https://github.com/federicocarboni/saxe/tree/trunk/bench

Summary
Saxe is a Python library that provides a simple and lightweight API for parsing and manipulating XML data. It offers a concise and efficient way to work with XML documents, making it a useful tool for developers working with XML-based data.
3 0
Summary
github.com
Visit article Read on Hacker News