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?
2
-
Out of curiosity, what sort of XML file are you reading that's 67MB? I'm surprised PHP isn't running out of memory with a file that large.Daniel– Daniel2010-08-09 21:19:29 +00:00Commented Aug 9, 2010 at 21:19
-
XML file contains our own internal data :) and PHP is not running out of memory. We have given plenty of memory to PHP and there is no such memory limit error.Maximus– Maximus2010-08-09 22:14:09 +00:00Commented Aug 9, 2010 at 22:14
Add a comment
|
2 Answers
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.
1 Comment
Maximus
I tried but its not working. All its saying valid atleast DOMDocument detects errors. $xml = new XMLReader(); $xml->open("../output.xml"); if($xml->setSchema('../schema.xsd')) { if($xml->isValid()) { echo 'Valid'; } else { echo 'Not valid'; } } else { echo 'Failed to load xml schema'; }