Method: Plist.parse_xml

Defined in:
lib/plist/parser.rb

.parse_xml(filename_or_xml, options = {}) ⇒ Object

Note that I don’t use these two elements much:

+ Date elements are returned as DateTime objects.
+ Data elements are implemented as Tempfiles

Plist.parse_xml will blow up if it encounters a Date element. If you encounter such an error, or if you have a Date element which can’t be parsed into a Time object, please create an issue attaching your plist file at github.com/patsplat/plist/issues so folks can implement the proper support.

By default, <data> will be assumed to be a marshaled Ruby object and interpreted with Marshal.load. Pass marshal: false to disable this behavior and return the raw binary data as an IO object instead.



34
35
36
37
38
39
40
# File 'lib/plist/parser.rb', line 34

def self.parse_xml(filename_or_xml, options={})
  listener = Listener.new(options)
  # parser = REXML::Parsers::StreamParser.new(File.new(filename), listener)
  parser = StreamParser.new(filename_or_xml, listener)
  parser.parse
  listener.result
end