I've used the utility xsd2ruby utility provided with soap4r to generate the required classes from an XSD schema definition file. This works well, however when I try to generate an xml file using XSD::Mapping.obj2xml the attributes do not get created as I expect (or would like). I would like the following:
<obj attr1=value1 attr2=value2>
<element1>value</element1>
</obj>
but this is what gets generated:
<obj>
<__xmlattr>
<item>
<key>
<name>attr1</name>
<namespace></namespace>
<source></source>
</key>
<value>value1</value>
</item>
<item>
<key>
<name>attr2</name>
<namespace></namespace>
<source></source>
</key>
<value>value2</value>
</item>
</__xmlattr>
<element1>value</element1>
</obj>
How can I generate the XML output without the xmlattr?