In xyPerl you can easily check for the presence or get the value of an attribute from a specific ancestor using the rather elegant syntax provided (@name, ../@name, ../../@name, ancestor::element/@name, etc...)
But checking if you are in a certain context…