
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.
Tag
59 posts

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.

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.

Seeing odd letter pairs where accents belong means UTF-8 was read as a legacy encoding. See the byte level cause and a table of symptoms.

What Content is not allowed in prolog means in Java: a BOM decoded to text, a double BOM, JSON or text instead of XML, and how to diagnose it.

A CSV from Windows leaves an invisible carriage return on every last column. See it in a shell loop and MySQL, and fix it without damaging quoted fields.

Why the country code NO becomes False in YAML 1.1, how keys collide, which parsers are affected and three fixes: quote, use a 1.2 parser or a schema.

See how a stray comma turns one column into two, what the four quoting states are, and why a backslash does not escape a quote in CSV the way it does in code.

RFC 4180 is a four page memo, not a standard. Read its seven rules, the grammar quirks that surprise people, and how real files and readers drift from it.

A complete guide to everyday YAML syntax: indentation, scalars, quoting, collections, block strings, anchors, null and versions, tested with real parsers.

A CSV file promises rows and delimiters and little else. See what six readers did with one awkward file, and how to read CSV without guessing.