
Choosing Between XSLT XQuery and a Script for XML Jobs
The same grouping job in XSLT 1.0, XSLT 2.0, XQuery and Python gave the same revenue to the cent. How the four compare on speed, length, exactness and fit.
Clients, formatters, linters and CLIs worth installing. Small tools that save hours.

The same grouping job in XSLT 1.0, XSLT 2.0, XQuery and Python gave the same revenue to the cent. How the four compare on speed, length, exactness and fit.

Query XML with XQuery in BaseX: for, let, where, order by and return, group by with exact decimals, and element constructors, on two sample files.

Pass values into XSLT from xsltproc and lxml, and see why a param that looks like a string is read as an XPath expression and silently ignored.

Sort with xsl:sort and filter with XPath predicates in XSLT, and avoid the default text sort that put 250000 after 44.00 and 29.50. Multiple keys and case.

Group 20,000 invoices by currency with a Muenchian key in XSLT 1.0 and with for-each-group in XSLT 2.0 on Saxon, with sums, counts and timings.

How an XSLT processor decides what to run: template match patterns, apply-templates, the built-in rules that dump text, modes, and the identity template.

Load a CSV into SQLite with one sqlite-utils command, set a primary key, control type detection, add full-text search, and see what 2 million rows cost.

Four CSV validators run on the same broken files: qsv validate, csvkit csvclean, CSVLint and Frictionless. What each reports, how it exits and which to use.

Open a CSV in VisiData to scroll, sort, filter and profile it from the keyboard, build frequency tables, and save results, plus its batch mode for scripts.

Miller (mlr) treats CSV rows as named records and chains verbs with then. Real runs for sorting, grouping, new columns, JSON conversion and splitting files.

xsv and qsv share a command set, and qsv adds an index, sniffing, validation and more. See the overlap, the real timings with an index, and the type trap.

A field guide to CSV tools: csvkit, qsv, Miller, DuckDB, sqlite-utils, Polars, pandas and VisiData, run on the same 2 million row file with timings.
We send one email when a new article is published. No spam.