SimpleXML implementation.
The XML Parser extension (expat) is required to use JSimpleXML.
The class provides a pure PHP4 implementation of the PHP5 interface SimpleXML. As with PHP5's SimpleXML it is what it says: simple. Nevertheless, it is an easy way to deal with XML data, especially for read only access.
Because it's not possible to use the PHP5 ArrayIterator interface with PHP4 there are some differences between this implementation and that of PHP5:
The access to the root node has to be explicit in JSimpleXML, not implicit as with PHP5. Write $xml->document->node instead of $xml->node You cannot access CDATA using array syntax. Use the method data() instead You cannot access attributes directly with array syntax. Use attributes() to read them. Comments are ignored. Last and least, this is not as fast as PHP5 SimpleXML--it is pure PHP4.
Example:
Note: JSimpleXML cannot be used to access sophisticated XML doctypes using datatype ANY (e.g. XHTML). With a DOM implementation you can handle this.
Located in /libraries/joomla/utilities/simplexml.php (line 76)
JObject | --JSimpleXML
Document element
The XML parser
Current object depth
Inherited from JObject
JObject::$_errors
Constructor.
Get the parser
Get a JSimpleXMLElement object from a DOM node.
This function takes a node of a DOM document and makes it into a JSimpleXML node. This new object can then be used as a native JSimpleXML element. If any errors occur, it returns FALSE.
Interprets an XML file into an object
This function will convert the well-formed XML document in the file specified by filename to an object of class JSimpleXMLElement. If any errors occur during file access or interpretation, the function returns FALSE.
Interprets a string of XML into an object
This function will take the well-formed XML string data and return an object of class JSimpleXMLElement with properties containing the data held within the XML document. If any errors occur, it returns FALSE.
Set the parser
Handler function for the character data within a tag
Handler function for the end of a tag
Gets the reference to the current direct parent
Handles an XML parsing error
Start parsing an XML document
Parses an XML document. The handlers for the configured events are called as many times as necessary.
Handler function for the start of a tag
Inherited From JObject
JObject::__construct()
JObject::def()
JObject::get()
JObject::getError()
JObject::getErrors()
JObject::getProperties()
JObject::set()
JObject::setError()
JObject::setProperties()
JObject::toString()
JObject::__toString()
Documentation generated on Mon, 25 Jun 2012 13:59:36 -0500 by phpDocumentor 1.4.4