Evaluates to true
if this element has at least one child Element
doc = Document.new "<a><b/><c>Text</c></a>" doc.root.has_elements # -> true doc.elements["/a/b"].has_elements # -> false doc.elements["/a/c"].has_elements # -> false
Synonym for Element.elements
.each
Synonym for Element.to_a This is a little slower than calling elements.each directly.
Returns the next sibling that is an element, or nil if there is no Element
sibling after this one
doc = Document.new '<a><b/>text<c/></a>' doc.root.elements['b'].next_element #-> <c/> doc.root.elements['c'].next_element #-> nil
Removes an attribute
either an Attribute
or a String
. In either case, the attribute is found by matching the attribute name to the argument, and then removed. If no attribute is found, no action is taken.
the attribute removed, or nil if this Element
did not contain a matching attribute
e = Element.new('E') e.add_attribute( 'name', 'Sean' ) #-> <E name='Sean'/> r = e.add_attribute( 'sur:name', 'Russell' ) #-> <E name='Sean' sur:name='Russell'/> e.delete_attribute( 'name' ) #-> <E sur:name='Russell'/> e.delete_attribute( r ) #-> <E/>
Removes multiple elements. Filters for Element
children, regardless of XPath
matching.
all elements matching this String
path are removed.
doc = Document.new '<a><c/><c/><c/><c/></a>' deleted = doc.elements.delete_all 'a/c' #-> [<c/>, <c/>, <c/>, <c/>]
Deletes all attributes matching a name. Namespaces are significant.
A String
; all attributes that match this path will be removed
an Array
of the Attributes
that were removed
Creates a Rinda::Tuple
for ary
.
Removes dead tuples.
Set
@@default_parser to new_value if it is one of the available parsers. Else raise NotValidXMLParser
error.
return the tag_names for setters associated with uri