Forum: Ruby Rexml Quoting control

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Pito S. (Guest)
on 2009-02-12 00:04
I'm generating a xml with Rexml. Pretty straightforward. I have a
question about quoting.

I would like this result (for example)

<outline type="rss" text="Ellen's House" Url="http://www.google.com"/>

But when I do the obvious:

>> x = Element.new("Outline")
>> x.add_attribute("text", "Ellen's house")
>> x.add_attribute("Url", "http://www.google.com")

>> x
=> <Outline Url='http://www.google.com' text='Ellen&apos;s house'/>

Note the quoting is using single quotes and & escapes. What I showed at
the top is also valid xml. How do I ask rexml to generate it?

If you know and can help it would be greatly appreciated!
This topic is locked and can not be replied to.