Repository navigation
xmojo-public v0.2.1
Released: 2026-11-04 · Commit: 223472d · Previous: v0.2.0
What it does
XML for Mojo: parse into your own structs (from_xml[T]), write them back (to_xml), stream big
documents record by record (Records), or walk a compact tree (parse -> Doc). Structs are
walked with Mojo's standard reflection module; no dependency beyond the standard library. Every gate run checks the
parser against CPython's expat on 4,030 generated, mutated and real documents. Library only,
Mojo 1.2.0, linux-64; pixi install and -I src, or the conda package from recipe.yaml.
Highlights
- Parser fixes: a numeric character reference above U+10FFFF is an error, a DOCTYPE internal subset is skipped to its
]>, an element with 16 or more attributes hashes its names correctly. - Mixed content joins an element's text once, and namespace scoping no longer copies a dict per element.
len(doc)works:DocisSized.
Changes
Added
len(doc)is the element count.- Standard library layout:
pyproject.toml,scripts/ci.sh, a quickstart,docs/api.mdanddocs/design.md. - CI, latest-release and license badges in the README.
Changed
- Namespace scope is one scope with an undo log, not a dict copy per declaring element.
from_xmlraises a plainError, notDeserializationError; the docs say so.- The skill no longer mentions
emberserde.
Fixed
- A numeric character reference above U+10FFFF is an error.
- A DOCTYPE internal subset is skipped to its closing
]>. - Integer fields reject values outside their dtype.
- A
Dictkey that is not an XML name raises instead of writing markup. - Mixed content joins an element's text once, at its end tag.
- Attribute names on tags with 16 or more attributes are hashed.
Verified
| Check | Result |
|---|---|
ci-local at 223472d: the GitHub workflow in a clean Ubuntu 24.04 container, Mojo 1.2.0 |
PASS |
Known limits
- As in v0.2.0.
Upgrade / run
pixi install # Mojo 1.2.0
# in your code: from emberserde import Rename -> from xmojo import Rename
Commits
223472dfix(release): pixi.toml, pyproject.toml, recipe.yaml say 0.2.1c0618eabuild: standard library layout (pyproject, ci.sh, quickstart, api and design docs)b58806cdocs(skill): drop the emberserde mentions v0.2.0 made stale8398886fix(tokenizer): hash attribute names on tags with 16 or more attributes0e2306bfix(dom): one namespace scope with an undo log, not a dict copy per declaring elementdf0c2fcfix(dom): mixed content joins an element's text once, at its end tag06513ecfix(release): pixi.toml and recipe.yaml say 0.2.0, the latest tagdb6c94adocs: from_xml raises a plain Error, not DeserializationError139888ffix(dom): Doc conforms to Sized so len(doc) is the element countcdd73cdfix(encode): a Dict key that is not an XML name raises instead of writing markupd494fd5fix(decode): integer fields reject values outside their dtype8c2b967fix(tokenizer): DOCTYPE internal subset is skipped to its closing ]>0b47badfix(tokenizer): numeric character reference above U+10FFFF is an error2471c5ddocs: CI, latest-release and license badges