Try to use those for mapping in sted of structure i.e make structure as
mapping and try element you should not get th error try it once
Regards,
venkat annagni
On 7/20/07, Janga, Sowjanya <[EMAIL PROTECTED]> wrote:
Hi,
I appreciate your response.
Trouble is that I do have these 2 attributes specified on the structure
but still doesn't ignore the extra element
<structure name="resAddress" field="resAddress"
map-as="Address"
usage= "optional" ordered="false"
flexible="true" />
but still doesn't ignore the extra element
......
<resAddress >
<extra-element >JUNK</extra-element >
<street >123 Main Street</street >
<zip >12345</zip >
<city >San Jose</city >
</resAddress >
...........
Sowjanya
-----Original Message-----
*From:* [EMAIL PROTECTED] [mailto:
[EMAIL PROTECTED] *On Behalf Of *venkateswarlu a
*Sent:* Friday, July 20, 2007 1:26 PM
*To:* JiBX users
*Subject:* Re: [jibx-users] Structure with flexible=true is not ignoring
extraelements.
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
> jibx-users@lists.sourceforge.net
> 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
jibx-users@lists.sourceforge.net
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
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users