Custom XML Builder element needed

Hi all,

This may seem like a bit of a stupid question, I'm building an xml request to be sent over https to a service provider, but according to their specification, which doesn't seem to work with the rails xmlbuilder and rxml templates, what I need is a way to create elements containing a hyphen in the name, like <access-code>xxxxx</access-code> but I can't figure our how to do it because ruby treats it differently, this is my code:

# request.rxml xml.instruct! :xml, :version=>"1.0", :encoding => "UTF-8" xml.message {   xml.access {       xml.access-code(@access_code)       xml.access-pwd(@access_pass)   } }

which of course doesn't work because 'code' and 'pwd' are then treated as a separate methods and are not transfered to the method_missing handler in xmlbuilder.

Is there any workaround to this?

The Cool Web Guy wrote:

# request.rxml xml.instruct! :xml, :version=>"1.0", :encoding => "UTF-8" xml.message {   xml.access {       xml.access-code(@access_code)       xml.access-pwd(@access_pass)   } }

which of course doesn't work because 'code' and 'pwd' are then treated as a separate methods and are not transfered to the method_missing handler in xmlbuilder.

Is there any workaround to this?

According to the Builder-docs tag! should work:

http://builder.rubyforge.org/classes/Builder/XmlBase.html#M000006