in reply to XML Twig - Isolate Element
I was in the middle of writing a long explanation on why this is normal, when it occured to me to try your code, and apparently it works just fine in XML::Twig 3.32. Which is completely wrong (not to mention baffling!). So I think I need to investigate this one a bit.
In any case the gist of the explanation was that XML::Twig works by storing trees. In order to ensure that even when twig_roots is used, it always store the root of the document. Which flush (should!) duly print when asked to. If you just use print instead of flush, then you should get what you want (and the subsequent purge should get rid of the element anyway, so you shouldn't see any increase in memory usage).
Does that help?In any case it looks like you helped me find a regression in the code, so thanks a lot.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: XML Twig - Isolate Element
by zacc (Novice) on Jan 03, 2008 at 17:52 UTC | |
by mirod (Canon) on Jan 03, 2008 at 18:00 UTC | |
by zacc (Novice) on Jan 03, 2008 at 18:06 UTC | |
by mirod (Canon) on Jan 04, 2008 at 16:28 UTC |