
XPath Basics Selecting Nodes by Path in XML Documents
XPath basics on a small library document: absolute and relative paths, //, *, @ attributes, text(), the parent step and the node-set versus value results.
Everything you need to level up your coding skills.

XPath basics on a small library document: absolute and relative paths, //, *, @ attributes, text(), the parent step and the node-set versus value results.

Leading zeros, hex, base 60 times and trailing zeros change what a number is. Real output for 0755, 12:30, 1.10 and 1e3, and how to protect values.

A response or file that stops mid-document fails with an end-of-input error. How to confirm truncation, salvage complete records and decide on repair.

Find the lines and bytes that break a UTF-8 load with iconv, isutf8, grep or a short Python script, and see how PostgreSQL and DuckDB report them.

Export a MySQL query to a clean XLSX with PyMySQL and pandas, handling DECIMAL, zero dates, tinyint flags and utf8mb4, and compare it with Workbench.

A tested XPath guide: the twenty expressions that cover most needs, the traps (namespaces, positions, units, injection), tools, timings on 200,000 records.

MySQL utf8 columns hold three bytes per character, so an emoji becomes a question mark during a CSV load with only a warning. See the fix and the checks.

Export SQL Server query results to XLSX with pyodbc and pandas, and see what SSMS, bcp and the Import and Export Wizard give you instead.

A raw newline, tab or backslash inside a JSON string is invalid. See the errors Python and Node give, how strict=False helps and how to write strings safely.

Question marks in a CSV are lost data, not a display bug. See where the substitution happens, count the damage and decide whether the export is broken.

A line with a word and no colon makes the parser fail while scanning a simple key. See the message in three parsers, the usual causes and the fixes.

When a minified XML file will not parse, xmllint --format and lxml refuse to indent it. A 30-line tokenizer indents what it can and flags the first mismatch.
We send one email when a new article is published. No spam.