-
Notifications
You must be signed in to change notification settings - Fork 177
Open
Description
Hi there,
how do I have to use roxml to get
xmlns:namespace=example.com
as parameter in root node when using
Object.to_xml.to_s
I tried to figure out how to do it by myself, but I didn't find a way to do it (I had a look at spec/namespaces).
I used the following input file (btw: this is how the output should look like)
<?xml version="1.0" encoding="UTF-8"?>
<ns2:user xmlns:ns2="http://foo.example.com">
<attribute>attr</attribute>
</ns2:user>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
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_sHelp would be very welcome, as I'm stuck in the moment and need the stuff working for my master thesis.
Thanks.
Cheers,
Max meyer
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels