I  am new user to Jibx and wanted to know if I could have a single Java class  
mapped to multiple XML elements with different names?
  
 Here is a simplified  example of what I am trying to do:
 If I had XML that  looks like this:
  
 <message>
      <subject>
      <from>
          <name>
          <address>
      </from>
      <to>
         <name>            <address>

      </to>
 </message>
  
 I have the following  classes:
  
 public class Message  {
     public String  subject;
     public Recipient  fromR;
     public Recipient  toR;
 }
  
 public class  Recipient {
     public String  name;
     public String  address;
 }
  
 I want to bind from  and to to same class
 something like  this:

<binding name="test_binding">

    <mapping name="message" class="Message"> 

        <value name="subject" field="subject" usage="optional"/>

        <structure name="from" field="fromR" type=Recipient" />

        <structure name="to" field="toR" type=Recipient" />

    </mapping>

    <mapping class="Recipient">

        <value name="name" field="name" usage="optional"/>

        <value name="address" field="address" usage="optional"/>


    </mapping>
</binding>
 Is this possible? I  could not find any examples doing something similar. 
  
 Mike 
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >> http://get.splunk.com/
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to