
Embedding Binary Data in XML With Base64 and When Not To
XML cannot hold raw bytes. Base64 adds 33 percent, hex adds 100 percent, and both cost memory. Measured sizes, the schema type, and the alternatives.
Schemas that age well: keys, normalization, constraints and the shortcuts you will regret in a year.

XML cannot hold raw bytes. Base64 adds 33 percent, hex adds 100 percent, and both cost memory. Measured sizes, the schema type, and the alternatives.

Wrapper elements, empty versus absent versus nil, and the one-item list trap when XML becomes JSON, all demonstrated with real parser output.

Version attribute or new namespace? Test results show how strict schemas reject added elements and how an extension point lets old readers keep working.

Attributes suit short identifying values, elements suit everything with structure or long text. A test of the whitespace and ordering rules shows why.

XML names are case sensitive and follow strict character rules. Compare camelCase, snake_case and kebab-case for elements, with the rules that decide.

A practical guide to XML format design: names, attributes, lists, optional data, binary, namespaces and versions, with a tested worked example.

Signs that a PostgreSQL JSONB column should be real columns, what the workarounds cost, and a step-by-step migration that keeps the data and adds constraints.

The same order checked three ways: XSD and RELAX NG passed a wrong total and a negative price, Schematron caught both, only RELAX NG took reordered children.

Build an XSD for an orders file step by step: sequence, pattern, enumeration, optional elements, required attributes and a decimal with attributes.

How to check XML files against an XSD: write the schema, run xmllint and lxml, read the errors, add Schematron for business rules, and test changes safely.

Store XML whole, shred it into tables, or both? What each engine keeps and loses, what validation you get, and what it costs on 200,000 documents.
We send one email when a new article is published. No spam.