PureXML/Sources/XInclude
Mihaela Mihaljevic f4982219a6
perf(xinclude): make XInclude processing depth-safe (#354)
`PureXML.XInclude.process` rebuilt the tree recursively (`process →
processElement → process`), so a deeply-nested document overflowed the stack
one native frame per element level, even with no includes present. It now
drives an explicit work stack: each branch gathers its processed children into
a reference accumulator, then a deferred build step assembles the node. The
`xml:base`, inclusion-chain depth (bounded by `maxDepth`), and cycle-detection
visited set thread down per context exactly as before; an include splices its
(or its fallback's) content in place by pushing the loaded nodes back onto the
stack.

Behavior is unchanged: the XInclude/XPointer conformance corpus and the
fallback, xpointer, cycle, and xml:base cases all pass. A 50000-deep document,
with or without an include at its base, now processes without crashing, guarded
by `XIncludeDepthSafetyTests`. Part of #350.
2026-06-27 16:55:03 +02:00
..
URIReference.swift feat(xinclude): XInclude, URI resolution, and xml:base 2026-06-08 06:08:31 +02:00
XIncludeError.swift feat(xinclude): content-negotiation hints, cycle detection, text+fragment 2026-06-08 15:52:18 +02:00
XIncludeProcessor.swift perf(xinclude): make XInclude processing depth-safe (#354) 2026-06-27 16:55:03 +02:00
XIncludeRequest.swift feat(xinclude): content-negotiation hints, cycle detection, text+fragment 2026-06-08 15:52:18 +02:00