public Method

XmlSimple.xml_in_string(string, options = nil)

Same as xml_in but doesn’t try to smartly shoot itself in the foot.

Source Code

# File active_support/core_ext/hash/conversions.rb, line 9
def xml_in_string(string, options = nil)
  handle_options('in', options)

  @doc = parse(string)
  result = collapse(@doc.root)

  if @options['keeproot']
    merge({}, @doc.root.name, result)
  else
    result
  end
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.