| Module | REXML::Node |
| In: |
|
Represents a node in the tree. Nodes are never encountered except as superclasses of other objects. Nodes have siblings.
Public Instance methods
Visit all subnodes of self recursively
42: def each_recursive(&block) # :yields: node 43: self.elements.each {|node| 44: block.call(node) 45: node.each_recursive(&block) 46: } 47: end
27: def indent to, ind 28: if @parent and @parent.context and not @parent.context[:indentstyle].nil? then 29: indentstyle = @parent.context[:indentstyle] 30: else 31: indentstyle = ' ' 32: end 33: to << indentstyle*ind unless ind<1 34: end
Returns the index that self has in its parent’s elements array, so that the following equation holds true:
node == node.parent.elements[node.index_in_parent]
62: def index_in_parent 63: parent.index(self)+1 64: end
@return the next sibling (nil if unset)
8: def next_sibling_node 9: return nil if @parent.nil? 10: @parent[ @parent.index(self) + 1 ] 11: end