Class DOMIT_Parser
Invokes a SAX parser to parse XML text, catches the SAX events, and builds the DOMIT_Document. Called by DOMIT_Document.

isPublic? no
isAbstract? no

Inheritance tree:

DOMIT_Parser (top level class)

Known subclasses:

None

Source file: xml_domit_parser.php

Includes: xml_saxy_parser.php




Constructor
Default constructor.

Signature: DOMIT_Parser()

isPublic? no




Public Constants



Private Constants



Public Fields



Private Fields
xmlDoc
A reference to DOMIT_Document into which the xml is to be parsed.

Type: DOMIT_Document

currentNode
A reference to the node currently being parsed and appended by the parsing engine.

Type: DOMIT_Node




Public Methods



Private Methods
parse
Invokes the Expat parser and parses the specified $xmlText into $myXMLDoc.

Signature: parse (& $myXMLDoc, $xmlText)

Parameters:

DOMIT_Document myXMLDoc - The DOMIT_Document to be populated.

String xmlText - The xml string to be parsed.

Returns:

boolean - True if the text is valid XML, false if invalid.

parseSAXY
Invokes the SAXY parser and parses the specified $xmlText into $myXMLDoc.

Signature: parseSAXY(& $myXMLDoc, $xmlText)

Returns:

boolean - True if the text is valid XML, false if invalid.

startElement
Captures the tag name and attributes of an xml element, then builds the element and appends it to the current DOMIT_Document.

Signature: startElement($parser, $name, $attrs)

Parameters:

Object parser - The instance of the XML parser doing the parsing.

String name - The name of the current element tag.

array attributes - An associative array containing the names / values of the element's attributes.

endElement
Captures the end element event.

Signature: endElement($parser, $name)

Parameters:

Object parser - The instance of the XML parser doing the parsing.

String name - The name of the current element tag.

dataElement
Captures the text data from TextNodes and CDATASections and builds these nodes and adds them to the DOMIT_Document.

Signature: dataElement($parser, $data)

Parameters:

Object parser - The instance of the XML parser doing the parsing.

String data - The textual data of the node.


Documentation generated by ClassyDoc, using the DOMIT! and SAXY parsers.
Please visit Engage Interactive to download free copies.