TXmlScanner

OnStartTag

TStartTagEvent = PROCEDURE (Sender : TObject; TagName : STRING; Attributes : TAttrList) OF OBJECT;
PROPERTY OnStartTag : TStartTagEvent READ FOnStartTag WRITE FOnStartTag;

Is called whenever the Execute method has read in a Start Tag.

You can access the attributes by name or by scanning through the list of attributes (Value and Name are STRING variables, i is of type INTEGER):

Value := Attributes.Value ('name');         // Access by name
for i := 0 to Attributes.Count-1 do begin   // Scan through attributes
  Name  := Attributes.Name (i);
  Value := Attributes.Value (i);
  end;

Note that all names in XML are case-sensitive. This includes attribute names. The list of attributes is always sorted by name by the parser.

Parameters

Sender The TXmlScanner instance which triggers the event
TagName The name of the Start Tag. Case sensitive.
Attributes List of attributes

See also

Execute, OnEndTag