SQL-like language for querying and mutating XML files. Built for automated editing toolchains: reads a script (or inline query), applies it to XML documents in memory, and writes the result to stdout — a well-behaved Unix filter.
cargo build --release # -> target/release/xsql
xsql # interactive REPL (like node/python)
xsql script.xsql # run a script file
xsql -e "USE db.xml SELECT GROUP arms;" # inline query
cat script.xsql | xsql # script from stdin
cat db.xml | xsql -e "USE INPUT ..." # XML from stdin (pipeline filter)
USE db.xml
FOREACH good IN goods
WHERE good.cost > 500
SET good.cost = good.cost * 2
;Output goes to stdout: SELECT results print immediately, and every
document a script modified is pretty-printed after the script finishes.
Errors go to stderr with file:line:col diagnostics and a non-zero exit code.
Full language reference, architecture and performance notes live at
xsql-docs (checked out here under
docs/ as a submodule).
xsql/— the library + binaryxsql-tests/— all tests (lexer, parser, DOM, interpreter, CLI end-to-end) and fixtures; runcargo testfrom the workspace rootdocs/— the xsql-docs submodule