Improving namespace optimizer, extract method canAddNamespaceAttribute(),to check if the namespace can be defined on a node