Hi,

I�m trying to write a binding that uses the
org.jibx.extras.TypedArrayMapper to
marshall/unmarshall an array of objects.  The binding
compiles OK when having the binding defined like this:

<binding>
        <mapping class="jibxtest.Person" name="person"
ordered="false" >
                <value name="personNumber"              field="personNumber"
usage="optional"/>
                <structure field="adresses"     usage="optional"/>
        </mapping>
        
        <mapping class="jibxtest.Adress"  abstract="true"
ordered="false" >
                <value name="number"    field="number" 
usage="optional"/>
        </mapping>
        
        <mapping class="jibxtest.Adress[]" name="adresses"
marshaller="org.jibx.extras.TypedArrayMapper"
unmarshaller="org.jibx.extras.TypedArrayMapper" />
        
        <mapping class="jibxtest.SubAdress"  name="subAdress"
 ordered="false" extends="jibxtest.Adress">
                <structure map-as="jibxtest.Adress"
usage="optional"/>
                <value name="number"    field="subNumber" 
usage="optional"/>
        </mapping>
</binding>

While Adress is an superclass of subAdress and the
Person contains an Array of adresses. At rutime I add
subAdress objects to the Adrdess Array. Marshalling
works but when I unmarshall the following xml:

<?xml version="1.0" encoding="UTF-8"?>
<person>
    <personNumber>personNumber</personNumber>
    <subAdress>
         <number>4</number>
         <number>subNumber1</number>
    </subAdress>
</person>

I get an the following exception:
org.jibx.runtime.JiBXException: Expected end tag,
found start tag "number" 

Unmarshalling works too when I add <addresses> tags
around the <subadress> by hand - but this is not a
solution!

does anyone have experience with the TypedArrayMapper
and is able to help?



                
_______________________________
Do you Yahoo!?
Express yourself with Y! Messenger! Free. Download now. 
http://messenger.yahoo.com


-------------------------------------------------------
This SF.Net email is sponsored by BEA Weblogic Workshop
FREE Java Enterprise J2EE developer tools!
Get your free copy of BEA WebLogic Workshop 8.1 today.
http://ads.osdn.com/?ad_id=5047&alloc_id=10808&op=click
_______________________________________________
jibx-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to