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')
Search through the page for path under namespace using Nokogiri’s at. The path may be either a CSS or XPath expression.
See also Nokogiri::XML::Node#at
# File lib/mechanize/xml_file.rb, line 46 def_delegator :xml, :at, :at
Search for paths in the page using Nokogiri’s search. The paths can be XPath or CSS and an optional Hash of namespaces may be appended.
See Nokogiri::XML::Node#search for further details.
# File lib/mechanize/xml_file.rb, line 36 def_delegator :xml, :search, :search
Generated with the Darkfish Rdoc Generator 2.