You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@tuscany.apache.org by Blue Diamond <gv...@gmail.com> on 2011/07/21 11:05:28 UTC

[URGENT] Problem converting from XML to DataObject when "xsi:type" attribute is not available

Hi all,

When I create an SDO & then convert it to XML string or DOM Node, I see that
there is an attribute "xsi:type" in the root element.

*<myns:EntityID xsi:type="myns:EntityID" xmlns:myns="http://my.com/myns"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>*

I do the conversion to SDO using the following code:

XMLHelper xmlHelper = helperContext.getXMLHelper();
XMLDocument xmlDoc = xmlHelper.load(new DOMSource(xmlNode), null, null);
return xmlDoc.getRootObject();

Now, when I try to convert the following XML to SDO,

*<myns:EntityID xmlns:myns="http://my.com/myns"/>*

I get this exception:
*Caused by: org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature
'EntityID' not found. (http:///temp.xml, -1, -1)&#xd;*

All my types are loaded. The only difference is the missing attribute
"xsi:type".

I am sure SDO should be able to convert any schema compliant XML type to
SDO. What am I missing in this conversion?

Thanks & Regards,
Anil