From: Herbert Hurtig Date: 2012-01-11T04:13:13+09:00 Subject: [roxml] xmlns in root node Hi there, I'm a bit stuck with roxml (https://github.com/Empact/roxml). I've a webservice which wants me to send a REST-Request with the following body attr I mastered the REST-part, but found no way to get roxml to write out the xml-reprensentation the way I need it. I always get: attr when translating the object this way Object.to_xml.to_s I use the gem of roxml gem install roxml -v 3.2.1 the following input file attr and the following script require 'roxml' require 'pry' require 'pp' class User include ROXML #not needed but my real classes look like UserSimple etc. xml_name 'user' xml_namespace :ns2 #I also tried it this way #xml_namespaces :ns2 => 'http://foo.example.com' xml_accessor :attribute, :namespace => false end user = User.from_xml(File.read(File.expand_path('example-user.xml', File.dirname(__FILE__)))) pp user.to_xml.to_s Help would be very welcome, as I'm stuck in the moment and need the stuff working for my master thesis. Thanks. Cheers, Herbert -- Posted via http://www.ruby-forum.com/.