Govind, Have you looked at using the <collection> mapping element (see [1] and [2]), rather than relying on <structure> alone?
Regards, Bindul [1] http://jibx.sourceforge.net/binding/tutorial/binding-collects.html [2] http://jibx.sourceforge.net/binding/collection-element.html Bindul Bhowmik On Tue, Dec 1, 2015 at 4:38 PM, PS Govind <psgov...@hotmail.com> wrote: > I am getting org.jibx.runtime.JiBXException: Duplicate element > "{http://www.pcats.org/schema/naxml/loyalty/v01}TransactionLine" when trying > to load this xml into java. I see the set-method="addTransactionLine" > method being called for the first TransactionLine element. How can I resolve > this error? Any help is truly appreciated... > > > <ns2:GetRewardsRequest > xmlns:ns2="http://www.pcats.org/schema/naxml/loyalty/v01" > xmlns:ns4="http://www.pcats.org/schema/core/v01" > xmlns:ns3="http://www.naxml.org/POSBO/Vocabulary/2003-10-16"> > <ns2:RequestHeader> > > <ns3:VendorModelVersion>vX.0X:X.00.00</ns3:VendorModelVersion> > <ns2:POSSequenceID>123456</ns2:POSSequenceID> > <ns2:LoyaltyOfflineFlag value="no" /> > </ns2:RequestHeader> > <ns2:TransactionData> > <ns2:TransactionHeader> > <ns3:RegisterID>XX</ns3:RegisterID> > <ns2:BusinessPeriod> > > <ns3:BusinessDate>2013-01-31</ns3:BusinessDate> > </ns2:BusinessPeriod> > <ns3:EventStartDate>2013-01-31</ns3:EventStartDate> > <ns3:EventStartTime>19:34:16</ns3:EventStartTime> > </ns2:TransactionHeader> > <ns2:TransactionDetailGroup> > <ns2:TransactionLine status="normal"> > <ns2:LineNumber>1</ns2:LineNumber> > <ns2:ItemLine discountable="yes"> > > <ns3:Description>TESTPRODUCT1</ns3:Description> > <ns2:SalesUOM>EA</ns2:SalesUOM> > </ns2:ItemLine> > </ns2:TransactionLine> > <ns2:TransactionLine status="normal"> > <ns2:LineNumber>2</ns2:LineNumber> > <ns2:ItemLine discountable="yes"> > > <ns3:Description>TESTPRODUCT2</ns3:Description> > <ns2:SalesUOM>EA</ns2:SalesUOM> > </ns2:ItemLine> > </ns2:TransactionLine> > </ns2:TransactionDetailGroup> > </ns2:TransactionData> > </ns2:GetRewardsRequest> > --------------------------------------------------- > > <binding name="GetRewardsRequest" direction="input"> > <mapping name="GetRewardsRequest" > ns="http://www.pcats.org/schema/naxml/loyalty/v01" > class="com.weis.fuel.verifone.model.RewardTransaction" > flexible="true" ordered="false"> > <namespace uri="http://www.pcats.org/schema/naxml/loyalty/v01" > prefix="ns2"/> > <namespace uri="http://www.naxml.org/POSBO/Vocabulary/2003-10-16" > prefix="ns3"/> > <namespace uri="http://www.pcats.org/schema/core/v01" prefix="ns4"/> > <structure name="RequestHeader" flexible="true" ordered="false" > ns="http://www.pcats.org/schema/naxml/loyalty/v01" > > <value name="VendorModelVersion" set-method="setVendorModelVersion" > ns="http://www.naxml.org/POSBO/Vocabulary/2003-10-16" usage="optional" /> > <value name="POSSequenceID" set-method="setPosSequenceId" > ns="http://www.pcats.org/schema/naxml/loyalty/v01" usage="optional" /> > <structure name="LoyaltyOfflineFlag" > ns="http://www.pcats.org/schema/naxml/loyalty/v01" usage="optional" > > <value name="value" set-method="setLoyaltyOfflineFlag" > usage="optional" style="attribute" /> > </structure> <!-- End::LoyaltyOfflineFlag --> > </structure> <!-- End::RequestHeader --> > <structure name="TransactionData" flexible="true" ordered="false" > ns="http://www.pcats.org/schema/naxml/loyalty/v01" > > <structure name="TransactionHeader" flexible="true" ordered="false" > ns="http://www.pcats.org/schema/naxml/loyalty/v01" > > <value name="RegisterID" set-method="setRegisterId" > ns="http://www.naxml.org/POSBO/Vocabulary/2003-10-16" usage="optional" /> > <structure name="BusinessPeriod" flexible="true" ordered="false" > ns="http://www.pcats.org/schema/naxml/loyalty/v01" > > <value name="BusinessDate" set-method="setBusinessDate" > ns="http://www.naxml.org/POSBO/Vocabulary/2003-10-16" usage="optional" /> > </structure> <!-- End::BusinessPeriod --> > <value name="EventStartDate" set-method="setTranStartDate" > ns="http://www.naxml.org/POSBO/Vocabulary/2003-10-16" usage="optional" /> > <value name="EventStartTime" set-method="setTranStartTime" > ns="http://www.naxml.org/POSBO/Vocabulary/2003-10-16" usage="optional" /> > </structure> <!-- End::TransactionHeader --> > > <structure name="TransactionDetailGroup" flexible="true" ordered="false" > ns="http://www.pcats.org/schema/naxml/loyalty/v01" usage="optional" > > <structure name="TransactionLine" ordered="false" flexible="true" > allow-repeats="true" type="com.weis.fuel.verifone.model.TransactionLine" > set-method="addTransactionLine" > ns="http://www.pcats.org/schema/naxml/loyalty/v01" usage="optional"> > <value name="LineNumber" set-method="setLineNumber" > ns="http://www.pcats.org/schema/naxml/loyalty/v01" usage="optional"/> > <value name="status" set-method="setStatus" > usage="optional" style="attribute" /> > <structure name="ItemLine" flexible="true" ordered="false" > ns="http://www.pcats.org/schema/naxml/loyalty/v01" usage="optional" > > <value name="Description" set-method="setDescription" > ns="http://www.naxml.org/POSBO/Vocabulary/2003-10-16" usage="optional"/> > <value name="SalesUOM" set-method="setSalesUOM" > ns="http://www.pcats.org/schema/naxml/loyalty/v01" usage="optional"/> > <value name="discountable" set-method="setDiscountable" > usage="optional" style="attribute" /> > </structure> <!-- End::ItemLine --> > </structure> <!-- End::TransactionLine --> > </structure> <!-- End::TransactionDetailGroup --> > > </structure> <!-- End::TransactionData --> > > </mapping> > </binding> > --------------------------------------------------------------------------------------------------- > > > > > ------------------------------------------------------------------------------ > Go from Idea to Many App Stores Faster with Intel(R) XDK > Give your users amazing mobile app experiences with Intel(R) XDK. > Use one codebase in this all-in-one HTML5 development environment. > Design, debug & build mobile apps & 2D/3D high-impact games for multiple > OSs. > http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140 > _______________________________________________ > jibx-users mailing list > jibx-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/jibx-users > ------------------------------------------------------------------------------ Go from Idea to Many App Stores Faster with Intel(R) XDK Give your users amazing mobile app experiences with Intel(R) XDK. Use one codebase in this all-in-one HTML5 development environment. Design, debug & build mobile apps & 2D/3D high-impact games for multiple OSs. http://pubads.g.doubleclick.net/gampad/clk?id=254741911&iu=/4140 _______________________________________________ jibx-users mailing list jibx-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/jibx-users