Ruby REXML::Elements Functions

EditRocket provides the following information on REXML::Elements functions in the Ruby source code builder.

add(element=nil) - Adds an element

collect( xpath=nil, &block ) -

delete(element) - Deletes a child Element

delete_all( xpath ) - Removes multiple elements. Filters for Element children, regardless of XPath matching.

each( xpath=nil, &block) - Iterates through all of the child Elements, optionally filtering them by a given XPath

empty?() - Returns true if there are no Element children, false otherwise

index(element) - Returns the index of the supplied child (starting at 1), or -1 if the element is not a child

inject( xpath=nil, initial=nil, &block ) -

new(parent) - Constructor

size() - Returns the number of Element children of the parent object.

to_a( xpath=nil ) - Returns an Array of Element children. An XPath may be supplied to filter the children. Only Element children are returned, even if the supplied XPath matches non-Element children.