| A class which provides filtering of children for Elements, and XPath
search support.
Enumerable
Constructor @param parent the parent Element
Fetches a child element @param index the search parameter. This is either
an Integer, which will be used to find the index'th child Element, or an XPath,
which will be used to search for the Element.
NOTE that because of the nature of XPath searches,
any element in the connected XML document can be fetched through any other
element. @param name optional, and only used in the first argument is an
Integer. In that case, the index'th child Element that has the supplied name will be
returned. Note that the indexes start at 1. @return the first matching Element, or nil if no child matched
Sets an element, replacing any previous matching element. If no existing
element is found ,the element is added. @param index is used to find a
matching element to replace. See [](). @param element the element to
replace the existing element with @return the previous element; nil if no
previous element was found.
@return true if there are no Element children,
false otherwise
@return the index of the supplied child (starting at 1), or -1 if the
element is not a child @param element a child of this Element
Deletes a child Element @param element Either an
Element, which is removed directly; an xpath,
where the first matching child is removed; or an Integer, where the n'th Element is removed. @return the removed child
Removes multiple elements @param xpath all elements matching this String
path are removed. @return an Array of Elements
that have been removed
Adds an element @param element if supplied, is either an Element, String, or Source (see Element.initialize). If not supplied or nil, a new,
default Element will be constructed @return the
added Element
Iterates through all of the child Elements,
optionally filtering them by a given XPath Only
supply the first parameter (and a block). The second parameter is used
internally for recursion. @param xpath optional. If supplied, this is a
String XPath, and is used to filter the children,
so that only matching children are yielded
|