I've been having trouble with a script that terminates unexpectedly and silently. In the script I'm parsing an XML tree using XML::Twig, extracting information and purging as it parses, with the use of handlers (so it uses only a couple of MB of memory):
my $twig = XML::Twig->new(keep_encoding => 1, twig_handlers => {'lemma' => \&ProcessLemma}); sub ProcessLemma { my ($XmlTwig, $XmlLemma) = @_; # extract information here... $XmlLemma->purge; return 1; }
So far so good, but on a particular XML file, it would suddenly quit, without any error message. Now I've stripped the file that causes the problem down to the minimum that makes the script terminate. It contains a node with about 4800 children.
Is there a maximum number of children that Twig can handle? Is this why my script dies? (And is there a way to fix this?)
Thank you in advance for you help!
In reply to XML::Twig too many children? by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |