class REXML::Element
def delete_element element
a.delete_element('//c') # => nil
a.delete_element('//c') # =>
a = d.root # => ... >
d = REXML::Document.new 'text
otherwise returns +nil+:
removes and returns the element at xpath if it exists,
When xpath argument +xpath+ is given,
a.delete_element(c) # => nil
a.delete_element(c) # =>
c = a[2] # =>
a = d.root # => ... >
d = REXML::Document.new 'text
otherwise returns +nil+:
removes and returns that child element if it exists,
When element argument +element+ is given,
a.delete_element(1) # => nil
a.delete_element(1) # =>
a.delete_element(1) # =>
a = d.root # => ... >
d = REXML::Document.new 'text
returns +nil+ if the element does not exist:
indexing does not include text nodes;
removes and returns the child element at that offset if it exists;
When 1-based integer argument +index+ is given,
Deletes a child element.
delete_element(xpath) -> removed_element or nil
delete_element(element) -> removed_element or nil
delete_element(index) -> removed_element or nil
:call-seq:
def delete_element element @elements.delete element end