_________________ Currenlty programming with : java , html , php , and javascript . (OCJP-6 certified )
For this message the author msi_333 has received gratitude : manniar
robbie70
Code subject: Re: Unmarshall From XML using JAXB
Posted: Wed Jan 26, 2011 12:43 pm
Joined: Wed Jan 26, 2011 12:36 pm Posts: 1 Has thanked: 0 time Have thanks: 1 time
I think there is a small typo in your example,
I think the code should read,
Code:
System.out.println ("Student Name is : " + student.getName ()); System.out.println ("Student Age is : " + student.getAge ());
Also it might be worth mentioning that you need to generate the java class from the XSD file you've mentioned. I used the utility plug-in for Eclipse called XJC. Then the code in your example will find the java class for StudentType. Might be obvious for experienced programmers but not for people new to Jaxb.
Good example though, thanks.
For this message the author robbie70 has received gratitude : msi_333