I checked the PHP.net bug reports, and found that if you have trailing whitespace in your xml file, this bug will occur.
After cleaning up the white space in the xml file, PHP 4.03pl1 does not crash, but xmldoc() returns false, instead of the xml objects.
Is there anything wrong with this XML:
<?xml version="1.0"?>
<invoices>
<invoice>
<invno>IN_122121</invno>
<date>01/01/99</date>
<terms>Net 30</terms>
<total>123.12</total>
<customer>
<lastname>Strahl</lastname>
<firstname>Rick</firstname>
<address>32 Kaiea</address>
</customer>
<lineitems>
<item>
<sku>LABOR_PRG</sku>
<descript>Programming Labor</descript>
<qty>5.5</qty>
<price>150.00</price>
</item>
<item>
<sku>LABOR_PRG</sku>
<descript>Programming Labor</descript>
<qty>3.5</qty>
<price>200.00</price>
</item>
</lineitems>
</invoice>
<invoice>
<invno>IN_122122</invno>
</invoice>
</invoices>
John Lim wrote:
Hello,
Is DOMXML working in Windows? I tried the following program:
<?
$src = "localhost//php/xml/inv.xml";
$f = fopen($src,'r');
$xml = fread($f,99999999);
fclose($f);
print "$src xml=$xml";
$otree = xmldoc($xml);
print gettype($otree);
print_r($otree);
?>
I got the following error:
PHP has encountered an Access Violation at 03C124D5
It crashed at the xmldoc().
The XML parses properly, because I loaded it into IE 5.0, and IE parsed the file.
Thanks -- John