Beefy Boxes and Bandwidth Generously Provided by pair Networks DiBona
Perl-Sensitive Sunglasses
 
PerlMonks  

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

by hippo (Chaplain)
on Nov 15, 2013 at 13:13 UTC ( #1062737=note: print w/ replies, xml ) Need Help??


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

It's only a guess but since you mention "iteration" and don't show any, there's a reasonable chance that the problem is related to how you are performing this "iteration". If you can post a complete, small self-contained script, together with sample input data which demonstrates the problem it might then be possible to see precisely where the problem lies.


Comment on Re: XML::LibXML - could not create file parser context : no error
Re^2: XML::LibXML - could not create file parser context : no error
by rbala (Acolyte) on Nov 15, 2013 at 13:38 UTC
    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.
      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.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (5)
As of 2014-04-19 08:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (478 votes), past polls