class REXML::Element
def each_element_with_attribute( key, value=nil, max=0, name=nil, &block ) # :yields: Element
Output:
a.each_element_with_attribute('id', '1', 2, '//d') {|e| p e }
and also match the given +xpath+:
that meet the first three criteria,
calls the block with only those child elements
With all arguments given, including +xpath+,
Output:
a.each_element_with_attribute('id', '1', 1) {|e| p e }
calls the block with at most +max+ child elements:
With arguments +attr_name+, +value+, and integer argument +max+ given,
Output:
a.each_element_with_attribute('id', '1') {|e| p e }
with that value:
calls the block with each child element that has that attribute
With argument +attr_name+ and string argument +value+ given,
Output:
a.each_element_with_attribute('id') {|e| p e }
a = d.root
d = REXML::Document.new '
calls the block with each child element that has that attribute:
When only string argument +attr_name+ is given,
Calls the given block with each child element that meets given criteria.
each_element_with_attribute(attr_name, value = nil, max = 0, xpath = nil) {|e| ... }
:call-seq:
def each_element_with_attribute( key, value=nil, max=0, name=nil, &block ) # :yields: Element each_with_something( proc {|child| if value.nil? child.attributes[key] != nil else child.attributes[key]==value end }, max, name, &block ) end