I have a huge XML file (114 KB/1719 lines; see the error message below why I say huge) and I try to read it as I have done with two similar files before.
The other two files load normally and are of comparable size the only difference being that the file in question contains Arabic text. So here is the PHP code:
$doc3 = new DOMDocument('1.0', 'utf-8');
$doc3->load($masternumber.'.xml');
And the error is:
Warning: DOMDocument::load() [domdocument.load]: Excessive depth in document: 256 use XML_PARSE_HUGE option in file: ...
Then $doc3
doesn't load the file. So I modified the code:
$doc3->load($masternumber.'.xml', "LIBXML_PARSEHUGE");
And I end-up with another warrning:
Warning: DOMDocument::load() expects parameter 2 to be long, string given in...
$doc3
is empty again.
What is wrong with it? The other files contain the same text in other languages and load properly but not this one? I am using PHP 5.3.9.
$doc3->load($masternumber.'.xml', LIBXML_PARSEHUGE);
– Gordon Jan 31 '12 at 14:01