You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by "Frank Budinsky (JIRA)" <tu...@ws.apache.org> on 2006/04/28 18:24:39 UTC

[jira] Commented: (TUSCANY-241) XMLHelper.load() cannot handle the global element with simple type

    [ http://issues.apache.org/jira/browse/TUSCANY-241?page=comments#action_12376964 ] 

Frank Budinsky commented on TUSCANY-241:
----------------------------------------

Raymond, you're right that this is a hole in the SDO spec.

I can easily fix the load problem by returning the EMF DocumentRoot object (as a DataObject) in this case. Then you would be able to get at the actual root object by doing something like this:

      XMLDocument document = XMLHelper.INSTANCE.load(...);
      DataObject root = document.getRootObject();
      Sequence seq = root.get(0)); // get the "mixed" feature
      // actual root is the first entry in this sequence.

This is a workaround for the load case, but we still don't have a way to create a document like this. Do you need that also?

I'll try to get some feedback on this issue from the spec group and then try to provide a workaround/fix that makes the most sense.

Frank.


> XMLHelper.load() cannot handle the global element with simple type
> ------------------------------------------------------------------
>
>          Key: TUSCANY-241
>          URL: http://issues.apache.org/jira/browse/TUSCANY-241
>      Project: Tuscany
>         Type: Bug

>   Components: Java SDO Implementation
>     Reporter: Raymond Feng
>     Priority: Blocker

>
> I think it's design hole in the SDO spec. The root object of a valid XMLDocument can be a simple type instead of DataObject.
> I have a very simple XSD:
> <xsd:schema targetNamespace="http://www.example.org/creditscore/doclit/" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
> 	<xsd:element name="getCreditScoreResponse" type="xsd:int"/>
> </xsd:schema>
> And an XML document:
> <getCreditScoreResponse xmlns="http://www.example.org/creditscore/doclit/">700</getCreditScoreResponse>
> I use the following code to load the XML document:
> XMLHelper xmlHelper;
> XMLDocument document = xmlHelper.load(...);
> Object root = document.getRootObject();
> Then I got the ClassCastException as follows.
> java.lang.ClassCastException: org.eclipse.emf.ecore.impl.EStringToStringMapEntryImpl incompatible with commonj.sdo.DataObject
> 	at org.apache.tuscany.sdo.helper.XMLDocumentImpl.getRootObject(XMLDocumentImpl.java:275)

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira