OK, thanks for you investigative efforts guys. There seem to be two things
going on here.

1/ xsi:type on the root element causes problems (This JIRA). It may very
well be that SDO is not correctly configured by the SCA entry point code
that uses it to the extent that it works fine if there is no xsi:type but
fails it there is. It seems we should "promote" this to be an SCA problem so
that we can address what is up with Yang's 2-2 option. This is the code in
question in this case.

2/ C++/SDO doesn't use namespace prefixes where it probably (TBD) should
which also causes the server side java/SDO to fail. This is not Java/SDO's
fault though hence this is recorded in
http://issues.apache.org/jira/browse/TUSCANY-491.

Apollogies it I missclassified in the first instance.

Simon



On 6/29/06, Yang ZHONG (JIRA) <[email protected]> wrote:

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

Yang ZHONG commented on TUSCANY-505:
------------------------------------

We can take a close look at
    <getQuote xsi:type="getQuote" xmlns:xsi="
http://www.w3.org/2001/XMLSchema-instance";
                                  xmlns="
http://www.quickstockquote.com/StockQuoteService/";
                                  xmlns:tns="
http://www.quickstockquote.com/StockQuoteService/";>
      <symbol>IBM</symbol>
    </getQuote>

"xmlns=" means "getQuote" under "
http://www.quickstockquote.com/StockQuoteService/";,
I believe that conforms to Simon's XSD.

However, "xmlns=" also means "symbol" also under "
http://www.quickstockquote.com/StockQuoteService/";,
that's NOT conforming unless Simon's XSD explicitly defines "symbol"
GLOBAL element.

As expected, given a XSD without the GLOBAL element definition, "xmlns="
generates this exception to me:
    org.eclipse.emf.ecore.xmi.FeatureNotFoundException: Feature '...' not
found.

In a word, if not all elements are defined as GLOBAL element, "xmlns="
seems still "usage error".

> xsi:type on root element fo XML doc causes problems
> ---------------------------------------------------
>
>          Key: TUSCANY-505
>          URL: http://issues.apache.org/jira/browse/TUSCANY-505
>      Project: Tuscany
>         Type: Bug

>   Components: Java SDO Implementation
>     Versions: Java-M1
>  Environment: Windows XP
>     Reporter: Simon Laws

>
> If I read the following doc:
> <tns:RootElement xmlns:p="commonj.sdo"
>     xmlns:tns="http://www.apache.org/tuscany/interop";
>     xmlns:xsi=" http://www.w3.org/2001/XMLSchema-instance";
>     xsi:schemaLocation="http://www.apache.org/tuscany/interop
interop01.xsd">
>     <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
> </tns:RootElement>
> With the following schema
> <schema xmlns=" http://www.w3.org/2001/XMLSchema";
>         targetNamespace="http://www.apache.org/tuscany/interop";
>         xmlns:tns=" http://www.apache.org/tuscany/interop";>
>
>   <include schemaLocation="interop10.xsd"/>
>
>   <!-- top level test type -->
>   <complexType name="ComplexTypeRootType">
>     <sequence>
>       <!-- simple types -->
>       <element name="SimpleTypeWithName"
type="tns:SimpleTypeWithNameType"/>
>     </sequence>
>   </complexType>
>
>   <element name="RootElement" type="tns:ComplexTypeRootType"/>
> </schema>
> The I get a valid document (doc) with some data objects in it out of the
following code:
>         FileInputStream inFileStream = new FileInputStream (inFileName);
>         XMLDocument doc = XMLHelper.INSTANCE.load(inFileStream);
> If I try in read in (note I have added and xsi:type attribute):
> <tns:RootElement xmlns:p="commonj.sdo"
>     xsi:type="tns:ComplexTypeRootType"
>     xmlns:tns="http://www.apache.org/tuscany/interop "
>     xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
>     xsi:schemaLocation="http://www.apache.org/tuscany/interop
interop01.xsd">
>     <SimpleTypeWithName>SimpleTypeWithName</SimpleTypeWithName>
> </tns:RootElement>
> The XMLHelper silently makes an empty document, i.e. the root element is
null.
> I talked with Frank and he suggested changing the xsi:type to refer to a
type that extends the root element type. This produced the same effect,
i.e. and empty document. However xsi:type does seem to behave in both the
base type and extension type case when attached to elements other than the
root element.

--
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


Reply via email to