public Method

Element.next_element

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</b><c></c></a>'
doc.root.elements['b'].next_element          #-> <c>
doc.root.elements['c'].next_element          #-> nil</c>

Source Code

# File rexml/element.rb, line 409
def next_element
  element = next_sibling
  element = element.next_sibling until element.nil? or element.kind_of? Element 
  return element
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.