A class which provides filtering of children for Elements, and XPath
search support. You are expected to only encounter this class as the
element.elements object. Therefore, you are not expected
to instantiate this yourself.
Fetches a child element. Filters only Element
children, regardless of the XPath match.
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. Because of the nature of XPath searches, any element in the connected XML
document can be fetched through any other element.The Integer
index is 1-based, not 0-based. This means that the first child element
is at index 1, not 0, and the +n+th element is at index n, not
n-1. This is because XPath indexes
element children starting from 1, not 0, and the indexes should be the
same.
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 again that the indexes start at 1.
Returns:
the first matching Element, or nil if no child
matched
Iterates through all of the child Elements,
optionally filtering them by a given XPath
xpath:
optional. If supplied, this is a String XPath, and
is used to filter the children, so that only matching children are yielded.
Note that XPaths are automatically filtered for Elements, so that non-Element children will not be yielded
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.