Fix bugs on Parser.attribute when adding new attribute to a namespace:
the namespace should be checked that it's should be an object.