// OnComment is handled by the SAXLexicalHandler
procedure TSAXParser.SetOnComment(const Value: TOnComment);
begin
  FLexicalHandler.OnComment := Value;
end;
function  TSAXParser.GetOnComment: TOnComment;
begin
  Result := FLexicalHandler.OnComment;
end;
// OnStartDocument is handled by the SAXContentHandler
procedure TSAXParser.SetOnStartDocument(const Value: TOnStartDocument);
begin
  FContentHandler.OnStartDocument := Value;
end;
function TSAXParser.GetOnStartDocument: TOnStartDocument;
begin
  Result := FContentHandler.OnStartDocument;
end;

Example 4: Event handler property access methods of TSAXParser use the TSAXHandler classes to store/retrieve their value.

Back to Article