in reply to Re^2: Problem in parsing XML file using XMl::Twig
in thread Problem in parsing XML file using XMl::Twig

I am sorry! That was a typo created when I copied the code and pasted it in Perl Monks editor. It is one $. And still the problem exists...
But I realized that I am doing 'new' in a loop and that's why I am loosing the data.
Can someone suggest me how to correct it?
Is there a way to create new Xml::Twig and set the handler later?
Thanks!
  • Comment on Re^3: Problem in parsing XML file using XMl::Twig

Replies are listed 'Best First'.
Re^4: Problem in parsing XML file using XMl::Twig
by davidrw (Prior) on Aug 16, 2005 at 22:35 UTC
    Is there a way to create new Xml::Twig and set the handler later?
    Looking at the POD (i haven't actually tried it) for XML::Twig it looks like you can use the setTwigHandlers ($handlers) method (note there are several set*Handler*() methods).
      I went through the XML::Twig help page and figured out the use of setTwigHandlers().
      But my problem still exists! The changes that I made to $filter_tree is not preserved, only the last change is seen outside the loop.
      Any help in fixing this will be much appreciated!