
Sorting XML Elements for Stable Output and Clean Diffs
Sort XML records by a key with XSLT or lxml so two exports of the same data produce the same file, including numeric keys and nested children.
Older than half the tools that still emit it. Namespaces, XPath and getting rows out of feeds and exports.

Sort XML records by a key with XSLT or lxml so two exports of the same data produce the same file, including numeric keys and nested children.

Two branches each add a dependency to the same pom.xml and Git reports a conflict. See why, then use the union merge driver and a manual rule that works.

A feed renamed price to cost and the loader kept running with empty columns. A short script compares element path snapshots and reports the change.

A one-line XML file turns every change into one giant diff. Two ways to fix it, a textconv diff driver and a formatted file in the repo, with real output.

Make a line diff of two XML files show real changes only, by canonicalizing both sides, then use xmldiff when you need structural edit actions.

Three XML files with the same meaning gave three different checksums. Canonical XML (C14N) fixes attribute order and quoting, but not whitespace.

A feed health check that tests the fetch, status, content type, well-formedness, item count and freshness, run on eight scenarios with its output.

A feed with a raw ampersand, a missing id, a bad date, a duplicate id and an extra element: repair what is safe, quarantine the rest, report each reject.

Fetch a feed only when it changed: ETag and Last-Modified headers, a 304 response, a state table, and what to do when the server ignores them.

A gzip file, gzip transfer encoding and unlabeled gzip behave differently in requests and urllib. Sniff the bytes, stream 36.6 MB at 21 MB, and guard bombs.

Check a Merchant-style product feed before loading it: required fields, price format, availability values, GTIN check digits, duplicate ids and links.

Call a SOAP service from Python with zeep: load the WSDL, call an operation, get typed results, handle a Fault, see the request envelope,.
We send one email when a new article is published. No spam.