Class: ROXML::XML::Node

Inherits:
Object show all
Includes:
NamespacedSearch
Defined in:
lib/roxml/xml/rexml.rb,
lib/roxml/xml/libxml.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.new_cdata(content) ⇒ Object



10
11
12
# File 'lib/roxml/xml/rexml.rb', line 10

def new_cdata(content)
  REXML::CData.new(content)
end

.new_element(name) ⇒ Object



14
15
16
17
# File 'lib/roxml/xml/rexml.rb', line 14

def new_element(name)
  name = name.id2name if name.is_a? Symbol
  REXML::Element.new(name)
end

Instance Method Details

#==(other) ⇒ Object



34
35
36
# File 'lib/roxml/xml/rexml.rb', line 34

def ==(other)
  to_s == other.to_s
end

#child_add(element) ⇒ Object



26
27
28
29
30
31
32
# File 'lib/roxml/xml/rexml.rb', line 26

def child_add(element)
  if element.is_a?(REXML::CData)
    REXML::CData.new(element, true, self)
  else
    add_element(element)
  end
end

#search(xpath) ⇒ Object



22
23
24
# File 'lib/roxml/xml/rexml.rb', line 22

def search(xpath)
  REXML::XPath.match(self, xpath)
end