
Round Tripping YAML Without Losing Comments or Order
Edit a YAML file in code and keep its comments, anchors and quotes. PyYAML drops them, ruamel.yaml and yq keep them, and each changes some whitespace.
Everything you need to level up your coding skills.

Edit a YAML file in code and keep its comments, anchors and quotes. PyYAML drops them, ruamel.yaml and yq keep them, and each changes some whitespace.

Pull records out of a SOAP response with lxml: mixed-namespace children, xsi:nil, empty versus absent, repeated nodes and exact decimals.

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.

Compile a stylesheet once with lxml, pass parameters safely, read xsl:message from the error log, block file and network reads, and know the 1.0 limit.

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.

Generate a Markdown table from a YAML list in Python, escaping pipes, joining lists, handling blanks and keeping the table in sync with the YAML in CI.

Read a key, value and type sheet with openpyxl, build nested YAML from dotted keys, and keep versions, dates and blanks from changing on the way.

Convert YAML to XML with xmltodict, using @ keys for attributes, repeated elements for lists, and checks for invalid names and the single-root rule.
We send one email when a new article is published. No spam.