Thanks for the response. I looked into the content handler but I don't think one can control what gets un/marshalled from it. I think it's used to process data as it gets un/marshalled.

 I'll post if I find anything to address the problem.

Rob

------------------------------------------
Robert Lerner
Senior Consultant
Vichara Technologies, Inc
646-344-3541



"Stephen Bash" <[EMAIL PROTECTED]>

03/29/2006 08:57 AM

Please respond to
[email protected]

To
[email protected]
cc
Subject
Re: [castor-user] Filtering while unmarshalling collections





Rob-

It probably isn't too helpful, but my first reaction would be to use
an XQuery processor to slice up the XML file and then unmarshal the
result in Castor.  You might look into the listener interfaces in
Castor (I'm thinking UnmarshalListener), but I don't think those offer
any control, just event notification.  Another option is to create a
ContentHandler that sits between the parser and Castor that only sends
Castor the events that you want it to receive.  There might be an
easier way to do this, but those are the off-the-top-of-my-head
solutions...

If you get a solution that works, please let us know, as it will
probably help others in the future.

Stephen


On 3/28/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I'm unmarshalling an xml in which there can be multiple instances of the
> same node-type. Within each node is an identifying string that tells me to
> what the information contained in the node pertains. I only need information
> from one node with a particular identifying string. Is there any way to
> check that string prior to the unmarshalling? In other words, I want to
> avoid unmarshalling all the nodes into a collection of objects and looking
> for the specific string by iterating through the collection. I'd rather
> check before the unmarshalling so I only  one object (that corresponds to
> that node) gets instantiated.
>
> Any ideas?
>
> Thanks,
> Rob
>
> -----------------------------------------
>  Robert Lerner
>  Senior Consultant
>  Vichara Technologies, Inc
>  646-344-3541
>
> ________________________________
>
>
>
>
>
>
> *******************************************************************
>  ****
>  This E-mail is confidential. It may also be legally privileged. If
>  you
>  are not the addressee you may not copy, forward, disclose or use
>  any
>  part of it. If you have received this message in error, please
>  delete
>  it and all copies from your system and notify the sender
>  immediately
>  by return E-mail.
>
>  Internet communications cannot be guaranteed to be timely, secure,
>  error or virus-free. The sender does not accept liability for any
>  errors or omissions.
> *******************************************************************
>  ****
>


-----------------------------------------
******************************************************************
This message originated from the Internet.  Its originator may or
may not be who they claim to be and the information contained in
the message and any attachments may or may not be accurate.
******************************************************************




*******************************************************************
****
This E-mail is confidential. It may also be legally privileged. If
you
are not the addressee you may not copy, forward, disclose or use
any
part of it. If you have received this message in error, please
delete
it and all copies from your system and notify the sender
immediately
by return E-mail.

Internet communications cannot be guaranteed to be timely, secure,
error or virus-free. The sender does not accept liability for any
errors or omissions.
*******************************************************************
****

Reply via email to