I apologize if this has already been answered but I am having problems and a
search did help.   My problem is with what I would assume to be a simple
mapping exercise with one little hiccup.  The xml below works but I would
rather not have the <prop1> wrapper:

<item>
    <prop1>
         <id>49996-595959</id>
    </prop1>
    <otherProps>...</otherProps>
   ....
</item>

The preferred xml is:

<item>
    <id>49996-595959</id>
    <otherProps>...</otherProps>
   ....
</item>

Now, from the Castor documentation (http://www.castor.org/xml-mapping.html)
I thought this would be simply adding the container="false" attribute to the
field.  However, when I do that I get the "unable to find FieldDescriptor
for 'id' in ClassDescriptor of Item; nested exception is
org.exolab.castor.xml.MarshalException: unable to find FieldDescriptor for
'id' in ClassDescriptor of Item" exception that I have come to dread.

In my mind the setting to false seems to contradict the definition for
container that states "Indicates whether the field should be treated as a
container, i.e. only it's fields should be persisted, but not the containing
class itself. In this case, the container attribute should be set to true
(supported in Castor XML only)."  Setting container="true" gives the error
"The container object 'Prop1' cannot accept the child object associated with
the element 'id' because the container is already full!"  This way
recognizes the Prop1 class correctly but I am not sure as to the meaning of
the error.

Part of my issue stems from neither the XSD that I am adhering to or the
objects that I am mapping to were generated through Castor.  

I appreciate any suggestions that may be offered. 

Thank you in advance.

Michael Fischer
-- 
View this message in context: 
http://old.nabble.com/Remove-attribute-wrapper-tp28985551p28985551.html
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