Module: XmlMini::LibXML::XPathFilter

Included in:
ActiveSupport::XmlMini_LibXML
Defined in:
lib/wrest/xml_mini/libxml/xpath_filter.rb

Instance Method Summary collapse

Instance Method Details

#filter(xml_body, xpath) ⇒ Object

Enables filtering of an xml response using a specified xpath Returns an array of elements matching the xpath



6
7
8
9
# File 'lib/wrest/xml_mini/libxml/xpath_filter.rb', line 6

def filter(xml_body,xpath)
  doc = ::LibXML::XML::Document.string(xml_body)
  doc.find(xpath).to_a
end