class XMLParser extends XMLReader

Utility class for parsing XML documents

Properties

$path Array containing list of element names for current path
$startElementCallback Callback to call when a new element tag starts
$endElementCallback Callback to call when a element tag ends
$textCallback Callback to call when text or cdata is encountered
$whitespaceCallback Callback to call when significant whitespace is encountered

Methods

parse($xml)

Parse an XML string. Calls the callback methods when various nodes of an XML document are encountered

path()

Returns the current path in the XML document as a string with slashes

depth()

Returns the current element depth of the path in the XML document

Details

at line 67
parse($xml)

Parse an XML string. Calls the callback methods when various nodes of an XML document are encountered

Parameters

$xml

at line 111
path()

Returns the current path in the XML document as a string with slashes

at line 118
depth()

Returns the current element depth of the path in the XML document