File: xml_file.rb [mechanize-2.7.3 Documentation]

Last Modified
  2015-08-17 12:05:55 +0000
Requires

## Description

This class encapsulates an XML file. If Mechanize finds a content-type of 'text/xml' or 'application/xml' this class will be instantiated and returned. This class also opens up the `search` and `at` methods available on the underlying Nokogiri::XML::Document object.

Example:

    require 'mechanize'

    agent = Mechanize.new
    xml = agent.get('http://example.org/some-xml-file.xml')
    xml.class #=> Mechanize::XmlFile
    xml.search('//foo[@attr="bar"]/etc')