DataObject assigned into open property goes missing
---------------------------------------------------

                 Key: TUSCANY-980
                 URL: http://issues.apache.org/jira/browse/TUSCANY-980
             Project: Tuscany
          Issue Type: Bug
          Components: C++ SDO
    Affects Versions: Cpp-current
            Reporter: Caroline Maynard


I have a schema like so:
<schema  
  xmlns="http://www.w3.org/2001/XMLSchema";>
  
  <element name="jungle">
    <complexType>
      <sequence>
        <any minOccurs="0" maxOccurs="unbounded"/>
      </sequence>
    </complexType>
  </element>
  
  <element name="mixedJungle">
    <complexType mixed="true">
      <sequence>
        <any minOccurs="0" maxOccurs="unbounded"/>
      </sequence>
    </complexType>
  </element>
  
</schema>

and another one like so:

<schema xmlns="http://www.w3.org/2001/XMLSchema";>

   <complexType name="snakeType">
     <sequence>
       <element name= "name" type="string"/>
       <element name= "length" type="positiveInteger" />
     </sequence>
   </complexType>

   <complexType name="bearType">
     <sequence>
       <element name= "name" type="string"/>
       <element name= "weight" type="positiveInteger" />
     </sequence>
   </complexType>

   <complexType name="pantherType">
     <sequence>
       <element name= "name" type="string"/>
       <element name= "colour" type="string" />
     </sequence>
   </complexType>

</schema>

Now suppose I load BOTH schemas into the same DataFactory, create a document 
with root type jungle, create some animal types and then assign them into the 
jungle. When I save the document, I see:

<?xml version="1.0" encoding="UTF-8"?>
<jungle xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  <bear xsi:type="bearType">
    <name>Baloo</name>
    <weight>700</weight>
  </bear>
  <panther xsi:type="pantherType">
    <name>Bagheera</name>
    <colour>inky black</colour>
  </panther>
  <snake xsi:type="snakeType">
    <name>Kaa</name>
    <length>25</length>
  </snake>
</jungle>

This is good.

Now I change the example so that the two schemas are loaded into DIFFERENT Data 
Factories, and run the same test. The saved document is now:
<?xml version="1.0" encoding="UTF-8"?>
<jungle xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
  <bear xsi:type="bearType" name="Baloo" weight="700"/>
  <panther xsi:type="pantherType" name="Bagheera" colour="inky black"/>
  <snake xsi:type="snakeType" name="Kaa" length="25"/>
</jungle>

so the elements have turned into attributes. 

Finally, I change the test so that the document root is a mixedJungle instead 
of a jungle, that is, it is sequenced. No errors are reported, but my document 
comes out as:
<?xml version="1.0" encoding="UTF-8"?>
<mixedJungle xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"/>

Now the animals are completely missing. The outcome is the same regardless of 
whether I use one or two data factories, btw. 

I am at revision 483149, so should have all the latest fixes.

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