ddn.data.xml.catalog

OASIS XML Catalog support.

This module provides in-library support for resolving external identifiers (system/public IDs) and URIs using OASIS XML Catalog files.

Supported entry types:

  • system
  • public
  • rewriteSystem
  • rewriteURI
  • delegatePublic
  • delegateSystem
  • delegateURI
  • nextCatalog

Notes:

  • The legacy resolveSystem / resolvePublic APIs perform exact-map only lookups for

backward compatibility.

  • The resolve*Full APIs implement rewrite/delegation/nextCatalog processing.

Types 1

An in-memory XML Catalog.

Fields
string basePathCatalog file path (used for resolving relative catalog references).
string[string] systemMapping from system identifiers to URIs.
string[string] public_Mapping from public identifiers to URIs.
RewriteRule[] rewriteSystem
RewriteRule[] rewriteUri
DelegateRule[] delegatePublic
DelegateRule[] delegateSystem
DelegateRule[] delegateUri
string[] nextCatalog
Methods
string resolveSystem(string systemId) const @safe nothrowResolves a system identifier.
string resolvePublic(string publicId) const @safe nothrowResolves a public identifier.
string resolveSystemFull(string systemId, size_t maxDepth = 16) const @safeResolves a system identifier using rewrite/delegation/nextCatalog rules.
string resolvePublicFull(string publicId, size_t maxDepth = 16) const @safeResolves a public identifier using delegation/nextCatalog rules.
string resolveUriFull(string uri, size_t maxDepth = 16) const @safeResolves a URI using rewrite/delegation/nextCatalog rules.
XmlCatalog loadCached(string path, ref XmlCatalogCache cache) const @safe
string resolveSystemFullDepth(string systemId, size_t maxDepth, size_t depth, ref XmlCatalogCache cache) const @safe
string resolvePublicFullDepth(string publicId, size_t maxDepth, size_t depth, ref XmlCatalogCache cache) const @safe
string resolveUriFullDepth(string uri, size_t maxDepth, size_t depth, ref XmlCatalogCache cache) const @safe
string applyRewrite(const RewriteRule[] rules, string input) const @safe nothrow
string applyDelegateSystem(string systemId, size_t maxDepth, size_t depth, ref XmlCatalogCache cache) const @safe
string applyDelegatePublic(string publicId, size_t maxDepth, size_t depth, ref XmlCatalogCache cache) const @safe
string applyDelegateUri(string uri, size_t maxDepth, size_t depth, ref XmlCatalogCache cache) const @safe
string bestDelegate(const DelegateRule[] rules, string input) const @safe nothrow
string applyNextCatalogSystem(string systemId, size_t maxDepth, size_t depth, ref XmlCatalogCache cache) const @safe
string applyNextCatalogPublic(string publicId, size_t maxDepth, size_t depth, ref XmlCatalogCache cache) const @safe
string applyNextCatalogUri(string uri, size_t maxDepth, size_t depth, ref XmlCatalogCache cache) const @safe
string resolveCatalogPath(string catalogRef) const @safe
string normalizeUri(string uriOrPath) const @safe
string normalizePublicId(string publicId) @safe
Nested Templates
RewriteRuleA rewrite rule (`rewriteSystem`/`rewriteURI`).
DelegateRuleA delegation rule (`delegate*`).
XmlCatalogCache

Functions 8

fnXmlCatalog loadCatalogFromFile(string path) @safeLoads an XML Catalog from a file.
fnXmlCatalog parseCatalog(string xml, string basePath = "") @safeParses an XML Catalog from `xml`.
private fnvoid parseEntries( ref XmlCatalog cat, string xml, string tag, string keyAttr, string valueAttr) @safe
private fnvoid parseRewriteEntries( ref XmlCatalog cat, string xml, string tag, string startAttr, string prefixAttr) @safe
private fnvoid parseDelegateEntries( ref XmlCatalog cat, string xml, string tag, string startAttr, string catalogAttr) @safe
private fnvoid parseNextCatalogEntries(ref XmlCatalog cat, string xml) @safe
private fnsize_t indexOfTag(string xml, string tag, size_t start) @safe pure nothrow
private fnstring[string] parseAttributes(string tagSnippet) @safe