Here is the Java code that I am using to check the behavior.

        String xmlText = "<test:test xmlns:test=\"http://domain/test\";
xmlns:ext=\"http://domain/test/ext\";
xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\";><test:typeExtensions><test:extension
xsi:type=\"ext:testTypeClientExtension\"/></test:typeExtensions></test:test>";

        TestDocument test = (TestDocument) XmlObject.Factory.parse(xmlText);
        XmlObject testTypeExtension =
test.getTest().getTypeExtensions().getExtensionArray()[0];

        System.out.println("testTypeClientExtension.getClass().getName() - "
+ testTypeExtension.getClass().getName());

If I use anyType in the list in the xsd, the system out will display
TestTypeClientExtension as the class. If I use TestTypeExtension, it will
display TestTypeExtension. I want to get back an instance of the class based
on the xsi:type.

Thanks in advance for any help.
-- 
View this message in context: 
http://www.nabble.com/xsi%3Atype-and-Java-Class-tf4807282.html#a13754008
Sent from the Xml Beans - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to