I'm just going to quote the pod, mmkay (don't got perl handy). It looks like you're looking for "attribute_condition" :
- new
-
- twig_handlers
-
This argument replaces the corresponding XML::Parser argument. It consists
of a hash { expression => \&handler} where expression is a
generic_attribute_condition, string_condition,
an attribute_condition,full_path, a partial_path, a gi,
_default_ or <_all_>.
The idea is to support a usefull but efficient (thus limited) subset of
XPATH. A fuller expression set will be supported in the future, as users
ask for more and as I manage to implement it efficiently. This will never
encompass all of XPATH due to the streaming nature of parsing (no lookahead
after the element end tag).
A generic_attribute_condition is a condition on an attribute, in the form
*[@att=``val''] or *[@att], simple quotes can be used instead of double
quotes and the leading '*' is actually optional. No matter what the gi of the
element is, the handler will be triggered either if the attribute has the
specified value or if it just exists.
An attribute_condition is a simple condition of an attribute of the
current element in the form gi[@att=``val''] (simple quotes can be used
instead of double quotes, you can escape quotes either).
If several attribute_condition are true the same element all the handlers
can be called in turn (in the order in which they were first defined).
If the =``val'' part is ommited ( the condition is then gi[@att]) then
the handler is triggered if the attribute actually exists for the element,
no matter what it's value is.
____________________________________________________ ** The Third rule of perl club is a statement of fact: pod is sexy. | [reply] [Watch: Dir/Any] |