Women in Technology

Hear us Roar



Article:
  XML Data Binding with Castor
Subject:   good, clear explanations
Date:   2004-04-05 09:26:12
From:   lyl000
Response to: good, clear explanations

I think this method is very well.I have a problem:
your method can get data from xml,but if I get xml data from database ,then put it into a string,How I can trans it into javaBean?
eg:
String aa="<person>
<name>Michael Owen</name>
<address>222 Bazza Lane, Liverpool, MN</address>
<ssn>111-222-3333</ssn>
<email>michael@owen.com</email>
<home-phone>720.111.2222</home-phone>
<work-phone>111.222.3333</work-phone>
</person>
",I can't use :Person person = (Person)
Unmarshaller.unmarshal(Person.class,
new FileReader("person.xml"));
I can get the framework use: mapping.loadMapping("mapping.xml");
can I put my String into the bean but put into an xml first.
thank you