Class Summary : TLocatorImpl

Provide an optional convenience implementation of Locator.
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.


Since : SAX 1.0
See :
ILocator

Methods

function getPublicId() : PSAXChar
function getSystemId() : PSAXChar
function getLineNumber() : Integer
function getColumnNumber() : Integer
procedure setPublicId(PSAXChar)
procedure setSystemId(PSAXChar)
procedure setLineNumber(Integer)
procedure setColumnNumber(Integer)


function getPublicId() : PSAXChar;

Return the saved public identifier.
Result : The public identifier as a string, or an empty string if none is available.
See : ILocator.getPublicId
See : TLocatorImpl.setPublicId

Top


function getSystemId() : PSAXChar;

Return the saved system identifier.
Result : The system identifier as a string, or an empty string if none is available.
See : ILocator.getSystemId
See : TLocatorImpl.setSystemId

Top


function getLineNumber() : Integer;

Return the saved line number (1-based).
Result : The line number as an integer, or -1 if none is available.
See : ILocator.getLineNumber
See : TLocatorImpl.setLineNumber

Top


function getColumnNumber() : Integer;

Return the saved column number (1-based).
Result : The column number as an integer, or -1 if none is available.
See : ILocator.getColumnNumber
See : TLocatorImpl.setColumnNumber

Top


procedure setPublicId( publicId : PSAXChar);

Set the public identifier for this locator.
Parameter : publicId The new public identifier, or an empty string if none is available.
See : TLocatorImpl.getPublicId

Top


procedure setSystemId( systemId : PSAXChar);

Set the system identifier for this locator.
Parameter : systemId The new system identifier, or an empty string if none is available.
See : TLocatorImpl.getSystemId

Top


procedure setLineNumber( lineNumber : Integer);

Set the line number for this locator (1-based).
Parameter : lineNumber The line number, or -1 if none is available.
See : TLocatorImpl.getLineNumber

Top


procedure setColumnNumber( columnNumber : Integer);

Set the column number for this locator (1-based).
Parameter : columnNumber The column number, or -1 if none is available.
See : TLocatorImpl.getColumnNumber

Top