class REXML::Element
def delete_namespace namespace="xmlns"
d.to_s # => ""
d.root.delete_namespace('nosuch')
Does nothing if no such namespace is found:
d.to_s # => ""
d.root.delete_namespace('foo')
With argument +namespace+, removes the specified namespace:
d.to_s # => ""
d.root.delete_namespace # =>
d.to_s # => ""
d = REXML::Document.new ""
With no argument, removes the default namespace:
Removes a namespace from the element.
delete_namespace(namespace = 'xmlns') -> self
:call-seq:
def delete_namespace namespace="xmlns" namespace = "xmlns:#{namespace}" unless namespace == 'xmlns' attribute = attributes.get_attribute(namespace) attribute.remove unless attribute.nil? self end