[ 
http://issues.apache.org/jira/browse/TUSCANY-444?page=comments#action_12456803 
] 
            
Pete Robbins commented on TUSCANY-444:
--------------------------------------

The spec states that when extending a simple type a property named "value" is 
created in the complex type to hold the value of the simple type. So in the 
above case you should see 

Type: ComplexTypeExtendingSimpleTypeType
Properties:
  name="AddedByExtension" type="string"
  name="value" type="tns:SimpleTypeWithNameType"

The code in SDOSchemaSax2Parser around line 1015 attempts to do this. 
Unfortunately the code checks for the base type being in the namespace 
"commonj.sdo" to decide if the base is a simple type. This test is wrong as in 
this case the simple type is called tns:SimpleTypeWithNameType.

To fix this is a little tricky as at this point in the parsing the 
SimpleTypeWithNameType may not yet have been defined. I think the logic to add 
the Property "value" should be moved in to XSDHelperImpl.cpp where the actual 
additions to the DataFactory take place. If we find something based on a type 
that is a DataType (not just checking for commonj namespace) then we add the 
"value" property at that point.

> ComplexTypeExtendingSimpleType
> ------------------------------
>
>                 Key: TUSCANY-444
>                 URL: http://issues.apache.org/jira/browse/TUSCANY-444
>             Project: Tuscany
>          Issue Type: Bug
>          Components: C++ SDO
>    Affects Versions: Cpp-current
>         Environment: Windows XP
>            Reporter: Simon Laws
>             Fix For: Cpp-current
>
>
>  The following xml input 
>  <ComplexTypeExtendingSimpleType AddedByExtension="AddedByExtensionAttribute" 
>  
>                                                                     
> xsi:type="tns:ComplexTypeExtendingSimpleTypeType">
>     ComplexTypeExtendingSimpeType
> </ComplexTypeExtendingSimpleType>
> With the following schema
>   <complexType name="ComplexTypeExtendingSimpleTypeType">
>     <simpleContent>
>       <extension base="tns:SimpleTypeWithNameType">
>               <attribute name="AddedByExtension" type="string"/>
>       </extension>
>     </simpleContent>  
>   </complexType>
> Causes the runtime to fail with the following:
> SDOIllegalArgumentException Cannot add a properties to data types: 
> ComplexTypeExtendingSimpleTypeTypeException
>       

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