T
ted
Hi,
I'm trying to print out some xml and don't know what I'm doing. I'm getting
this <to_s/> tag in the output. Where is it coming from and how do I get rid
of it. Here's my test code. Any help appreciated.
CODE:
require "builder"
class Fruit
attr_accessor :name
end
fruit = Fruit.new()
fruit.name = "Apple"
xml = Builder::XmlMarkup.newindent=>2)
xml.fruit do
xml.name(fruit.name)
end
f = File.new("test.xml", "w")
f.print(xml)
OUTPUT:
<fruit>
<name>Apple</name>
</fruit>
<to_s/>
Thanks,
Ted
I'm trying to print out some xml and don't know what I'm doing. I'm getting
this <to_s/> tag in the output. Where is it coming from and how do I get rid
of it. Here's my test code. Any help appreciated.
CODE:
require "builder"
class Fruit
attr_accessor :name
end
fruit = Fruit.new()
fruit.name = "Apple"
xml = Builder::XmlMarkup.newindent=>2)
xml.fruit do
xml.name(fruit.name)
end
f = File.new("test.xml", "w")
f.print(xml)
OUTPUT:
<fruit>
<name>Apple</name>
</fruit>
<to_s/>
Thanks,
Ted