Exclude xml element to be mapped.

View: New views
2 Messages — Rating Filter:   Alert me  

Exclude xml element to be mapped.

by pdcvgmh :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi everyone.

I have a simple question about mapping. I have the following xml
structure (response from a web services not under my control)

<response>
    <field1></field1>
    <field2></field2>
   .....
    <fieldN></fieldN>
<response>

I'm only interested in a few fields but the WS response contains a lot
of fields.

Is there some way to tell Castor which fields don't try to map?

This sounds like a simple question but I can't find the solution

Best regards

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Exclude xml element to be mapped.

by Werner Guttmann-6 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi Pablo,

there's actually a few options you could try.

a) Provide an explicit mapping for your Java class with just the
relevant fields.

b) Use auto-mapping, but only provide the fields required in your Java
class.

What does your Java class look like ? Does it have members for
everything, or just the required fields ?

Regards
Werner

pablo caballero wrote:

> Hi everyone.
>
> I have a simple question about mapping. I have the following xml
> structure (response from a web services not under my control)
>
> <response>
>     <field1></field1>
>     <field2></field2>
>    .....
>     <fieldN></fieldN>
> <response>
>
> I'm only interested in a few fields but the WS response contains a lot
> of fields.
>
> Is there some way to tell Castor which fields don't try to map?
>
> This sounds like a simple question but I can't find the solution
>
> Best regards
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
>     http://xircles.codehaus.org/manage_email
>
>

---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email