Details
Description
I get a "MarshalException: element "description" occurs more than once" when trying to unmarshal the following (apparently valid) XML fragment:
<item>
<description>One description</description>
<media:description>Another desc</media:description>
</item>
Attached is one Java class, the mapping file & the XML sample as a single zip file.
In order to run the test, add the following jars in the same directory: castor-1.1.2.1.jar, commons-logging.jar, xerces.jar.
You also may try to change the two fields declaration order in mapping.xml, and get another exception: "MarshalException: unable to find FieldDescriptor for 'description' in ClassDescriptor of item{File: ; line: 4; column: 21}"
Hope it will help.
I can confirm that I am getting the very same exceptions. I have tried to modify the given XML document instance to use an explicit namespace declaration as well as a default namespace declarations to qualify the remainder of the document - which does not change anything ..
.