Thanks Keith.
Your solution is too complicated for me...
I will modify a lign in the set-method of my attribute : this._myAttribute
= myParameter.substring(0,5);

Bye bye
Julien



|---------+---------------------------->
|         |           Keith Visco      |
|         |           <[EMAIL PROTECTED]|
|         |           om>              |
|         |                            |
|         |           11/06/03 23:10   |
|         |           Veuillez r�pondre|
|         |           � castor-dev     |
|         |                            |
|---------+---------------------------->
  
>--------------------------------------------------------------------------------------------------------------|
  |                                                                                    
                          |
  |       Pour :    [EMAIL PROTECTED]                                                  
                      |
  |       cc :                                                                         
                          |
  |       Objet :   Re: [castor-dev] How to perform a substring in a mapping file.     
                          |
  
>--------------------------------------------------------------------------------------------------------------|





You'll need to do this via a custom field handler.

But now that you bring it up. It might be nice to be able to specify
XPath functions in the mapping file. This will have to be a future
enhancement.

Anyway, to do any modification of the data before it's set in your
object, you'll need to custom field handler. Just subclass
GeneralizedFieldHandler and implement the convertUponSet and
convertUponGet methods.

--Keith

[EMAIL PROTECTED] wrote:
>
> Hi all,
>
> While Unmarshalling, I'd like to keep only few characters from my
> attribute.
> Is-it possible to get only a part of my attribute to init my variable ?
>
> For example :
>
> <field name="y_zone" type="long">
>                        <bind-xml name="y_lambert" node="attribute"
> substringData="0,4"/>
>  </field>
>
> Or something like that....
>
> Thanks for help.
>
> Julien
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-dev

-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to