You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tuscany.apache.org by kelvin goodson <ke...@gmail.com> on 2007/07/02 22:33:52 UTC

Re: How does one specify a Property as containment property in XML Schema?

Hi,
  this doesn't add up --- shipTo should be a containment Property.  Can you
post the whole schema/test code please? Attachments will be stripped from
the list,  so please copy inline into the email.
Regards, Kelvin.


On 02/07/07, Pinaki Poddar <pp...@bea.com> wrote:
>
> Hello,
>
> How does one specify a Property as containment property in XML Schema?
>
>
> I was trying a simple example with a XML Schema (po.xsd) that had the
> following snippet:
>
>    <xsd:complexType name="PurchaseOrderType">
>        <xsd:sequence>
>            <xsd:element name="shipTo" type="USAddress"/>
>
> XSDHelper.INSTANCE.define(...) works fine to construct the types from
> po.xsd.
>
> However when the following is executed:
>
> 01: DataObject purchaseOrder =
> DataFactory.INSTANCE.create("http://www.example.com/PO",
> "PurchaseOrderType");
> 02: DataObject shipTo = purchaseOrder.createDataObject("shipTo");
>
> It fails with
> java.lang.IllegalArgumentException: The property 'shipTo' of
> 'PurchaseOrderType' isn't a containment
>        at
> org.apache.tuscany.sdo.util.DataObjectUtil.createDataObject(DataObjectUt
> il.java:421)
>        at
> org.apache.tuscany.sdo.util.DataObjectUtil.createDataObject(DataObjectUt
> il.java:467)
>        at
> org.apache.tuscany.sdo.impl.DataObjectImpl.createDataObject(DataObjectIm
> pl.java:1195)
>        at test.TestModel.testInstance(TestModel.java:41)
>
> I am using tuscany-sdo-impl-1.0-incubating-beta1.jar.
>
>
> Pinaki Poddar
> 972.834.2865
>
>
> Notice:  This email message, together with any attachments, may contain
> information  of  BEA Systems,  Inc.,  its subsidiaries  and  affiliated
> entities,  that may be confidential,  proprietary,  copyrighted  and/or
> legally privileged, and is intended solely for the use of the individual or
> entity named in this message. If you are not the intended recipient, and
> have received this message in error, please immediately return this by email
> and then delete it.