PureXML/docs
Mihaela Mihaljevic 9032d61950
fix(xpath): skip the document-order key for single-node string extraction (#299)
firstInDocumentOrder() computed a document-order key even for a zero- or
one-node set. The key walks a node up to the root, taking its index among each
parent's children, which is a linear scan of a wide parent. string(@x) and
value-of take the string-value of a (usually single) node-set through this
path, so an XSLT transform over a wide flat fan-out rescanned the wide parent
once per extraction, turning the transform quadratic.

For a set of zero or one node the document order is irrelevant: the node is
trivially first. Return it directly without computing the key, the same
count <= 1 early-out sortedByDocumentOrder() already has.

A transform reading a couple of attributes and child values per element over a
20k-element document drops from ~2.3s to ~0.65s (~3.5x). The output is
unchanged: the full suite, the Apache Xalan XSLT gold-output corpus, the W3C
XPath/XSLT/EXSLT tests, and the WASM build stay green, and FirstInDocumentOrderTests
pins the single-node fast path and the multi-node document-first selection.
2026-06-25 18:12:45 +02:00
..
design docs(design): derive the exact Particle Valid (Restriction) procedure (#252) 2026-06-23 10:50:38 +02:00
plans fix(schema): a non-nillable element must carry no xsi:nil at all (cvc-elt.3.1) 2026-06-20 03:22:05 +02:00
rules Mirror mandatory Swift rules 2026-06-18 22:00:41 +02:00
benchmarks.md fix(xpath): skip the document-order key for single-node string extraction (#299) 2026-06-25 18:12:45 +02:00
onboarding-antigravity.md docs: correct the last stale valid-schemas-rejected figure 2026-06-19 23:32:04 +02:00
production-readiness.md docs: production-readiness standard, read every conformance iteration 2026-06-14 16:28:03 +02:00
release-hurdles.md fix(schema): attribute-wildcard union/intersection per Errata E1-10 (#251) 2026-06-23 04:56:17 +02:00
roadmap.md docs: align stale figures with code and the enforced XSTS gate 2026-06-19 23:32:04 +02:00
schema-validity-burndown.md fix(schema): carry global ref metadata into restrictions 2026-06-19 09:03:49 +02:00
validation-coverage-registry.txt feat(validation,schema): composable validation framework and cross-document composition 2026-06-16 09:57:43 +02:00
validation-field-registry.txt feat(validation,schema): composable validation framework and cross-document composition 2026-06-16 09:57:43 +02:00
xsts-deviations.md fix(schema): carry global ref metadata into restrictions 2026-06-19 09:03:49 +02:00