For what you want I don't think you need custom code. A binding of this type should work:

 <structure name="Comment" class="Foo">
   <structure name="Attachement">
     <value name="URL" field="attachmentUrl"/>
   </structure>
   <value style="text" field="commentText"/>
 </structure>

The "text" style can be used for a value as long as it's following a non-optional element and followed by another element (or the end of the enclosing element).

This would make a good example for the new wiki, once I get that set up.

- Dennis

Norm Deane wrote:

Ok, so I found the example mapper but I still don't quite grasp how I
can implement a mapper that can handle a mixed element.  From what I see
it looks like an unmarshaller is supposed to handle translating 1
element into an object which is then used to set a property on another
object. Suppose I want to take this structure...

<Comment>
  <Attachement>
     <URL>cid:[EMAIL PROTECTED]</URL>
  </Attachment>
  Here are my comments that go with this attachment.
</Comment>


and map it into this Object model...



public class Foo { private String attachmentUrl; private String commentText; }

Thanks,

Norm



-- Dennis M. Sosnoski Enterprise Java, XML, and Web Services Training and Consulting http://www.sosnoski.com Redmond, WA 425.885.7197




-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. Take an Oracle 10g class now, and we'll give you the exam FREE. http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
jibx-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jibx-users

Reply via email to