There are two problems with the following result of marshalling.

In that result, "more-visit-data" must have been derived from the
collection-variable named "moreVisitData" in class Visit; it appears as many
times as should instances of the element it contains in Java -- of type
AddVisitData; meanwhile, the elements of the contained type are not in an
element called AddVisitData; I found something elsewhere about setting
"container='false'" on the field-element in the config; I tried that; it
seemed to work, except that there was still a doubling of the output, with
the second instance of the whole message containing "xsi:type" and NOT
showing the beneficial effect of "container='false'".

The Visit class has these methods on it:

    public void setMoreVisitData(Set moreVisitData) {
        this.moreVisitData = moreVisitData;
    }

    public Set getMoreVisitData() {
        return moreVisitData;
    }


I've so far killed an entire day tried to solve this problem.  Any feedback
would be much appreciated.


=======================================================

<?xml version="1.0" encoding="UTF-8"?>

<Visit>

  <more-visit-data id="0">
    <enhanced-session-id>127.0.0.11174943003584</enhanced-session-id>
    <name>foo</name>
    <value>bar</value>
  </more-visit-data>

  <more-visit-data id="0">
    <enhanced-session-id>127.0.0.11174943003597</enhanced-session-id>
    <name>foo2</name>
    <value>bar2</value>
  </more-visit-data>

...

  <more-visit-data id="0" xsi:type="java:com.foo.beans.AddVisitData"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";>
    <enhanced-session-id>127.0.0.11174943003584</enhanced-session-id>
    <name>foo</name>
    <value>bar</value>
  </more-visit-data>

...

</Visit>


=======================================================

Here's the config for that:

        <class name="com.foo.beans.Visit" auto-complete="true">
                <map-to xml="Visit"/>

                <field name="MoreVisitData" 
type="com.classesusa.beans.AddVisitData"  collection="set"/>
        </class>
-- 
View this message in context: 
http://www.nabble.com/collection-var-name-misinterpreted-as-collection-element-type--hence-%27occurs-more-than-once%27--etc.-tf3470145.html#a9683630
Sent from the Castor - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe from this list please visit:

    http://xircles.codehaus.org/manage_email

Reply via email to