PHP Libxml



Introduction to PHP Libxml

Libxml functions and constants are used with SimpleXML, XSLT, and DOM functions.


Installation

These functions require the Libxml package. Download at xmlsoft.org


PHP Libxml Function

PHP: Indicates the earliest PHP version that supports this function.

FunctionDescriptionPHP
libxml_clear_errors()Clear Libxml error buffer. 5
libxml_get_errors()Retrieve the error array. 5
libxml_get_last_error()Retrieve the last error from Libxml. 5
libxml_set_streams_context()Set the streams context for the next time a Libxml document is loaded or written. 5
libxml_use_internal_errors()Disable Libxml errors, allowing users to read error information on demand. 5


PHP Libxml Constants

FunctionDescriptionPHP
LIBXML_COMPACTSet small node allocation optimization. Will improve application performance. 5
LIBXML_DTDATTRSet the default DTD attributes. 5
LIBXML_DTDLOADLoads an external subset. 5
LIBXML_DTDVALIDValidate via DTD. 5
LIBXML_NOBLANKSDelete empty nodes. 5
LIBXML_NOCDATASet CDATA as a text node. 5
LIBXML_NOEMPTYTAGChange the empty tag (for example, <br/> to <br></br>). Available only in the DOMDocument->save() and DOMDocument->saveXML() functions. 5
LIBXML_NOENTAlternative entity. 5
LIBXML_NOERRORDo not display error reports. 5
LIBXML_NONET Stop network access while loading the document. 5
LIBXML_NOWARNINGDo not display warning reports. 5
LIBXML_NOXMLDECLUndo the XML declaration when saving the document. 5
LIBXML_NSCLEANRemove extra namespace declarations. 5
LIBXML_XINCLUDEUse XInclude substitution. 5
LIBXML_ERR_ERRORGet a recoverable error. 5
LIBXML_ERR_FATALGetting a fatal error. 5
LIBXML_ERR_NONEGet no errors. 5
LIBXML_ERR_WARNING Get a simple warning. 5
LIBXML_VERSIONGet Libxml version (e.g. 20605 or 20617)5
LIBXML_DOTTED_VERSIONGet the dotted Libxml version (for example: 2.6.5 or 2.6.17). 5