PHP 7.0.6 Released

The libXMLError class

(PHP 5 >= 5.1.0, PHP 7)

Introduction

Contains various information about errors thrown by libxml. The error codes are described within the official ยป xmlError API documentation.

Class synopsis

libXMLError {
/* Properties */
public int $level ;
public int $code ;
public int $column ;
public string $message ;
public string $file ;
public int $line ;
}

Properties

level

the severity of the error (one of the following constants: LIBXML_ERR_WARNING, LIBXML_ERR_ERROR or LIBXML_ERR_FATAL)

code

The error's code.

column

The column where the error occurred.

Note:

This property isn't entirely implemented in libxml and therefore 0 is often returned.

message

The error message, if any.

file

The filename, or empty if the XML was loaded from a string.

line

The line where the error occurred.

User Contributed Notes

mati
2 years ago
If someone wanna use this to parse xml schema and validate it. Look out there is a bug

https://bugs.php.net/bug.php?id=54138

which wont be fixed.
To Top