XMLParser Class Reference
[Xml]

Generic class for parsing an XML document into a data structure. More...

List of all members.

Public Member Functions

createParser ()
 destroy ()
 destroyParser (&$parser)
parse ($file)
parseStruct ($file, $tagsToMatch=array())
 setHandler (&$handler)
 XMLParser ()


Detailed Description

Generic class for parsing an XML document into a data structure.

Definition at line 28 of file XMLParser.inc.php.


Member Function Documentation

& XMLParser.createParser (  ) 

Initialize a new XML parser.

Returns:
resource

Definition at line 150 of file XMLParser.inc.php.

Referenced by parse(), and parseStruct().

XMLParser.destroy (  ) 

Perform required clean up for this object.

Definition at line 169 of file XMLParser.inc.php.

XMLParser.destroyParser ( &$  parser  ) 

Destroy XML parser.

Parameters:
$parser resource

Definition at line 161 of file XMLParser.inc.php.

Referenced by parse(), and parseStruct().

& XMLParser.parse ( file  ) 

Parse an XML file using the specified handler. If no handler has been specified, XMLParserDOMHandler is used by default, returning a tree structure representing the document.

Parameters:
$file string full path to the XML file
Returns:
object actual return type depends on the handler

Definition at line 52 of file XMLParser.inc.php.

References createParser(), destroyParser(), setHandler(), and FileWrapper.wrapper().

& XMLParser.parseStruct ( file,
tagsToMatch = array() 
)

Parse an XML file using xml_parse_into_struct and return data in an array. This is best suited for XML documents with fairly simple structure.

Parameters:
$file string full path to the XML file
$tagsToMatch array optional, if set tags not in the array will be skipped
Returns:
array a struct of the form ($TAG => array('attributes' => array( ... ), 'value' => $VALUE), ... )

Definition at line 111 of file XMLParser.inc.php.

References createParser(), destroyParser(), and FileWrapper.wrapper().

XMLParser.setHandler ( &$  handler  ) 

Set the handler to use for parse(...).

Parameters:
$handler XMLParserHandler

Definition at line 100 of file XMLParser.inc.php.

Referenced by parse().

XMLParser.XMLParser (  ) 

Constructor. Initialize parser and set parser options.

Definition at line 40 of file XMLParser.inc.php.


The documentation for this class was generated from the following file:

Generated on Mon Jul 14 10:55:49 2008 for Open Journal Systems by  doxygen 1.5.6