As the title says.
I'm processing large downloaded XML files on the fly. Some of those files contain invalid characters such as "US" or "VB" (vertical tab). No clue why those characters are there to begin with. There's nothing I can really do about them.
$z = new XMLReader;
$z->open('compress.zlib://'.$file, "UTF-8");
while ($z->read() && $z->name !== 'p');
while ($z->name === 'p'){
try
{
$node = new SimpleXMLElement($z->readOuterXML());
}catch(Exception $e)
{
echo $e->getMessage();
}
// And so on
}
I get an error saying "String could not be parsed as XML".
What can I do here?