module Mysql2xxxx class XML < Writer def escaped_keys @escaped_keys ||= keys.map { |k| k.to_xs } end # sabshere 2/10/11 dkastner pointed out that this doesn't include metadata like later versions of mysql do # this matches the xml generated by "mysql --xml" # i tried to use builder, but the String#to_xs nonsense got in the way def to_file(f) f.write %{} f.write %{} stream_arrays do |ary| f.write %{} ary.each_with_index do |v, i| f.write %{#{v.to_s.to_xs}} end f.write %{} end f.write %{} nil end end end