I am sorry I cannot answer right now (I am at XML Europe and web access is pretty difficult here, all of 4 machines from xml.com).
Maybe the problem is that when you purge the twig the uncles disappear. Or that anything outside the twig_roots is not part of the twig (it is not loaded at all).
Sorry for the lack of support, just send me an email next week and I will have a look at it.
Update: OK, we're lucky, I managed to grab a machine for a couple of minutes, so here it is:
Your code does not work because when you set a handler on /log/msg/error it is called just after the end tag for error has been parsed. At this point the request element has not yet been parsed.
From the handler on /log/msg/error you can access the element previous siblings, but not the next ones, they have not been parsed yet.
The easiest solution is probably to put a handler on /log/msg and from there test whether there is an error child. At this point the entire msg element will have been parsed and you will be able to access all of its children.
Good question though, I'll make sure it makes it into the FAQ.
In reply to Re: XML::Twig - can't find my uncle!
by mirod
in thread XML::Twig - can't find my uncle!
by DrSax
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |