Class: XMLScan::XPath::DOM::ParentNodeAdapter

Inherits:
AbstractNodeAdapter show all
Defined in:
lib/xml/dom2/xpath.rb

Direct Known Subclasses

ElementNodeAdapter, RootNodeAdapter

Instance Attribute Summary

Attributes inherited from AbstractNodeAdapter

#node

Instance Method Summary collapse

Methods inherited from AbstractNodeAdapter

#children, #each_following_siblings, #each_preceding_siblings, #index, #lang, #parent, #root, #wrap

Instance Method Details

#string_valueObject



109
110
111
112
113
114
115
116
117
118
# File 'lib/xml/dom2/xpath.rb', line 109

def string_value
  dst = ''
  stack = @node.childNodes.to_a.reverse
  while node = stack.pop
    s = node.nodeValue
    dst << s if s
    stack.concat node.childNodes.to_a.reverse
  end
  dst
end