maybe it helps: http://www.onjava.com/pub/a/onjava/2001/10/24/xmldatabind.html

According to my comprehension, you have to write JavaBean-like classes corresponding to the tags in your xml(<Test><Testehader>, etc.) to support marshall/unmarshall.
Or you can provide the schema and generate those classes using Castor tools.



From: "janarthanankesavan" <[EMAIL PROTECTED]>
Reply-To: <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED]
Subject: [castor-user] Any sample code for unmarshalling?
Date: 13 Jul 2004 06:10:43 -0000

 ?i All,
Thanks for your swift replies and suggestions.
I would like to know how to unmarshall?


I use the following code.But,it gives me NoClassDefFoundError.
java.lang.NoClassDefFoundError: com/a/b/c/TestHeader (wrong name:
com/a/b/c/TestHeader)

java.io.FileReader in=new java.io.FileReader("C:\\TestXML.xml"); test=(Test) Unmarshaller.unmarshal(Test.class,in);

The structure of the TestXML.xml is as follows:
<Test>
<TestHeader>
----
</TestHeader>
</Test>

Expecting your replies in this regard,
Janarthanan Kesavan

Life is not a bed of roses!
----------------------------
With warmest regards,
T.K.Janarthanan.
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-user

_________________________________________________________________
与联机的朋友进行交流,请使用 MSN Messenger: http://messenger.msn.com/cn




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

Reply via email to