Split the attr from the type
Copy the pseudo-code for ns/prefix lookup