decodeEntityReferences
Decodes predefined entities and numeric character references in input.
This function currently does not resolve general entities beyond the predefined XML entities.
Parameters
input | Input text containing entity references. |
limits | Safety limits. |
Returns
The decoded string.
Throws
XmlException on unknown entities, malformed references, or when limits are exceeded.fn
string decodeEntityReferences(
string input,
const(string)[string] generalEntities,
XmlParserLimits limits = XmlParserLimits.init) @safeDecodes predefined entities, numeric character references, and general entities.
Parameters
input | Input text containing entity references. |
generalEntities | General entity table (name -> replacement text). |
limits | Safety limits. |
Returns
The decoded string.
Throws
XmlException on unknown entities, malformed references, or when limits are exceeded.fn
string decodeEntityReferences(
string input,
const(string)[string] generalEntities,
const(string)[string] externalGeneralEntities,
XmlParserLimits limits,
string delegate(string systemId) @safe loadExternal) @safeDecodes predefined entities, numeric character references, internal general entities, and external general entities.
External entities are expanded by looking up the entity name in externalGeneralEntities to obtain a SYSTEM identifier, then calling loadExternal to load the entity replacement text.
Parameters
input | Input text containing entity references. |
generalEntities | Internal general entity table (name -> replacement text). |
externalGeneralEntities | External general entity table (name -> systemId). |
limits | Safety limits. |
loadExternal | Loader that fetches the entity text for a system identifier. |
Returns
The decoded string.