[prev in list] [next in list] [prev in thread] [next in thread] 

List:       jibx-users
Subject:    Re: [jibx-users] Partial document Unmarshalling
From:       Dennis Sosnoski <dms () sosnoski ! com>
Date:       2004-09-24 16:54:18
Message-ID: 4154513A.3050403 () sosnoski ! com
[Download RAW message or body]

Yes, by writing your own code for handling the top-level control of the 
parsing. Your code can then handle the parsing in whatever way it wants 
until it comes to a portion to be unmarshalled, at which point it can 
invoke the JiBX unmarshalling. The versioned marshalling/unmarshalling 
example should give you an idea of how this could be done: 
http://jibx.sourceforge.net/tutorial/binding-custom.html#frontend The 
difference would be that instead of just looking at the first element to 
decide what to unmarshal, your code would keep handling parsing until it 
got to a point where it wanted to invoke JiBX unmarshalling.

A variation of this approach can be used for piecemeal unmarshalling, 
where you use a custom marshaller/unmarshaller to (1) unmarshal the 
substructure to be processed, (2) call the processing for the 
substructure, then discard it, and (3) check if at end (perhaps be 
seeing if the next tag is the close of the containing element), and if 
not loop back to (1).

  - Dennis

Neroslavskaya, Elena wrote:

>Hi,
>Is it possible in Jibx to unmarshell not the whole
>document but sub-tree in some elegant way ?
>
>Thanks a lot,
>Elena
>


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
jibx-users mailing list
jibx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jibx-users
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic