class FlameChannelParser::XMLParser

Public Instance Methods

parse(io) click to toggle source

Parses the setup passed in the IO. If a block is given to the method it will yield Channel objects one by one instead of accumulating them into an array (useful for big setups)

Calls superclass method FlameChannelParser::Parser#parse
# File lib/xml_parser.rb, line 76
def parse(io)
  # Ok this is gothic BUT needed. What we do is we transform the XML setup into the OLD
  # setup format, after which we run it through the OLD parser all the same.
  # I am almost sure that ADSK does the same.
  t = Tempfile.new("bx")
  REXML::Document.parse_stream(io, XMLToSetup.new(t))
  t.rewind
  if block_given?
    super(t, &Proc.new)
  else
    super(t)
  end
end