[prev in list] [next in list] [prev in thread] [next in thread] 

List:       tuscany-user
Subject:    [URGENT] Problem converting from XML to DataObject when "xsi:type"
From:       Blue Diamond <gvnanils () gmail ! com>
Date:       2011-07-21 9:17:28
Message-ID: CABg9Wu24QuwXJuaoL3ekAF9zjVOkyNs2Rdqor4rp0ckG2fXctA () mail ! gmail ! com
[Download RAW message or body]

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

[Attachment #3 (text/html)]

Hi all,<div><br></div><div>When I create an SDO &amp; then convert it to XML string \
or DOM Node, I see that there is an attribute &quot;xsi:type&quot; in the root \
element.</div><div><br></div><div><div><i>&lt;myns:EntityID \
xsi:type=&quot;myns:EntityID&quot; xmlns:myns=&quot;<a \
href="http://my.com/myns">http://my.com/myns</a>&quot; xmlns:xsi=&quot;<a \
href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>&quot;/&gt;</i></div>
 </div><div><br></div><div>I do the conversion to SDO using the following \
code:</div><div><div><br></div><div><span class="Apple-tab-span" style="white-space: \
pre; ">		</span>XMLHelper xmlHelper = helperContext.getXMLHelper();</div> <div><span \
class="Apple-tab-span" style="white-space: pre; ">		</span>XMLDocument xmlDoc = \
xmlHelper.load(new DOMSource(xmlNode), null, null);</div><div><span \
class="Apple-tab-span" style="white-space: pre; ">		</span>return \
xmlDoc.getRootObject();</div> </div><div><br></div><div>Now, when I try to convert \
the following XML to SDO,  </div><div><br></div><div><i>&lt;myns:EntityID \
xmlns:myns=&quot;<a href="http://my.com/myns">http://my.com/myns</a>&quot;/&gt;</i></div><div>
 <br></div><div>I get this exception:</div><div><b>Caused by: \
org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature &#39;EntityID&#39; not \
found. (http:///temp.xml, -1, -1)&amp;#xd;</b></div><div><br></div><div>All my types \
are loaded. The only difference is the missing attribute &quot;xsi:type&quot;.</div> \
<div><br></div><div>I am sure SDO should be able to convert any schema compliant XML \
type to SDO. What am I missing in this conversion?</div><div><br></div><div>Thanks \
&amp; Regards,</div><div>Anil</div><div><div><br></div> </div><div><br></div>



[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic