Hi,

Thanks for your response. I have found the setSuppressXSIType method, but it doesn't work for my case.

public String marshall(Serializable obj) {
...
Writer writer = new StringWriter();
Marshaller m = new Marshaller(writer);
m.setSuppressXSIType(false);
m.marshal(obj);
...
}

I will try an other Castor version to check if it works.

Regards.

Olivier

Werner Guttmann wrote:
To be honest with you, I have got no idea. It's been a couple of years
ago that 0.9.5 was released, and since then, quite an effort has been
made to move towards 1.0.x. Why not switch to 1.0.3 and see whether
you're issue has been resolved by now.

Working towards 1.0.4 (next week), II and my colleagues have addressed
some odd 125 issues, some of which could not be reproduced anymore, some
of which have been fixed (~50).

Werner

Olivier Mocquais RD-BIZZ wrote:
Hello;

I have a Javabean (test.castor.MySimpleClass) and I want to marshall it
wih Castor 0.9.5.3.
The unmarhsall method works only if the attribute
xsi:type="java:test.castor.MySimpleClass" is added, but the marsall
method generates the xml file without the
xsi:type="java:test.castor.MySimpleClass" attribute.

the xml file:
<?xml version="1.0" encoding="UTF-8"?>
<vector xsi:type="java:java.util.Vector"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
   <my-simple-class xsi:type="java:test.castor.MySimpleClass"
primitive-float="87.363" primitive-double="37.266"
       primitive-integer="178" primitive-short="16"
       primitive-long="8864" primitive-byte="65"
       primitive-character="c" primitive-boolean="true">
       <object-long>8864</object-long>
       <object-short>16</object-short>
       <object-integer>178</object-integer>
       <object-byte>65</object-byte>
       <object-double>37.266</object-double>
       <object-string>MyDefaultString</object-string>
       <object-character>c</object-character>
       <object-boolean>true</object-boolean>
       <object-float>87.363</object-float>
   </my-simple-class>
</vector>

How can I add this attribute automatically ?

Thanks.

Olivier





---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email




---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email




---------------------------------------------------------------------
To unsubscribe from this list please visit:

   http://xircles.codehaus.org/manage_email

Reply via email to