The only way I could get it to work is using a structure copying the format. 
Is this the only support Jibx has for this type of need?
<binding name="test_binding">    <mapping name="message" class="Message">       
  <value name="subject" field="subject" usage="optional"/>        <structure 
name="from" field="fromR">
        <value name="name" field="name" usage="optional"/>        <value 
name="address" field="address" usage="optional"/>

   </structure>

        <structure name="to" field="toR">
        <value name="name" field="name" usage="optional"/>        <value 
name="address" field="address" usage="optional"/>

   </structure>

    </mapping></binding>
Thanks,
Mike

----- Original Message ----
From: Mike Barlotta <[EMAIL PROTECTED]>
To: jibx-users@lists.sourceforge.net
Sent: Tuesday, November 6, 2007 4:02:00 PM
Subject: [jibx-users] single Java class mapped to multiple XML elements with 
different names

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