Class: XMLScan::XPath::DOM::ElementNodeAdapter

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

Instance Attribute Summary

Attributes inherited from AbstractNodeAdapter

#node

Instance Method Summary collapse

Methods inherited from ParentNodeAdapter

#string_value

Methods inherited from AbstractNodeAdapter

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

Instance Method Details

#attributesObject



162
163
164
165
166
167
168
169
170
171
# File 'lib/xml/dom2/xpath.rb', line 162

def attributes
  map = @node.attributes
  attrs = @visitor.get_attributes(@node)
  unless attrs then
    attrs = []
    map.length.times { |i| attrs.push map.item(i) }
    @visitor.regist_attributes @node, attrs
  end
  attrs
end

#name_localpartObject



150
151
152
# File 'lib/xml/dom2/xpath.rb', line 150

def name_localpart
  @node.nodeName
end

#namespace_uriObject



154
155
156
# File 'lib/xml/dom2/xpath.rb', line 154

def namespace_uri
  @node.namespaceURI
end

#node_typeObject



146
147
148
# File 'lib/xml/dom2/xpath.rb', line 146

def node_type
  :element
end

#qualified_nameObject



158
159
160
# File 'lib/xml/dom2/xpath.rb', line 158

def qualified_name
  @node.nodeName
end

#wrap(node, visitor) ⇒ Object



140
141
142
143
144
# File 'lib/xml/dom2/xpath.rb', line 140

def wrap(node, visitor)
  @node = node
  @visitor = visitor
  self
end