hi sowjanya,
You can use *flexible='true" and ordred="false"* atrributes for the mapping
and make sure that all chaild elements must be optinal and you should not
use collection elements.
if you want to use collection elemnets tou can use abstract mappings.
Regards,
venkat annangi
On 7/20/07, Janga, Sowjanya <[EMAIL PROTECTED]> wrote:
Hi,
Does anyone has any work around or solution(or a mistake in what I did)
for the following problem that has been eating me away since days.
I'am getting runtime errors when I try to unmarshal any extra elements
under a flexible structure.
The error is not even consistent. If the extra element happens to occur
somewhere after a defined element ex: after <street>, it goes in fine but
if the extra element happens to be the first element it gives Expected
"resAddress" end tag, found "extra-element" start tag
My Binding
<?xml version="1.0"?>
<binding track-source="true"
direction="input" >
<mapping name="person" class="jibxtest.Person"
ordered="false">
<value name="name" field="name"/>
<structure name="demographics"
ordered="false" flexible="true" usage=
"optional" >
<structure name="resAddress" field="resAddress"
map-as="Address"
usage="optional" ordered="false"
flexible="true" />
<structure name="officeAddress" field=
"officeAddress"
map-as="Address"
usage="optional" ordered="false"
flexible="true" />
</structure>
</mapping>
<mapping abstract="true" class="jibxtest.Address"
type-name="Address"
flexible="true" ordered="false">
<value field="street" name="street" usage="optional" />
<value field="zip" name="zip" usage="optional" />
<value field="city" name="city" usage="optional" />
</mapping>
</binding>
ex:
Input causing error
<person>
<name>Mark</name>
<demographics>
<resAddress>
<extra-element>JUNK</extra-element>
<street>123 Main Street</street>
<zip>12345</zip>
<city>San Jose</city>
</resAddress>
<officeAddress/>
</demographics>
</person>
Input that goes in fine.
<person>
<name>Mark</name>
<demographics>
<resAddress>
<street>123 Main Street</street>
<extra-element>JUNK</extra-element>
<zip>12345</zip>
<city>San Jose</city>
</resAddress>
<officeAddress/>
</demographics>
</person>
I have been struggling with this issues for days now and I'am
getting pretty close to my deadline. I would really appreciate if anyone has
a solution or workaround for this kind of a problem.
Thanks
Sowjanya
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
jibx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/jibx-users