Module: VCDOM::MiniDOM::ModChildNode

Includes:
VCDOM::MiniDOM::ModParentNode::ParentNodeManageable
Included in:
CharacterData, Element
Defined in:
lib/vcdom/minidom/mod_child_node.rb

Instance Method Summary collapse

Instance Method Details

#init_mod_child_nodeObject



45
46
47
# File 'lib/vcdom/minidom/mod_child_node.rb', line 45

def init_mod_child_node()
  @parent_node = nil
end

#next_siblingObject

nextSibling of type Node, readonly

The node immediately following this node. If there is no such node, this returns null.


36
37
38
39
40
41
42
43
# File 'lib/vcdom/minidom/mod_child_node.rb', line 36

def next_sibling
  if ! @parent_node.nil? then
    if idx = @parent_node.get_index_of( self ) then
      return @parent_node.child_nodes.item( idx + 1 )
    end
  end
  return nil
end

#parent_nodeObject

parentNode of type Node, readonly

The parent of this node. 
All nodes, except Attr, Document, DocumentFragment, Entity, and Notation may 
have a parent. 
However, if a node has just been created and not yet added to the tree, 
or if it has been removed from the tree, this is null.


19
20
21
# File 'lib/vcdom/minidom/mod_child_node.rb', line 19

def parent_node
  return @parent_node
end

#previous_siblingObject

previousSibling of type Node, readonly

The node immediately preceding this node. 
If there is no such node, this returns null.


26
27
28
29
30
31
32
33
# File 'lib/vcdom/minidom/mod_child_node.rb', line 26

def previous_sibling
  if ! @parent_node.nil? then
    if idx = @parent_node.get_index_of( self ) then
      return @parent_node.child_nodes.item( idx - 1 )
    end
  end
  return nil
end