Hi Neil,

The "java:" + classname is a Castor specific feature...so if an XML
Schema name is available it is used instead to be compatible with the
XML Schema standard.

So the xsi:type="schema-type-name" is the "correct" approach.

If the schema-type-name is available and being used by the marshaller,
then it's probably a bug somewhere in the unmarshaller that is
preventing this from being unmarshalled properly.

Do you have an example you can share with us as the current suite of
test cases is passing properly.

Thanks,

--Keith

Neil Rotstan wrote:
> 
> I'm using the source generator to generate my data classes from XML
> schemas, and I have a case where I want to use different data-class
> implementations for a particular element which can also include their
> own implementation-specific subelements. While stuff marshals correctly,
> I've run into problems with the unmarshalling when I use the class
> descriptors (introspection works fine), namely because Castor can't
> locate the correct implementation-specific descriptor class based on the
> xsi:type specified in the marshalled XML.
> 
> After poking around a bit, I noticed that in
> org.exolab.castor.xml.Marshaller around line 1194, when it generates the
> xsi:type attribute, it will use the xml-name from the descriptor if the
> descriptor is not being introspected, rather than the class name. So
> instead of xsi:type="java:org.mypackage.MyClass" it ends up instead
> generating xsi:type="MyClass". In my case, at least, this results in
> Castor not being able to locate the proper descriptor class when I
> unmarshal the XML.
> 
> My question is whether this is a bug, or if there's something I'm
> supposed to be doing to control that XML name through my binding file or
> something so that it comes out correctly. I actually modified the
> Marshaller on my machine to always use the class name, and that fixed my
> problem. But I don't know if there are other ramifications or a better
> way to go about this.
> 
> Thanks for the help,
> Neil
> 
> -----------------------------------------------------------
> 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

Reply via email to