Repository navigation
v0.9.0
Highlights
Performance
XSD, XPath 1.0, C14N and RELAX NG are 2–8× faster than v0.8.0 on the bundled benchmarks, with 60–95% less memory on
larger inputs (benchstat, 6 alternating runs per side):
| Area | Benchmark | v0.8.0-era | v0.9.0 | Change |
|---|---|---|---|---|
| XSD validate | 294 KB instance | 15.2 ms, 9.1 MiB | 6.7 ms, 1.3 MiB | −56% time, −86% memory |
| XSD compile | NVD schema | 745 µs, 487 KiB | 395 µs, 177 KiB | −47% time, −64% memory |
| XSD keyref | nesting depth 400 | 79.5 ms, 109 MiB | 10.2 ms, 5.7 MiB | −87% time, −95% memory |
| XPath 1.0 | child path | 671 µs, 766 KiB | 102 µs, 69 KiB | −85% time, −91% memory |
| XPath 1.0 | // descendant path |
791 µs | 162 µs | −79% |
| C14N | 294 KB document, inclusive | 5.75 ms, 4.9 MiB | 1.97 ms, 1.5 MiB | −66% time, −70% memory |
| RELAX NG | compile libvirt grammar | 644 µs | 292 µs | −55% |
Several operations that grew faster than their input now grow linearly: C14N on deeply nested documents (depth 2048:
70 ms → 0.7 ms) and with many namespace bindings (215 ms → 2.2 ms), XSD keyref on nested hosts, and Content() on very
deep trees. XPath 3.1 child/attribute paths are ~72–74% faster.
Correctness
- Entity references are now handled consistently when documents are parsed without entity substitution:
Attribute.Value(),Content(), XPath string values, C14N attribute output, and XSD validation (text and elements
reached through entities) all give the same results as a substituted parse. - XPath descendant axes no longer leak DTD nodes from entity-reference contexts; step results from inside entity
content stay in document order. - The first of two duplicate entity declarations wins again (W3C
valid-sa-086). - xslt3 copies of attributes containing
&are no longer truncated. - XPath 3.1 raises XPTY0018 for path steps mixing nodes and atomic values within one result.
- Empty ATTLIST defaults serialize as valid XML.
- Catalog loading from a FIFO works on macOS when the writer has not written yet.
Hardening
- Attribute values that reference entities are charged against the entity amplification limit, and entity reference
loops in attribute values are rejected, matching libxml2.
Behavior and API changes
Attribute.Value()has a pointer receiver.Content()on elements, documents and attributes leaves out comment and processing-instruction text, and
Document.Content()leaves out the DTD (libxml2 2.9 / XPathstring(/)semantics).xpath3.ErrPathNotNodeSetcarries the XPTY0019 error code;errors.Isstill matches, but its message changed.relaxng.Validator.Validatehonors its context and returns the context's error when cancelled.- New:
helium.CharacterData(n Node) stringreturns a node's own character data with entity references expanded.
Conformance
Unchanged per case versus v0.8.0-era main on every suite: XML 1993 pass / 8 xfail, XSD 1.0 14383 pass / 16 xfail,
XSD 1.1 1048 pass / 1 xfail, QT3 22324 pass / 4 xfail, XSLT 3.0 12346 pass (12827 with slow tests), XMLDSig 2ed 37,
XMLDSig 1.1 33, merlin 16, XML Encryption 1.1 10. Committed summaries now report expected failures in their own row.
What's Changed
- re-measure v0.8.0 at its release tag by @lestrrat in #1428
- cut the cost of the child-list iterators by @lestrrat in #1429
- use pointer receiver for Element attribute iteration by @lestrrat in #1430
- remove map allocations from childReaches by @lestrrat in #1431
- make CopyNode linear instead of quadratic by @lestrrat in #1432
- memoize keyref subtree key-table gathering by @lestrrat in #1443
- xmldsig1: add sign-path id-mutation test by @lestrrat in #1439
- speed up xslt3 whitespace-strip checks by @lestrrat in #1446
- make shim unmarshal child scan linear by @lestrrat in #1435
- make stream.Writer ns lookup O(1) not O(depth) by @lestrrat in #1434
- index the HTML parser's open-element stack by @lestrrat in #1436
- cache substitution-group closures per schema by @lestrrat in #1437
- speed up template dispatch with a per-mode index by @lestrrat in #1438
- index DTD attributes by owning element by @lestrrat in #1433
- guard xslt3 key-table namespace-node walk by AST by @lestrrat in #1440
- use t.TempDir for TestRedefine scratch dir by @lestrrat in #1447
- make start-tag duplicate-attribute scan linear by @lestrrat in #1445
- share validState.seq instead of copying it by @lestrrat in #1444
- shrink the unsafe node-linkage surface by @lestrrat in #1448
- unexport the raw node-linkage entry points by @lestrrat in #1449
- make addSibling resolve its tail in O(1) by @lestrrat in #1441
- wrap long lines in claude docs by @lestrrat in #1452
- resolve append tails the child list reaches by @lestrrat in #1451
- clarify xmlenc1 conformance limitations by @lestrrat in #1454
- clarify conformance suite breadth by @lestrrat in #1455
- fix xmlenc1 GCM compatibility wording by @lestrrat in #1459
- qualify xmlenc1 key-resolution outcomes by @lestrrat in #1461
- remove singular encrypted key fallback by @lestrrat in #1466
- fix fu97 exclusive c14n xml namespace output by @lestrrat in #1457
- fix XPath filter context error chains by @lestrrat in #1465
- fix XPointer context error identity by @lestrrat in #1467
- scale namespace declaration building by @lestrrat in #1469
- deduplicate XMLDSig reference search roots by @lestrrat in #1462
- fix fu116 namespace lookup allocations by @lestrrat in #1464
- preserve retrieval parse context errors by @lestrrat in #1468
- fix xslt3 word numbering on 32-bit by @lestrrat in #1458
- fix XPointer whitespace parsing by @lestrrat in #1453
- limit xpath1 diagnostic excerpts by @lestrrat in #1460
- bound XMLDSig XPath filter inputs by @lestrrat in #1463
- preserve entity references in deep copies by @lestrrat in #1456
- fix XSD complex type diagnostic labels by @lestrrat in #1470
- wrap documentation lines by @lestrrat in #1471
- autodoc updates by @github-actions[bot] in #1472
- chore(deps): bump github/codeql-action from 4.37.8 to 4.37.9 by @dependabot[bot] in #1473
- add relax ng interleave §7.4 conflict checks by @lestrrat in #1476
- switch relax ng interleave to partition validation by @lestrrat in #1477
- use struct{} for existence-check maps by @lestrrat in #1478
- chore(deps): bump golang.org/x/text from 0.41.0 to 0.42.0 by @dependabot[bot] in #1479
- chore(deps): bump github/codeql-action from 4.37.9 to 4.38.0 by @dependabot[bot] in #1480
- chore(deps): bump github/codeql-action from 4.38.0 to 4.38.1 by @dependabot[bot] in #1481
- fix xsd 1.0 simpleContent restriction checks by @lestrrat in #1484
- replace xmldsig1 timing tests with counted checks by @lestrrat in #1485
- chore(deps): bump github/codeql-action from 4.38.1 to 4.38.2 by @dependabot[bot] in #1482
- add XSD compilation and validation benchmarks by @lestrrat in #1486
- add XPath 1.0 and C14N benchmarks by @lestrrat in #1487
- add validation html and xinclude benchmarks by @lestrrat in #1488
- speed up xsd document validation walks by @lestrrat in #1491
- speed up xs:decimal range comparisons by @lestrrat in #1493
- cut allocations in attribute reads and Walk by @lestrrat in #1494
- memoize xsd simple-type chain facts per run by @lestrrat in #1492
- reduce relaxng validation allocations by @lestrrat in #1495
- fold xpath1 // steps at compile time by @lestrrat in #1496
- make c14n namespace work linear in document size by @lestrrat in #1498
- cache compiled xsd pattern facets by @lestrrat in #1490
- skip the doc-order index for sorted xpath1 steps by @lestrrat in #1497
- cut allocations in xsd schema compilation by @lestrrat in #1499
- cut allocations in relaxng compile attribute reads by @lestrrat in #1500
- cut xsd attribute validation allocations by @lestrrat in #1501
- keep the first entity declaration binding by @lestrrat in #1502
- charge attribute entity refs against amplification by @lestrrat in #1504
- expand entity references in Attribute.Value by @lestrrat in #1503
- stop xpath descendant walks at entity references by @lestrrat in #1505
- drop NSPredicate lookups in xsd and schematron by @lestrrat in #1506
- drop wall-clock check from xmlenc1 cancel test by @lestrrat in #1507
- reject entity loops in unexpanded attributes by @lestrrat in #1508
- resolve nested xsd keyrefs by a subtree key index by @lestrrat in #1511
- keep standalone attribute values literal in xslt3 by @lestrrat in #1510
- expand nested entity references in c14n attributes by @lestrrat in #1512
- expand nested entity references in Content by @lestrrat in #1509
- sort xpath1 steps from inside entity content by @lestrrat in #1513
- keep empty ATTLIST defaults as defaults by @lestrrat in #1514
- skip the order index for sorted xpath3 steps by @lestrrat in #1518
- leave entity comments out of Content by @lestrrat in #1515
- replace wall-clock test assertions with counts by @lestrrat in #1516
- poll the context during relaxng validation by @lestrrat in #1517
- raise XPTY0018 for mixed xpath3 step results by @lestrrat in #1519
- leave comments and PIs out of Content by @lestrrat in #1520
- validate xsd text through entity references by @lestrrat in #1521
- wait for data on unpolled catalog FIFOs by @lestrrat in #1523
- expand entity references in xpath string values by @lestrrat in #1524
- replace test sleeps with synctest and signals by @lestrrat in #1522
- make Content linear on deep trees by @lestrrat in #1525
- validate xsd elements reached through entities by @lestrrat in #1526
- leave the DTD out of document Content by @lestrrat in #1527
- refresh W3C conformance evidence and docs by @lestrrat in #1528
- pass -no-system-out to w3ctest in conformance runs by @lestrrat in #1529
- bump release harness pin to 7456121 by @lestrrat in #1530
- measure v0.9.0 into the conformance timeline by @lestrrat in #1531
Full Changelog: v0.8.0...v0.9.0