PureXML/Sources/Model
Mihaela Mihaljevic 48c2c5c7db
fix(xpath): make string-value extraction iterative and comment-correct (#351)
Computing a node's string-value walked its subtree recursively, so it
overflowed the stack on a deeply-nested node (around 2000 deep on a Swift
Task stack): `XPath.Query("/a/a").strings(over:)` over a 4000-deep chain
crashed. `TreeNode.textContent` and the value-Node string-value behind
`Selection.stringValue` now walk an explicit stack, pushing children reversed
to concatenate in document order.

The value-Node path also wrongly folded descendant comment and
processing-instruction data into an element's string-value, disagreeing with
the tree-node path and XPath 1.0 (5.1/5.5: only text and CDATA contribute to
an element's string-value; a comment or PI node's own string-value, 5.6/5.7,
is still its data). It now matches. No test depended on the old behaviour:
1789 pass, including the XPath and XSLT value corpora.

Closes the string-value sites of #350; the transform walks (canonicalize,
DTD defaults, XSLT result tree) remain tracked there.
2026-06-26 20:44:49 +02:00
..
Attribute.swift
Element.swift perf(model): make the value Node tree type depth-safe (#344) 2026-06-26 17:05:42 +02:00
ElementStorage.swift perf(model): make the value Node tree type depth-safe (#344) 2026-06-26 17:05:42 +02:00
Node.swift perf(model): make the value Node tree type depth-safe (#344) 2026-06-26 17:05:42 +02:00
NodeRebuild.swift perf: make tree-to-tree transforms depth-safe (DTD defaults, canonicalization) (#352) 2026-06-26 19:27:37 +02:00
QualifiedName.swift
TreeNode.swift perf(model): make the TreeNode tree type depth-safe (#343) 2026-06-26 16:39:08 +02:00
TreeNodeConversion.swift perf(xpath): share value-Node projections across a result set (#349) 2026-06-26 18:43:27 +02:00
TreeNodeEditing.swift
TreeNodeIdentity.swift
TreeNodeMutation.swift
TreeNodeNavigation.swift fix(xpath): make string-value extraction iterative and comment-correct (#351) 2026-06-26 20:44:49 +02:00
TreeNodeSpan.swift