Hi Arnaud, sounds good. I'm just wondering if you are refering to the same part of the problem I feel is wrong: I think the main error happens during marshalling -CASTOR should not instert the xsi stuff at all. I don't know if unmarshalling introduces some more problems when it sees the xsi attributes but if it does I see that as a second issue. Can you confirm that the fix would be for the first issue ?
Bye, Laslo -----Original Message----- From: Arnaud Blandin [mailto:[EMAIL PROTECTED]] Sent: Thursday, November 29, 2001 8:33 PM To: [EMAIL PROTECTED] Subject: Re: [castor-dev] xsd:string becomes java:java.lang.String when marshalling element with "enumeration" contents Hi Laslo, some code have been introduced to change the behavior of 'xsi:type', Sebastien is working on a fix and clean solution so it might fix this problem. The code may appear in one or 2 weeks in the CVS, Sorry for the inconvenience, Arnaud -> -----Original Message----- -> From: BEDNARIK,LASLO (HP-Germany,ex1) [mailto:[EMAIL PROTECTED]] -> Sent: Thursday, November 29, 2001 10:33 AM -> To: [EMAIL PROTECTED] -> Subject: [castor-dev] xsd:string becomes java:java.lang.String when -> marshalling element with "enumeration" contents -> -> -> Hi, -> -> I face the problem that when I unmarshall an element whose type is -> "xsd:string" with a -> restriction to enumerated values Castor inserts some "xsi" attributes for -> this element. -> -> On the other hand everything seems to be fine for attributes of the same -> type. -> -> This occurs using classes generated by the SourceGenerator (CVS snapshot -> Nov 14th) and JDK 1.2.2. -> -> Here is my schema and the output of CASTOR marshalling of a tree of Java -> objects - -> note that when I try to unmarshal the output of marshal() I get an error -> because of the -> xsi stuff ! : -> -> ----------------------------------------------------------------- -> ----------- -> --------------------- -> <?xml version = "1.0" encoding = "UTF-8"?> -> <xsd:schema -> xmlns:xsd="http://www.w3.org/2001/XMLSchema" -> xmlns:msg="http://www.bednarik.com/test" -> xmlns="http://www.bednarik.com/test" -> targetNamespace="http://www.bednarik.com/test" -> elementFormDefault="unqualified" > -> -> <xsd:element name="Main"> -> <xsd:complexType> -> <xsd:sequence> -> <xsd:element ref="EnumeratedElement" /> -> <xsd:element ref="ElementWithEnumeratedAttribute" /> -> </xsd:sequence> -> </xsd:complexType> -> </xsd:element> -> -> <xsd:element name="EnumeratedElement" > -> <xsd:simpleType> -> <xsd:restriction base="xsd:string"> -> <xsd:enumeration value="yes" /> -> <xsd:enumeration value="no" /> -> </xsd:restriction> -> </xsd:simpleType> -> </xsd:element> -> -> <xsd:element name="ElementWithEnumeratedAttribute" > -> <xsd:complexType> -> <xsd:attribute name="flag"> -> <xsd:simpleType> -> <xsd:restriction base="xsd:string"> -> <xsd:enumeration value="yes" /> -> <xsd:enumeration value="no" /> -> </xsd:restriction> -> </xsd:simpleType> -> </xsd:attribute> -> </xsd:complexType> -> </xsd:element> -> -> ----------------------------------------------------------------- -> ----------- -> --------------------- -> <?xml version="1.0"?> -> <test:Main xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" -> xmlns:test="http://www.bednarik.com/test"> -> <test:EnumeratedElement -> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" -> xsi:type="java:java.lang.String">yes</test:EnumeratedElement> -> <test:ElementWithEnumeratedAttribute flag="no"/> -> </test:Main> -> ----------------------------------------------------------------- -> ----------- -> --------------------- -> Error from unmarshal(): -> -> org.xml.sax.SAXException: unable to instantiate java.lang.String; -> org.xml.sax.SA -> XException: class java.lang.String is not a subclass of class -> com.hp.es.xml.test -> .types.EnumeratedElementType -> -> ----------------------------------------------------------- -> If you wish to unsubscribe from this mailing, send mail to -> [EMAIL PROTECTED] with a subject of: -> unsubscribe castor-dev ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev ----------------------------------------------------------- If you wish to unsubscribe from this mailing, send mail to [EMAIL PROTECTED] with a subject of: unsubscribe castor-dev