PhoenixmlDb.XQuery

HttpDocumentClient

Shared for fetching XML documents referenced by fn:doc() / xsl:source-document / fn:doc-available() when the resolved URI is http:// or https://.

#HttpDocumentClient

Namespace: PhoenixmlDb.XQuery

Shared

for fetching XML documents referenced by

fn:doc()

/

xsl:source-document

/

fn:doc-available()

when the resolved URI is

http://

or

https://

.

One static client is reused across the process to amortize TCP/TLS handshake cost. Conservative 30 s timeout — long enough for typical XML documents over the network, short enough that a misconfigured URL surfaces as an error rather than hanging the query. Sandbox enforcement is the caller's responsibility:

PolicyEnforcingResolver

wraps this when a

ResourcePolicy

is configured.

#Methods

#OpenRead(Uri)

Opens a streaming read of

. The caller is responsible for disposing the returned stream. Streaming avoids buffering large documents into a string before parsing — important for the 100+ MB documents the engine targets.

Synchronous-over-async: the underlying

call is awaited to completion on the calling thread. This is fine on runtimes that allow thread blocking (server, desktop, CLI) but fails on Blazor WebAssembly (single-threaded, cannot park a thread on a monitor wait). On WASM, register a custom

that pre-fetches documents asynchronously instead of relying on this default loader — we throw a clear error here rather than the runtime's obscure

Cannot wait on monitors

message.