Class: XMLScan::XPath::DOM::AbstractNodeAdapter
- Inherits:
-
NullNodeAdapter
- Object
- NullNodeAdapter
- XMLScan::XPath::DOM::AbstractNodeAdapter
show all
- Defined in:
- lib/xml/dom2/xpath.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Instance Attribute Details
#node ⇒ Object
Returns the value of attribute node.
28
29
30
|
# File 'lib/xml/dom2/xpath.rb', line 28
def node
@node
end
|
Instance Method Details
#children ⇒ Object
38
39
40
|
# File 'lib/xml/dom2/xpath.rb', line 38
def children
@node.childNodes.to_a
end
|
#each_following_siblings ⇒ Object
42
43
44
45
|
# File 'lib/xml/dom2/xpath.rb', line 42
def each_following_siblings
node = @node
yield node while node = node.nextSibling
end
|
#each_preceding_siblings ⇒ Object
47
48
49
50
|
# File 'lib/xml/dom2/xpath.rb', line 47
def each_preceding_siblings
node = @node
yield node while node = node.previousSibling
end
|
#index ⇒ Object
52
53
54
|
# File 'lib/xml/dom2/xpath.rb', line 52
def index
@node.parentNode.childNodes.to_a.index(@node)
end
|
#lang ⇒ Object
56
57
58
59
60
61
62
63
|
# File 'lib/xml/dom2/xpath.rb', line 56
def lang
node = @node
lang = nil
until a = node.attributes and lang = a.getNamedItem('xml:lang')
node = node.parentNode
end
lang and lang.nodeValue
end
|
#parent ⇒ Object
34
35
36
|
# File 'lib/xml/dom2/xpath.rb', line 34
def parent
@node.parentNode
end
|
#root ⇒ Object
30
31
32
|
# File 'lib/xml/dom2/xpath.rb', line 30
def root
@node.ownerDocument
end
|
#wrap(node, visitor) ⇒ Object
23
24
25
26
|
# File 'lib/xml/dom2/xpath.rb', line 23
def wrap(node, visitor)
@node = node
self
end
|