A namespace is declared on a namespace context. Namespace contexts are pushed on and popped off the namespace context stack.
A declared namespace will be in scope iff the context that it was declared on has not been popped off the stack.
TODO: need to retain all attributes/namespaces and then store all namespaces before the attributes.