def set_attributes(namespace, attribute_hash = nil)
      if attribute_hash.nil?
        attribute_hash = namespace
        namespace = ""
      end
      
      raise ArgumentError, "namespace can't be nil" if namespace.nil?
      raise ArgumentError, "attribute_hash should be a Hash" unless attribute_hash.is_a? Hash

      namespace_attributes = @attributesByNamespace[namespace]
      namespace_attributes.clear if namespace_attributes
      
      attribute_hash.each_pair do |key, value|
          # Calling set_attribute() is required to ensure validations
          set_attribute(namespace, key, value)
      end
    end
def set_attributes(namespace, attribute_hash = nil)
      if attribute_hash.nil?
        attribute_hash = namespace
        namespace = ""
      end
      
      raise ArgumentError, "namespace can't be nil" if namespace.nil?
      raise ArgumentError, "attribute_hash should be a Hash" unless attribute_hash.is_a? Hash

      namespace_attributes = @attributesByNamespace[namespace]
      namespace_attributes.clear if namespace_attributes
      
      attribute_hash.each_pair do |key, value|
          # Calling set_attribute() is required to ensure validations
          set_attribute(namespace, key, value)
      end
    end
set_attributes(attribute_hash)
   set_attributes(namespace, attribute_hash)

 Sets the attributes specified by a Hash in the given +namespace+ in one operation. The
 previous attributes of the specified +namespace+ are removed.
 See #set_attribute for allowable attribute value types.

 _attributes_:: a Hash where keys are attribute keys
 _namespace_:: "" (default namespace) by default

 Raises an +ArgumentError+ if any key in the map is not a legal SDL identifier
 (see SDL4R#validate_identifier), or any value is not a legal SDL type.