in reply to Re^2: XML::Twig error handling
in thread XML::Twig error handling

Checking (and warning) that the attribute is missing is easy: add unless( defined $filter->att( 'Name' )) { warn "missing 'Name' attribute\n"; } in the handler.

To warn that Filter is missing, you will have to set a handler at the next higher level (Filters in this case), and check there that there is a Filter child for the element.

Alternatively you could write the DTD (or RelaxNg schema) that your tool expects and validate the XML before processing it (using xmllint for example). This way you simplify the code for your tool and it becomes much easier to change the format you expect. Plus having to write the DTD/schema is usually a good thing, it helps getting a proper format.