XmlMarkup gives 2 root elements

Hi there,

I try to check out what’s the best way to create a small XML File (need
it for a bank transfer)

Anyway: I try the following under the ruby console:

require ‘builder’
x = Builder::XmlMarkup.new
x.instruct!
test = x.Hello(“World!”, “type” => “global”)

What I receive in test is the following:

<?xml version=\"1.0\" encoding=\"UTF-8\"?> World!"

So how can I get rid of the element. I think this file is A
BIT against the W3C XML standard.

Thanks for any advices,

Holm

On Jan 19, 2012, at 7:08 PM, Holm D. wrote:

test = x.Hello(“World!”, “type” => “global”)
Thanks for any advices,

Holm

Try it without irb. Standard IRB automatically calls “inspect” on the
builder object after each line which adds the “inspect” element ;).

Regards,
Florian

Florian G. wrote in post #1041686:

On Jan 19, 2012, at 7:08 PM, Holm D. wrote:

test = x.Hello(“World!”, “type” => “global”)
Thanks for any advices,

Holm

Try it without irb. Standard IRB automatically calls “inspect” on the
builder object after each line which adds the “inspect” element ;).

Regards,
Florian

Hi Florian,

f.ck. Thanks!!! Yesterday it took me about 2 hours to search in Google.

But now I know it forever.

Bye,

Holm