Hello,
I guess (I cannot tell for sure as I do not have your Java code...)
that the problem lies in the attribute names. 'Text' and 'EText' both
start with upper case letters and 'EText' even has two upper case
letters... I expect that your class will have the methods
'setText/getText' and 'setEText/getEText' which will lead to expected
attribute names of 'text' and 'eText'.
As Werner already said - letting Castor guess through reflection leads
to naming conventions.
If you want to keep your attribute with initcap then you have to use a
mapping file.
Hope this helps
Joachim
2008/5/30 Jesus Lopez <[EMAIL PROTECTED]>:
> -->I use this to execute the process:
>
> FileInputStream fi=new FileInputStream(rutaXMLTema);
> InputStreamReader is= new InputStreamReader(fi,"UTF-8");
> Course pregsTema = Course.unmarshal(is);
>
> Module moduleTema = pregsTema.getModule();
> Level levelTema = moduleTema.getLevel();
> listaPreguntasTema = levelTema.getQuestion();
>
> for(int i=0;i<listaPreguntasTema.length;i++){
> Question q=listaPreguntasTema[i];
> .........
> }
>
> -->The XML is this:
>
> <?xml version="1.0" encoding="UTF-8"?>
> <course>
> <module>
> <level>
> <question id="1" nivel="0" Text="De las siguientes afirmaciones
> ordenador?" EText="Ondokoetatik">
> </question>
> .......
>
> --> The bean:
>
> public class Question implements java.io.Serializable {
>
> private java.lang.String _id;
> private java.lang.String _nivel;
> private java.lang.String _text;
> private java.lang.String _EText;
>
> ....
>
> --> As I know, I don´t use a mapping file.
>
>
> When I check, "q" only has got "id" and "nivel", and "Text" and "EText" with
> null value.
>
> I don´t know what can I do
>
>
> Thanks
>
>
>
>
>
>
> -----Original Message-----
> From: Werner Guttmann [mailto:[EMAIL PROTECTED]
> Sent: jueves, 29 de mayo de 2008 22:24
> To: [email protected]
> Subject: Re: Res: [castor-user] castor doesn´t unmarshal all my fields
>
> Exactly. And for this to work, some (just a few) naming conventions have to
> be met.
>
> Werner
>
> Marcelo Henrique wrote:
>> Hi,
>> are you using some mapping file? Because if not you're using castor default
>> behavior that is through refletion to get the fields and fill the object.
>>
>> Regards,
>>
>> *-----------------------------------------------------*
>> || Marcelo Henrique De Oliveira Lima
>> || Ciência da Computação - UECE
>> || Linux User #399803
>> || Slackware GNU/Linux Powered!
>> *-----------------------------------------------------*
>>
>>
>>
>> ----- Mensagem original ----
>> De: Jesus Lopez <[EMAIL PROTECTED]>
>> Para: [email protected]
>> Enviadas: Quinta-feira, 29 de Maio de 2008 7:31:46
>> Assunto: [castor-user] castor doesn´t unmarshal all my fields
>>
>>
>> When I use castor to
>> convert one XML file to Object, castor doesn´t unmarshal all my
>> fields, only both first ones, and the rest with "null" value.
>> I don`t understand
>> this ...
>>
>> For example, here
>> castor only unmarshal "id" and "nivel", and "Text" and "EText" with
>> null
>> value:
>>
>> <?xml
>> version="1.0"
>> encoding="UTF-8"?>
>> <course>
>> <module>
>> <level>
>> <question
>> id="1" nivel="0" Text="De las siguientes afirmaciones, ¿cuál de ellas
>> se ajusta mejor a la definición de ordenador?" EText="Ondokoetatik,
>> zein da">
>>
>> </question>
>> ....
>>
>>
>> Thanks a
>> lot
>>
>>
>> Jesús López Lobo
>> ************************************ DISCLAIMER
>> *****************************************
>> This message may contain confidential, proprietary or legally
>> privilegedinformation.
>> If you are not the intended recipient of this message, please notify it
>> tothe sender and delete without resending or backing it, as it is
>> legallyprohibited.
>>
>>
>> ************************************* AVISO LEGAL
>> ****************************************
>>
>> Este mensaje puede contener información confidencial, en propiedad
>> olegalmente protegida.
>> Si usted no es el destinatario, le rogamos lo comunique al remitentey
>> proceda a borrarlo, sin reenviarlo ni conservarlo, ya que su uso no
>> autorizado estáprohibido legalmente.
>>
>> **********************************************************************
>> *******************
>>
>>
>>
>> Abra sua conta no Yahoo! Mail, o único sem limite de espaço para
>> armazenamento!
>> http://br.mail.yahoo.com/
>
> ---------------------------------------------------------------------
> To unsubscribe from this list, please visit:
>
> http://xircles.codehaus.org/manage_email
>
>
>
>
> ********************************** DISCLAIMER *******************************
>
> This message may contain confidential, proprietary or legally privileged
> information.
> If you are not the intended recipient of this message, please notify it to
> the sender and delete without resending or backing it, as it is legally
> prohibited.
>
> ********************************** AVISO LEGAL ******************************
>
> Este mensaje puede contener información confidencial, en propiedad o
> legalmente protegida.
> Si usted no es el destinatario, le rogamos lo comunique al remitente y
> proceda a borrarlo, sin reenviarlo ni conservarlo, ya que su uso no
> autorizado está prohibido legalmente.
>
> ******************************************************************************
>
>
> ---------------------------------------------------------------------
> 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