delete_element

delete_element(element)
Instance Public methods

Deletes a child element.

element

Must be an Element, String, or Integer. If Element, the element is removed. If String, the element is found (via XPath) and removed. <em>This means that any parent can remove any descendant.<em> If Integer, the Element indexed by that number will be removed.

Returns

the element that was removed.

doc.delete_element "/a/b/c[@id='4']"
doc.delete_element doc.elements["//k"]
doc.delete_element 1
doc_ruby_on_rails
2015-05-06 10:22:02
Comments
Leave a Comment

Please login to continue.