htmlparser2 is a fast, forgiving HTML/XML parser for Node.js and browsers, written in TypeScript. It provides a low-level streaming tokenizer (Tokenizer) that feeds events to a higher-level Parser, which handles tag matching, implicit closing, foreign content (SVG/MathML), and entity decoding. The library also includes Node.js WritableStream and Web Streams API WritableStream adapters for piping data directly into the parser. It is the foundation for cheerio and other DOM manipulation libraries. The codebase is well-structured, thoroughly tested, and actively maintained, with a focus on performance and spec compliance for real-world HTML.
pugixml is a lightweight, high-performance C++ XML processing library that provides a DOM-like interface, a fast non-validating parser, and XPath 1.0 support. It is designed for embedding into other applications and is used widely in game development, desktop applications, and embedded systems. The library is distributed as a single source file (`pugixml.cpp`) and header (`pugixml.hpp`), with optional header-only mode and extensive compile-time configuration via `pugiconfig.hpp`. It supports automatic encoding detection (UTF-8, UTF-16, UTF-32, Latin1), BOM handling, and full Unicode conversion. The architecture is monolithic but well-organized: the core parser uses recursive descent with custom memory pooling (page-based allocator) for fast DOM construction. The DOM tree is exposed through lightweight handle classes (`xml_node`, `xml_attribute`, `xml_text`) with iterator support for children and attributes. XPath queries are compiled into an internal representation and evaluated against the tree with full axis, function, and predicate support. Output is handled via an abstract `xml_writer` interface, allowing custom sinks. The library has zero external dependencies beyond the C++ standard library. Key entry points include `xml_document::load_file`, `load_buffer`, `load_string`, and `save_file`. Data flows involve loading XML from files, memory buffers, or streams into an in-memory DOM, then performing traversal, modification, or XPath queries, and finally saving the modified document. The library is used in production for parsing configuration files, serializing data, and processing XML messages in network protocols. It has an extensive test suite covering parsing edge cases, XPath compliance (W3C and Xalan), memory stress tests, and fuzzing harnesses. The codebase demonstrates strong craftsmanship: template-based parser specializations avoid runtime branching, memory management hooks allow custom allocators, and the compact mode reduces footprint for constrained environments. The library is well-maintained with active CI (GitHub Actions, AppVeyor), fuzz testing, and support for many compilers and platforms. The only notable technical drift is the continued support for legacy compilers (MSVC6, Borland), which adds preprocessor complexity but does not affect modern usage.
xmlquery is a Go library for querying XML documents using XPath expressions. It provides functions to parse XML from various sources (string, file, URL, etc.), execute XPath queries, and manipulate the resulting node tree. The library features a caching mechanism for compiled XPath expressions to improve query performance and supports streaming parsing for large XML files to minimize memory usage. The architecture is modular, with separate concerns for parsing, querying, and node manipulation, and it relies on external dependencies for XPath expression handling and LRU caching.
ruby-nmap is a Ruby library that provides programmatic access to the nmap network scanning tool. It consists of two main components: 1) A command-line interface builder (Nmap::Command) that allows Ruby programs to configure and execute nmap scans with full access to nmap's options through a Ruby DSL, and 2) An XML parser (Nmap::XML) that converts nmap's XML output into navigable Ruby objects representing hosts, ports, services, OS detection results, and script output. The library acts as a bridge between Ruby applications and the nmap executable, handling the complexity of command-line argument construction and XML parsing while providing an idiomatic Ruby interface. The project is actively maintained with recent commits, comprehensive test coverage, and support for multiple Ruby versions.
sax-wasm is a high-performance SAX-style XML/HTML/JSX parser written in Rust and compiled to WebAssembly, with JavaScript/TypeScript bindings for Node.js and browsers. It provides streaming parsing of byte streams, emitting events for tags, attributes, text nodes, processing instructions, comments, CDATA, and doctype declarations. The parser is non-validating and focuses on raw speed, using SIMD instructions and optimized grapheme cluster handling. It includes a comprehensive TypeScript API with async generator support for streaming reads from ReadableStream. The repository contains the full Rust source, JS/TS bindings, build tooling (wasm-bindgen, wasm-opt), and extensive test suites covering XML, JSX, Angular templates, edge cases with multi-byte characters, and write-boundary splitting. While the parser is highly optimized and well-tested, the project appears to be in a stale maintenance state with no recent commits (last commit dated 2026-09-13, likely erroneous) and a small community following.
node-xml2js is a mature, well-tested Node.js library for bidirectional conversion between XML and JavaScript objects. It uses sax-js for parsing and xmlbuilder-js for building, providing a simple callback or Promise-based API. The library supports extensive configuration options including attribute and tag name processors, value processors, namespace handling, CDATA, and various output formatting. The source code is written in CoffeeScript (compiled to JavaScript), which is now a deprecated language, and the dependencies are outdated (sax >=0.6.0, xmlbuilder ~11.0.0). While the library is functionally complete and has been widely used (over 4900 stars), it has not seen active development in years, and the CoffeeScript source presents a barrier for modern contributions. The codebase is well-structured with clear separation of concerns, but the technical drift is high due to the use of deprecated tools and outdated dependency versions.