This module caches and reuses Namespace contexts, so the number allocated will be equal to the element depth of the document, not to the total number of elements (i.e. 5-10 rather than tens of thousands). Also, data structures used to represent contexts are shared when possible (child contexts without declarations) to further reduce the amount of memory that's consumed.
procedure copyTables();
Copy on write for the internal tables in this context.This class is optimized for the normal case where most elements do not contain Namespace declarations.
function getDefaultNS() : PSAXChar;
function getPrefixTable() : SAXStringArray;
function getPrefixTableElements() : SAXStringArray;
function getPrefixTableLength() : Integer;
function getUriTable() : SAXStringArray;
function getUriTableElements() : SAXStringArray;
function getUriTableLength() : Integer;
function getDeclarations() : SAXStringArray;
procedure setParent(const parent : TNamespaceContext);
(Re)set the parent of this Namespace context. The context must either have been freshly constructed, or must have been clearedprocedure clear();
Makes associated state become collectible, invalidating this context. setParent must be called before this context may be used again.procedure declarePrefix(const prefix : SAXString; const uri : SAXString);
Declare a Namespace prefix for this context.procedure declarePrefix( prefix : PSAXChar; prefixLength : Integer; uri : PSAXChar; uriLength : Integer);
Declare a Namespace prefix for this context.function processName(const qName : SAXString; isAttribute : Boolean) : TNamespaceParts;
Process a raw XML 1.0 name in this context.function processName( qName : PSAXChar; qNameLength : Integer; isAttribute : Boolean) : TNamespaceParts;
Process a raw XML 1.0 name in this context.function getURI(const prefix : SAXString) : SAXString;
Look up the URI associated with a prefix in this context.function getURI( prefix : PSAXChar; prefixLength : Integer) : PSAXChar;
Look up the URI associated with a prefix in this context.function getPrefix(const uri : SAXString) : SAXString;
Look up one of the prefixes associated with a URI in this context.Since many prefixes may be mapped to the same URI, the return value may be unreliable.
function getPrefix( uri : PSAXChar; uriLength : Integer) : PSAXChar;
Look up one of the prefixes associated with a URI in this context.Since many prefixes may be mapped to the same URI, the return value may be unreliable.
function getDeclaredPrefixes() : SAXStringArray;
Return an enumeration of prefixes declared in this context.function getPrefixes() : SAXStringArray;
Return an enumeration of all prefixes currently in force.The default prefix, if in force, is not returned, and will have to be checked for separately.
prefixTable
Extension properties to get properties from self or parent
property prefixTable : SAXStringArray read getPrefixTable
prefixTableElements
property prefixTableElements : SAXStringArray read getPrefixTableElements
prefixTableLength
property prefixTableLength : Integer read getPrefixTableLength
uriTable
property uriTable : SAXStringArray read getUriTable
uriTableElements
property uriTableElements : SAXStringArray read getUriTableElements
uriTableLength
property uriTableLength : Integer read getUriTableLength
defaultNS
property defaultNS : PSAXChar read getDefaultNS
declarations
property declarations : SAXStringArray read getDeclarations