decodeEntityReferences

fnstring decodeEntityReferences(string input, XmlParserLimits limits = XmlParserLimits.init) @safe

Decodes predefined entities and numeric character references in input.

This function currently does not resolve general entities beyond the predefined XML entities.

Parameters

inputInput text containing entity references.
limitsSafety limits.

Returns

The decoded string.

Throws

XmlException on unknown entities, malformed references, or when limits are exceeded.
fnstring decodeEntityReferences( string input, const(string)[string] generalEntities, XmlParserLimits limits = XmlParserLimits.init) @safe

Decodes predefined entities, numeric character references, and general entities.

Parameters

inputInput text containing entity references.
generalEntitiesGeneral entity table (name -> replacement text).
limitsSafety limits.

Returns

The decoded string.

Throws

XmlException on unknown entities, malformed references, or when limits are exceeded.
fnstring decodeEntityReferences( string input, const(string)[string] generalEntities, const(string)[string] externalGeneralEntities, XmlParserLimits limits, string delegate(string systemId) @safe loadExternal) @safe

Decodes 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

inputInput text containing entity references.
generalEntitiesInternal general entity table (name -> replacement text).
externalGeneralEntitiesExternal general entity table (name -> systemId).
limitsSafety limits.
loadExternalLoader that fetches the entity text for a system identifier.

Returns

The decoded string.