Hi Chetan,

This is very easy - just replace your current <structure 
field="relativeDate"/> with a <structure name="relativeDate"> and move 
the content of the second <mapping> into this new <structure>. See the 
structure mapping section of the binding tutorial 
(http://jibx.sourceforge.net/tutorial/binding-structures.html) for some 
examples.

  - Dennis

Dennis M. Sosnoski
SOA, Web Services, and XML
Training and Consulting
http://www.sosnoski.com - http://www.sosnoski.co.nz
Seattle, WA +1-425-296-6194 - Wellington, NZ +64-4-298-6117



[EMAIL PROTECTED] wrote:
>
> Hi,
>
> I need some help on binding .
> *
> For a structure like this*
>
> <?xml version="1.0" encoding="UTF-8"?>
> <SettlementDate>
>      <relativeDate>
>            <periodMultiplier>MULTIPLIER</periodMultiplier>
>            <period>PERIOD</period>
>            <dayType>DAY-TYPE</dayType>
>            <businessDayConvention>CONVENTION</businessDayConvention>
>            <businessCenter>BUSINESS-CENTER</businessCenter>
>            <dateRelativeTo href="linkInfo"/>
>      </relativeDate>
> </SettlementDate>
>
> *
> i am creating the binding like this*
>
> <?xml version="1.0" encoding="UTF-8"?>
> <binding> *
>        <mapping name="SettlementDate" class="SettlementDate">* *
>                <structure field="relativeDate"/>* *
>        </mapping>*
>        <mapping name="relativeDate" class="RelativeDate">
>                <value name="periodMultiplier" field="periodMultiplier"/>
>                <value name="period" field="period"/>        
>                <value name="dayType" field="dayType"/>
>                <value name="businessDayConvention" 
> field="businessDayConvention"/>                
>                <value name="businessCenter" field="businessCenter"/>   
>                      
>                <structure value-style="attribute" name="dateRelativeTo">
>                        <value style="attribute" name="href" 
> field="dateRelativeTo"/>                        
>                </structure>
>        </mapping>
> </binding>
>
>
> My question : Settlement Date is an xml element that contains an 
> element called relativeDate.
> Is there any way of binding which will help me avoid creating a class 
> called SettlementDate which is a very trivial class like(refer the 
> markup in bold)
>
>
> public class SettlementDate {
>        private RelativeDate relativeDate;
>
>        //setters and getters follow
> }
>
>
>
> Regards,
> Chetan
> ------------------------------------------------------------------------
>
> _______________________________________________
> jibx-users mailing list
> jibx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/jibx-users
>   


_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to