This module, both source code and documentation, is in the Public Domain, and comes with NO WARRANTY.
This class is available mainly for application writers, who can use it to make a persistent snapshot of a locator at any point during a document parse:
TMyHandler = class(TInterfacedObject, IContentHandler) Flocator : ILocator; Fstartloc : ILocator; [...] end; procedure TMyHandler.setDocumentLocator(const locator: ILocator); begin // note the locator Flocator:= locator; end; procedure startDocument(); begin // save the location of the start of the document // for future use. Fstartloc:= TLocatorImpl.Create(locator) as ILocator; end;
Normally, parser writers will not use this class, since it is more efficient to provide location information only when requested, rather than constantly updating a Locator object.
function getPublicId() : PSAXChar;
Return the saved public identifier.function getSystemId() : PSAXChar;
Return the saved system identifier.function getLineNumber() : Integer;
Return the saved line number (1-based).function getColumnNumber() : Integer;
Return the saved column number (1-based).procedure setPublicId( publicId : PSAXChar);
Set the public identifier for this locator.procedure setSystemId( systemId : PSAXChar);
Set the system identifier for this locator.procedure setLineNumber( lineNumber : Integer);
Set the line number for this locator (1-based).procedure setColumnNumber( columnNumber : Integer);
Set the column number for this locator (1-based).