Hi Peter,

This should work:

 <xsd:element name="content" type="xsd:anyType" minOccurs="0" 
maxOccurs="unbounded"/>

I think the problem is just a typo. Your declaration says 
maxOccurs="unbound"

Frank.


Peter Klotz <[EMAIL PROTECTED]> wrote on 03/17/2008 
02:49:03 PM:

> Hi,
> 
> I would like to define a attribute that is a list of other DataObjects 
of any
> type (non-primitive). I've tried to use a anonymous element without 
> name as any
> attribute of any type could go in here:
> 
>   <xsd:complexType name="content">
>     <xsd:sequence>
>       <xsd:element type="xsd:anyType" minOccurs="0" 
maxOccurs="unbound"/>
>     </xsd:sequence>
>   </xsd:complexType>
> 
> used somewhere as an element:
> 
>  <xsd:element name="content" type="content" minOccurs="0" 
maxOccurs="1"/>
> 
> 
> Result:
> 
> Caused by: java.lang.IllegalArgumentException
>         at
> 
org.apache.tuscany.sdo.helper.XSDHelperImpl.define(XSDHelperImpl.java:263)
>         at
> 
org.apache.tuscany.sdo.helper.XSDHelperImpl.define(XSDHelperImpl.java:224)
> 
> 
> Other options like setting the type of an element to xsd:anyType 
> instead of this
> "x:content"
> 
>  <xsd:element name="content" type="xsd:anyType" minOccurs="0" 
> maxOccurs="unbound"/>
> 
> or things like this
> 
> 
>   <xsd:complexType name="content">
>     <xsd:complexContent>
>       <xsd:restriction base="xsd:anyType">
>         <xsd:sequence/>
>       </xsd:restriction>
>     </xsd:complexContent>
>   </xsd:complexType>
> 
>  <xsd:element name="content" type="content" minOccurs="0" 
maxOccurs="1"/>
> 
> yield an ClassCastException on java.util.ArrayList on the statement
> 
> List<DataObject> mylist = ...
> dobj.setList("content", mylist);
> 
> where I try to set a attribute with a list of DataObjects.
> 
> 
> How to do this correctly in Tuscany?
> 
> I've debugged a bit but I'm getting lost in the EMF stuff :-(
> Note, that I can't set an attribute name for the element as there 
> could be many
> so in the end I need an any type anonymous element. Just want to 
> specify that it
> should be complex content.
> 
> 
> Thanks, Peter
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

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

Reply via email to