Hi everybody,

Has anyone worked with xsi:type attributes using jibx?
I mean something like that:

XML document A
<...>
   <data xsi:type="PassengerCarData">
      <!-- car specific data -->
   </data>
</...>

XML document B
<...>
   <data xsi:type="ExtendedPassengerCarData">
      <!-- extended passenger car specific data -->
   </data>
</...>


In the binding.xml for jibx this would look something like that:

<mapping class="net.team.data.AbstractData" abstract="true">
<value name="type" ns="http://www.w3.org/2001/XMLSchema-instance"; style="attribute" get-method="getXsiType" set-method="setXsiType"/>
</mapping>


<mapping name="data" class="net.team.data.PassengerCarData" extends="net.team.data.AbstractData">
<structure map-as="net.team.data.AbstractData">
<!-- passenger car specific bindings -->
</mapping>


<mapping name="data" class="net.team.data.ExtendedPassengerCarData" extends="net.team.data.PassengerCarData">
<structure map-as="net.team.data.AbstractData">
<!-- extended passenger car specific bindings -->
</mapping>


The point is, that I want to use the attributes and elements of the type PassengerCarData in the ExtendedPassengerCarData (as 'extended' indicates). But with a binding.xml like that above, this does not work, I get a NullPointerException at the end of the build:
BUILD FAILED: java.lang.NullPointerException


I don't understand how jibx should know, what "data" mapping it should use when reaching a <data xsi:type...> tag. I haven't found any way in the manual, how one can define a mapping according to the value of an attribute. Please proove me wrong !!!

If anyone knows a solution to this problem, please tell me!

cheers
Stephan

--
Stephan Kozel
---------------------------------------------
team Communication Technology Management GmbH
Goethegasse 3
A-1010 Wien


[EMAIL PROTECTED]
www.te-am.net

tel.: +43 1 512 30 20-29
fax.: +43 1 512 30 20-99
---------------------------------------------



-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now. http://productguide.itmanagersjournal.com/
_______________________________________________
jibx-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to