Steven,

Steven J. Owens wrote:
or you can use the container attribute (goes in the field element in
the mapping file).  I'm assuming your Java class has an array or
List of Item objects that turn into the individual items in the XML.
If you set container="false" (and provide the correct bind-xml
name="Items") Castor will create the Items element for you.


     Interesting.  The container attribute isn't mentioned anywhere
in http://www.castor.org/xml-mapping.html


True and we've known about that for a while, and I apologize for not having that documentation updated sooner. The container attribute is quite talked about on the list however.


     I tried the obvious, the following in OrderMapping.xml:

        <field name="Item" type="com.foo.Item" container="true" 
collection="arraylist">
            <bind-xml name="Items"/>
        </field>

     This got me a java.lang.StackOverflowError.

You want to use container="false" here. You also want to make sure you have a mapping for class com.foo.Item such as:

<class name="com.foo.Item">
   <mapTo xml="item"/>
   ...
</class>

HTH,

--Keith


-------------------------------------------------
If you wish to unsubscribe from this list, please send an empty message to the following address:

[EMAIL PROTECTED]
-------------------------------------------------

Reply via email to