Hi all,

 

The POJO that I want to unmarshal XML into contains additional fields that I want to populate with fixed values. When I try something like:

 

    <mapping name="SCANDTN" ordered="false" class="O_x_class" pre-set="clear_All">
        <value name="version" field="version_num" style="attribute" usage="optional"/>
        <value name="dummy1" field="eyecatcher" usage="optional" default="XMLReply"/>
            ...
        <value name="MSGID" field="message_id" usage="optional"/>
            ...
    </mapping>

 


where the ‘dummy1’ field is one of these fields (and ‘MSGID’ is a real, expected XML tag), the field (in this case ‘eyecatcher’) gets set to null and not the default that I want of ‘XMLReply’.

 

If I change the ‘ordered’ field to ‘true’ in <mapping> then in this case ‘eyecatcher’ does get set to ‘XMLReply’ which is what I want.

 

Is this expected behavior?  Is there a way to have an unordered set of XML tags and unmarshall them with default values (as I have no control over order of the XML tags the sender is creating)??

 

Thanks for any assistance.

 

My first use of the product and I am liking it a lot.

 

Reply via email to