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 perf(parse): split the name prefix from a scanned colon offset (#292) 2026-06-25 12:23:53 +02:00
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 feat(model): TreeNode editing helpers (attributes, shallow copy, order, normalize) 2026-06-08 15:19:33 +02:00
TreeNodeIdentity.swift feat(model): first-class doctype/entity-reference/namespace nodes, ownerDocument, adoption (#90) 2026-06-09 03:43:24 +02:00
TreeNodeMutation.swift feat(model): mutable parent-aware tree (libxml2 tree.h parity) 2026-06-08 03:13:59 +02:00
TreeNodeNavigation.swift fix(xpath): make string-value extraction iterative and comment-correct (#351) 2026-06-26 20:44:49 +02:00
TreeNodeSpan.swift feat(schema): locate compile diagnostics with validation coding paths (#169) 2026-06-16 10:26:11 +02:00