Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] [MOXy] xml choice object mapping incompatible with preserve document option?

Hi Polly,

This is a known issue with the choice mappings. Currently the document preservation functionality is dependent (at least for marshalling) on the DOMPlatform, and the choice mappings aren't currently supported with the DOM platform. There's a bug tracking this issue already which you can view here:


amphoras wrote:


I am trying to use XML Choice Mapping to map a hierarchy of objects.  I find
that when I turn on the "preserve document" option, this mapping fails.  As
soon as I turn off the "preserve document" option, this mapping works fine. Is this a bug or are they incompatible for some reason? Or is it because of
the XML Any Collection Mapping that is also under the same element that is

Here is my XML for configuring the choice mapping.  Please let me know if
it's wrong, because the workbench does not generate this kind of mapping, so
I figured out the format by browsing the source code and hacking the mapping
until it worked.

           <attribute-mapping xsi:type="xml-choice-object-mapping">
                 <xml-field name="DataArea/A" xsi:type="node" />
                 <xml-field name="DataArea/B" xsi:type="node" />
                 <xml-field name="DataArea/C" xsi:type="node" />

Here's the any collection:
           <attribute-mapping xsi:type="xml-any-collection-mapping">
              <field name="DataArea/" xsi:type="node"/>
              <container xsi:type="list-container-policy">

Any insight would be greatly appreciated!


Back to the top