[ https://issues.apache.org/jira/browse/TUSCANY-505?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Jean-Sebastien Delfino resolved TUSCANY-505. -------------------------------------------- Resolution: Fixed This should now work with the changes we've made handle SDO registration in an SCA component. -If you're using static SDOs, then the SDO databinding will register them automatically in the HelperContext it uses to handle serialization/deserialization - If you're using dynamic SDOs, then the app developer is responsible for registering the XSDs he cares about in HelperContext.INSTANCE, in the init method of one of his components for example, or in his client code. Please reopen the JIRA if you can reproduce the issue again. > xsi:type on root element fo XML doc causes problems > --------------------------------------------------- > > Key: TUSCANY-505 > URL: https://issues.apache.org/jira/browse/TUSCANY-505 > Project: Tuscany > Issue Type: Bug > Components: Java SCA Core Runtime > Affects Versions: Java-SCA-M2 > Environment: Windows XP > Reporter: Simon Laws > Fix For: Java-SCA-Next > > > 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. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]