Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
PerlMonks  

Re^2: XML::LibXML - could not create file parser context : no error

by rbala (Acolyte)
on Nov 15, 2013 at 13:38 UTC ( #1062741=note: print w/ replies, xml ) Need Help??


in reply to Re: XML::LibXML - could not create file parser context : no error
in thread XML::LibXML - could not create file parser context : no error

Hi Hippo, You can assume it to a function happening at regular intervals like the below :

sub parsexml { my $parser_obj = XML::LibXML->new(); my $doc; my $xml_file = "filename.xml"; $doc = $parser_obj->parse_file($xml_file); my ($xml_node) = $doc->findnodes($xpath); } parsexml(); sleep 30; parsexml(); sleep 30; . . . .
The overall thing happening is , same file is accessed multiple times or parsed multiple times this way over a period of time. I am not sure, if the problems lies here or not. Please revert if more details are required. Thanks, Bala.


Comment on Re^2: XML::LibXML - could not create file parser context : no error
Download Code
Re^3: XML::LibXML - could not create file parser context : no error
by choroba (Abbot) on Nov 15, 2013 at 13:54 UTC
    Problem is somewhere else, I would say, as the following works for me without problem:
    for (1 .. 10000) { my $p = 'XML::LibXML'->new; my $d = $p->parse_file('example.xml'); my $n = $d->findnodes('/'); }

    Does any other process overwrite the file at the same time?

    لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ
      Hi Choroba, The file is actually only read and nothing is written to it. Also, the file is not accessed by any other processes. Does the error statement "No error" has any significance ?? Thanks, Bala.

        If nothing is written to the file, it never changes. So why are you parsing it over and over again? I don't see the point in that but perhaps you can explain.

        Does this help you? Google thinks it is related to "No error". What version of XML::LibXML do you happen to run?
        لսႽ ᥲᥒ⚪⟊Ⴙᘓᖇ Ꮅᘓᖇ⎱ Ⴙᥲ𝇋ƙᘓᖇ

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1062741]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (4)
As of 2014-07-26 18:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (178 votes), past polls