Hi Sam,
Your mail is a bit difficult to read with all the =3D and =20
I have a headache just looking at it...
In anycase...my guess is that you are accidently calling one of the
static unmarshal methods ...in which case your mapping file is
being ignored.
--Keith
> Sam Al-Dokanji wrote:
>
> Hi all,
> Would someone help me recognizing what I am doing wrong in the
> following =
> example (this my first use of castor):
> The xml file:
> <pl>
> <fname>Sam</fname>=20
> <lname>mylastname</lname>
> <location>Toronto Ontario</location>
> </pl>
>
> The mapping:
> <mapping>
> <description>something</description>
> <class name=3D"DealDataObject">
> <field name=3D"first-name" type=3D"java.lang.String">=20
> <bind-xml name=3D"fname" node=3D"element"/>
> </field>
> <field name=3D"lname" type=3D"string"=20
> get-method=3D"getLastName" set-method=3D"setLastName">
> <bind-xml name=3D"lname" node=3D"element"/>
> </field>
> <field name=3D"location" type=3D"string">
> <bind-xml name=3D"location" node=3D"element"/>
> </field>
> </class>
> </mapping>
>
> The class:
> public class DealDataObject {
> public void setFirstName(String name) {
> this.firstName =3D name;
> System.out.println(">setFirstName");
> }
>
> public void setLastName(String name) {
> this.lastName =3D name;
> System.out.println(">setLastName");
> }
>
> public void setLocation(String location) {
> this.location =3D location;
> System.out.println(">setLocation");
> }
>
> public String getFirstName() {
> return firstName;
> }
>
> public String getLastName() {
> return lastName;
> }
>
> public String getLocation() {
> return location;
> }
>
> public String toString() {
> return "firstName =3D " + firstName + ", lastName =3D " + lastName
> +=20
> ", location =3D " + location;
> }
> private String firstName;
> private String lastName;
> private String location;
> }
>
> The problem:
> only 'location' is unmarshelled and assigned the value in the in the
> xml =
> file. The other tow fields (firstName, and lastName) stay null.=20
>
> Thanks,
> Sam.
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-dev