Name
StartElement -- an XML element has been found
Synopsis
StartElement(p, name$, attrs)
Function
This function is called whenever a new XML element is opened. The name of the XML element is passed in name$. The attrs parameter is a table with all the element attribute names and values. The table contains an entry for every attribute in the element start tag. The attribute's name is used as the table index.

Parameters
p
parser handle
name$
name of the XML element
attrs
table containing all element attributes
Example
Function p_StartElement(p, name$, attrs)
   DebugPrint("Open:", name$, attrs.name, attrs.author)
EndFunction
Function p_EndElement(p, name$)
   DebugPrint("Close:", name$)
EndFunction

p = xml.CreateParser({StartElement = p_StartElement,
  EndElement = p_EndElement})
p:Parse([[<plugin name="XML" author="Andreas Falkenhahn"/>]])
p:Free()
The code above will print "Open: plugin XML Andreas Falkenhahn" and then "Close: plugin".

Show TOC