'Lookup a markup element (directive or role), given its name which can
be a full name (with domain).'

def lookup_domain_element(self, type, name):

    name = name.lower()
    if (':' in name):
        (domain_name, name) = name.split(':', 1)
        if (domain_name in self.env.domains):
            domain = self.env.get_domain(domain_name)
            element = getattr(domain, type)(name)
            if (element is not None):
                return (element, [])
    else:
        def_domain = self.env.temp_data.get('default_domain')
        if (def_domain is not None):
            element = getattr(def_domain, type)(name)
            if (element is not None):
                return (element, [])
    element = getattr(self.env.get_domain('std'), type)(name)
    if (element is not None):
        return (element, [])
    raise ElementLookupError
