Module: XmlMini::Nokogiri::XPathFilter

Included in:
ActiveSupport::XmlMini_Nokogiri
Defined in:
lib/wrest/xml_mini/nokogiri/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 all elements that match the xpath



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

def filter(xml_body,xpath)
  doc = ::Nokogiri::XML(xml_body)
  doc.xpath(xpath).to_a 
end