XMLParser Class Reference

List of all members.

Public Member Functions

 XMLParser (&$XML)
 IsSuccess ()
 Whether or not the last parse operation was successful.
 ErrorCode ()
 ErrorString ()
 ErrorLine ()
 ErrorColumn ()
 PrintToFile ($fileName)

Public Attributes

 $result = array()

Private Member Functions

 getEvalPath ()
 handleTagStart ($parser, $tag, $attributes)
 handleTagCData ($parser, $cdata)
 handleTagEnd ($parser, $tag)

Private Attributes

 $parser
 $iter = 0
 $path = array()
 $counter = array()
 $depth = 0
 $lastTag
 $xmlErrorCode
 $xmlErrorString
 $xmlErrorLine
 $xmlErrorCol
 $success

Detailed Description

An XMLParser which contructs a similar to DOM datastructure for easier access to the XML elements.
Remarks:
It does not seem very appropirate for large XML formated files, but for the purpose if the Haystack RESTful Web Service it is perfect.


Member Function Documentation

XMLParser::ErrorCode (  ) 

If the last parse was not successful you can get the error code using this method.

XMLParser::ErrorColumn (  ) 

If the last parse was not successful you can get the error column using this method.

XMLParser::ErrorLine (  ) 

If the last parse was not successful you can get the error line using this method.

XMLParser::ErrorString (  ) 

If the last parse was not successful you can get the error string using this method.

XMLParser::getEvalPath (  )  [private]

XMLParser::handleTagCData ( parser,
cdata 
) [private]

XMLParser::handleTagEnd ( parser,
tag 
) [private]

XMLParser::handleTagStart ( parser,
tag,
attributes 
) [private]

XMLParser::IsSuccess (  ) 

Whether or not the last parse operation was successful.

XMLParser::PrintToFile ( fileName  ) 

Prints the resulting array into a file. Usually this means that this method is used for debugging purposes.

Parameters:
[in] $fileName The name of the file where to print the resulting array.

XMLParser::XMLParser ( &$  XML  ) 

Constructs an XML parser object.

Parameters:
[in] $XML XML data to parse as string.


Member Data Documentation

XMLParser::$counter = array() [private]

XMLParser::$depth = 0 [private]

XMLParser::$iter = 0 [private]

XMLParser::$lastTag [private]

XMLParser::$parser [private]

XMLParser::$path = array() [private]

XMLParser::$result = array()

Will hold the parsed data as PHP array. Allow for direct access in order to avoid copy operations in case the array is big.

XMLParser::$success [private]

XMLParser::$xmlErrorCode [private]

XMLParser::$xmlErrorCol [private]

XMLParser::$xmlErrorLine [private]

XMLParser::$xmlErrorString [private]


The documentation for this class was generated from the following file:
Generated on Fri Sep 15 14:08:26 2006 for Haystack API by  doxygen 1.4.7