Module: XmlMapper::AnonymousMapper

Included in:
XmlMapper
Defined in:
lib/xmlmapper/anonymous_mapper.rb

Instance Method Summary collapse

Instance Method Details

#parse(xml_content) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
# File 'lib/xmlmapper/anonymous_mapper.rb', line 4

def parse(xml_content)

  # TODO: this should be able to handle all the types of functionality that parse is able
  #   to handle which includes the text, xml document, node, fragment, etc.
  xml = Nokogiri::XML(xml_content)

  xmlmapper_class = create_xmlmapper_class_with_element(xml.root)

  # With all the elements and attributes defined on the class it is time
  # for the class to actually use the normal XmlMapper powers to parse
  # the content. At this point this code is utilizing all of the existing
  # code implemented for parsing.
  xmlmapper_class.parse(xml_content, :single => true)

end