I am using XMLReader to parse a very large XML file using PHP. According to web documentation I have found, my code is as follows:
$reader = new XMLReader();
$reader->open('file.xml');
while ($reader->read()) {
$reader->read();
if($reader->name == 'NAME' && $reader->nodeType == XMLReader::ELEMENT) {
$element = $reader->expand();
echo $element->textContent;
}
}
$reader->close();
When it gets to the expand(), I get a "Warning: DOM is not enabled...." when in fact, DOM/XML is enabled according to phpinfo(). I am using PHP5.2.12. I have checked that my XML is not malformed. This is driving me nuts as hours of searching the web doesn't seem to solve my problem. Thanks for your help!
$reader = new XMLReader();
$reader->open('file.xml');
while ($reader->read()) {
$reader->read();
if($reader->name == 'NAME' && $reader->nodeType == XMLReader::ELEMENT) {
$element = $reader->expand();
echo $element->textContent;
}
}
$reader->close();
When it gets to the expand(), I get a "Warning: DOM is not enabled...." when in fact, DOM/XML is enabled according to phpinfo(). I am using PHP5.2.12. I have checked that my XML is not malformed. This is driving me nuts as hours of searching the web doesn't seem to solve my problem. Thanks for your help!