
Streaming Large XML Files in Java Without Memory Trouble
Measured heap needs for 36.6 MB of XML in Java: DOM fails at 256 MB, StAX with JAXB per record runs in 16 MB, and the memory is flat whatever the file size.
Clients, formatters, linters and CLIs worth installing. Small tools that save hours.

Measured heap needs for 36.6 MB of XML in Java: DOM fails at 256 MB, StAX with JAXB per record runs in 16 MB, and the memory is flat whatever the file size.

fast-xml-parser returns objects, but its defaults drop attributes and turn 007 into 7 and 29.50 into 29.5. Set the options, validate, and see the 4.4 s cost.

DOMParser reads XML in the browser but reports errors as a parsererror element, not an exception. Query with XPath, handle namespaces, compare with HTML mode.

Parse XML in Ruby with Nokogiri: xpath and at_xpath, BigDecimal for money, namespaces, strict versus lenient parsing, the noent option and Reader streaming.

Read XML in PHP 8.5 with SimpleXML, DOMXPath and XMLReader, avoid the boolean cast trap, handle namespaces and read parse errors with libxml_get_errors.

Read XML into Rust structs with quick-xml and serde, stream 200,000 orders in 0.09 seconds, and see how bad booleans and mismatched tags are reported.

Unmarshal XML into Go structs with tags, use a pointer for absent versus empty, catch bad booleans, and stream 200,000 orders in 0.8 seconds.

XmlSerializer writes xsi and xsd namespace declarations and a utf-16 header by default. Remove them, control attributes and lists, and see what it ignores.

Load XML into XDocument, query with LINQ, cast attributes and elements to typed values, handle namespaces, and avoid the culture trap in decimal.Parse.

A tested guide to testing JSON output: asserts, snapshots, volatile fields, schemas, generated data, fixtures and property tests, with a mutation matrix.

Map XML to Java classes with Jakarta XML Binding, read attributes, lists and optional elements, and see a bad boolean and a bad number accepted silently.

JSONPath, JMESPath, jq and the path dialects of PostgreSQL, MySQL and SQLite tested on one document: syntax, null handling, speed, indexes, portability.
We send one email when a new article is published. No spam.