> I will combine Kent's and your suggestion, because he included a > check for an AttributeError: > OK, as a slightly more perl-ish solution to the no Attribute problem you could also do this: try: type = re.search('\w+', parameters['type'].value).group() or 'page' except KeyError: type = 'page' HTH Alan G.