TXmlScanner

OnEmptyTag

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

Is called whenever the Execute method has read in an Empty-Element Tag of the form <name/>

When you have an Empty-Element Tag of the form <name></name>, the events OnStartTag and OnEndTag are triggered.

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, OnStartTag, OnEndTag