Maximus
Maximus

Reputation: 2976

XML file validation using PHP

I am using DOMDocument for xml file validation. It takes more than 30 minutes in validating a 67MB xml file. Is there any other way to improve this checking time?

Upvotes: 0

Views: 164

Answers (2)

MaxProWeb
MaxProWeb

Reputation: 1

try {
    libxml_use_internal_errors(true);
    $oXml = new SimpleXMLElement($sXml, LIBXML_DTDVALID);
} catch (Exception $e) {
    $aErrors = libxml_get_errors();
}

Upvotes: 0

Have you tried XMLReader? I recall this one as being pretty decent, though I don't think I tested it on anything as large as 67 MB.

Upvotes: 1

Related Questions