in reply to Re^5: XML::LibXML Parser Error
in thread XML::LibXML Parser Error

So from initial testing, it seems that the parser will work fine when I write this to a temporary file, then read from that file, yet fail when reading directly from the web xml output. That seems completely counter intuitive. If I can read and write out proper xml everytime to a local file why can't the parser read and parse directly from the web xml output everytime!

This still seems to suggest an error with the parser having issues from the web output even though the HTML returns correctly...

However, what we can attempt to do is use this newly created string and parse as a string, instead of a location. That seems to bypass whatever issue has been causing problems, so we would use:

$dom = XML::LibXML->new->load_xml(string => "$xml");
Instead of the URL directly. This seems to do the trick.

Thanks again for your help!

Replies are listed 'Best First'.
Re^7: XML::LibXML Parser Error
by Anonymous Monk on Mar 08, 2014 at 08:23 UTC

    That seems completely counter intuitive. If I can read and write out proper xml everytime to a local file why can't the parser read and parse directly from the web xml output everytime!

    webservers are free (and frequently do) give out nonsense frequently

    webserver is bartender

    you can ask webserver/bartender for milk, but he can give you nothing or a glass of cow urine -- webserver/bartender is free to be insane