
DOM Versus SAX Versus StAX Parsing in Java Compared
The three Java XML APIs on one 36.6 MB file: DOM ran out of memory at a 256 MB heap and took 1.03 s with 1 GB, while SAX and StAX ran in 32 MB in about 0.3 s.
Clients, formatters, linters and CLIs worth installing. Small tools that save hours.

The three Java XML APIs on one 36.6 MB file: DOM ran out of memory at a 256 MB heap and took 1.03 s with 1 GB, while SAX and StAX ran in 32 MB in about 0.3 s.

A tested guide to diffing, patching and merging JSON: normalizing, array identity, JSON Patch, Merge Patch, atomic apply, deep merge, history and tests.

Split a 36.6 MB XML file into eight valid files of 25,000 orders with iterparse in 1.5 seconds at 21 MB, and see why split -l produces broken XML.

Why cat breaks XML, and three ways that work: XInclude with xmllint, XSLT with document(), and lxml, with the xml:base attribute side effect of XInclude.

grep counts lines, not elements. Count XML elements correctly with xmllint, xmlstarlet and a streaming parser, and see why grep gave 20000 for 49819 lines.

Two different tools are called yq. Both read XML and print JSON or YAML, with different prefixes for attributes. See each one's output and which you have.

Change a value, add an attribute and delete an element in XML from a script with xmlstarlet or lxml, and compare with sed on diffs, comments and escaping.

Select values, make delimited lines, count nodes, list element paths and sort with xmlstarlet sel, and avoid the escaped ampersand in its default text output.

Pretty-print one-line XML with xmllint, set the indent, strip blank text for stable diffs, get canonical form and change encoding, and see what it alters.

Read a Microsoft Project XML plan into tasks with durations, start dates, percent complete and predecessors, and learn how Visio files are zipped XML.

Take a SOAP envelope apart: Header, Body, the namespaced response and a Fault, then read the price from the payload in Python without a client library.

Pick a config format by who edits it and what reads it. One config tested in YAML, TOML, JSON, INI and more: types, traps, errors, size and switching cost.
We send one email when a new article is published. No spam.