Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: XML::LibXML Issue

by runrig (Abbot)
on Aug 16, 2013 at 16:29 UTC ( #1049759=note: print w/replies, xml ) Need Help??


in reply to XML::LibXML Issue

Perhaps http occasionally fails to fetch content? What you might want to do is eval in a loop (add some limit to the loop at your discretion):
my $dom; while (1) { $dom = eval{ XML::LibXML->load_xml(location => $xmlurl) }; last if $dom; print "Error getting xml-will retry: $@\n"; sleep 5; }

Replies are listed 'Best First'.
Re^2: XML::LibXML Issue
by omegaweaponZ (Beadle) on Aug 16, 2013 at 20:09 UTC
    Interesting suggestion. It is possible the page has not executed the xml entirely yet and the parser jumps the gun attempting to parse

      It is possible the page has not executed the xml entirely yet and the parser jumps the gun attempting to parse

      No. Incomplete download (http response) can happen, but its very doubtful that libxml jumps the gun at any point and causes the apperance of incomplete download

        So what happens is I can re-try to load the xml if under a count of lets say 5, it either will work on the first try, fail all 5 times, or work sometime within the 5 times. So this isn't exactly a "solution" of sorts. Are there any other ideas that might help or have others seen this before with xml parsers?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1049759]
help
Chatterbox?
[marto]: yay, Depeche Mode at the Barrowlands on Sunday. The best venue in Glasgow for music, despite it's looks :) Also the smallest gig DM will have played in a long time

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (9)
As of 2017-03-24 11:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (301 votes). Check out past polls.