ddn.data.xml.xinclude

XInclude processing (phased).

This module provides basic support for the W3C XInclude 1.0 mechanism.

Current scope (MVP):

  • Supports <xi:include href='...'/> with the namespace URI http://www.w3.org/2001/XInclude.
  • Supports parse='xml' (default) and parse='text'.
  • Local filesystem includes only; network fetching is disabled by default.
  • Bounded recursion depth.
  • Uses xmllint --xinclude as an oracle in unittests.

Types 1

XInclude options.

Fields
size_t maxDepthMaximum include nesting depth.
bool allowNetworkIf `true`, allow network/URI includes (disabled by default).
const(ubyte)[] delegate(string uri) @safe networkLoaderOptional loader for non-`file:` URIs.
bool cacheResourcesIf `true`, cache loaded include payloads by resolved identifier.

Functions 5

fnXmlDocument processXInclude(XmlDocument doc, XmlXIncludeOptions options = XmlXIncludeOptions.init) @safeApplies XInclude processing to `doc`.
private fnbool isXIncludeElement(XmlElement el) @safe
private fnXmlElement findFallback(XmlElement include) @safe
private fnstring normalizeTextNewlines(string s) @safe
private fnvoid processElement( XmlDocument owner, XmlElement el, size_t depth, XmlXIncludeOptions options, ref XmlResourceLoader loader) @safe

Variables 1

private enumvarXINCLUDE_NS = "http://www.w3.org/2001/XInclude"