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

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

Someone has to load the schema before the XML can be loaded "correctly".
What I mean "correctly" is the loaded instance is THE schema's instance, NOT 
anyType instance.

I don't think SDO spec has defined such behavior that schema will be LOCATED 
AND loaded automatically by SDO.
Before you manage the spec changed if you ever want to, it seems to me only 2 
potential ways out of the problem so far:
2-1. User/You loads the schema before loading XML
2-2. SCA loads the schema automatically (from WSDL) for users/you

Neither of the potential solutions so far seems specific to "Java SDO 
Implementation".
We may want to change the issue compoenent to SCA if 2-2 is preferred,
otherwise close the issue as "usage error".

Thanks.

> 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


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

Reply via email to