PhoenixmlDb.Core
IXmlResourceResolver
Host-injectable seam for resolving the resources referenced by an XInclude xi:include element (href, optionally combined with parse).
#IXmlResourceResolver
Namespace: PhoenixmlDb.Core.Xml
Host-injectable seam for resolving the resources referenced by an XInclude
xi:include
element (
href
, optionally combined with
parse
).
Implementations decide how (and whether) a given absolute Uri may be dereferenced. The default engine-provided implementation is LocalFileResourceResolver, which resolves file: URIs and blocks remote (e.g. http:/https:) URIs unless explicitly allowed. Hosts may supply their own implementation via XIncludeOptions.Resolver to add caching, sandboxing, or support for custom URI schemes.
#Methods
#ResolveText(Uri,String,String,String)
Resolves
for an
xi:include
with
parse="text"
, returning the resource's content decoded as text.
Parameters:
-
absolute— The absolute URI to resolve. -
encoding— The character encoding name specified by theencodingattribute, ornullto auto-detect / use the resource's declared encoding. -
accept— Theacceptattribute value (HTTP Accept header), or null. -
acceptLanguage— Theaccept-languageattribute value (HTTP Accept-Language header), or null.
Returns: The resolved resource's content as text.
#ResolveXml(Uri)
Resolves
for an
xi:include
with
parse="xml"
(the default), returning a reader positioned to parse the referenced resource as XML.
Parameters:
-
absolute— The absolute URI to resolve.
Returns: An XmlReader over the resolved resource.
This method resolves the ABSOLUTE URI it is given. The caller is responsible for resolving a relative
href
against the current xml:base before invoking this method, and treats the passed
as the xml:base origin for content nested inside the resolved resource; this method does not report a redirected/final URI back to the caller. Any path-traversal or sandboxing policy for
file:
-scheme paths (e.g. restricting resolution to a directory allowlist) is the caller/host's concern, not this interface's.