class XmlValidator (View source)

Class XmlValidator

Validates XML against XSD

Properties

protected string $doc

DOM Document

protected string $xsd

XML Schema Definition

Methods

__construct()

No description

mixed
getElement($message)

Get element from message

string
getMessage($message)

Get refined message

bool
is_valid(string $xml)

Check if a string is valid XML

array
validate(string $xml, string $xsd)

Validate XML string

Details

__construct()

No description

protected mixed getElement($message)

Get element from message

Parameters

$message

Return Value

mixed

protected string getMessage($message)

Get refined message

Parameters

$message

Return Value

string

bool is_valid(string $xml)

Check if a string is valid XML

Parameters

string $xml

Return Value

bool

array validate(string $xml, string $xsd)

Validate XML string

Parameters

string $xml
string $xsd file

Return Value

array