-----Original Message-----
From: Alessandro Salina [mailto:[EMAIL PROTECTED]]
Sent: Thursday, September 27, 2001 2:09 PM
To: [EMAIL PROTECTED]
Subject: [castor-dev] XML MAPPING
Importance: HighHi
I am seeking some advice on how to handle the following situation.
Let's assume i have an xml like this:
<person>
<name>xxx</name>
<address>yyy</address>
<tel>
<number>111</number>
<number>222</number>
<number>333</number>
</tel>
</person>
and a JavaBean like that:
....
public class Person
{
private String name;
private String address;
private Vector number;
public String getName() {...}
public void setName(String name){...}
public String getAddress(){...}
public void setAddress(String address){...}
public Vector getNumber(){...}
public void setNumber(Vector number){...}
}
For the field name and address there isn't any problem but how can i map the
field "number" to the class Person??
I wonder if there is a way to map the field number just like this:
<?xml version="1.0"?>
<mapping>
<class name="Person">
<map-to xml="Person"/>
...
<field name="number"
type="java.lang.String" collection="vector">
<bind-xml name="tel/number" node="element"/>
</field>
...
</class>
</mapping>
Thanks for any suggestions.
Ale
Hi
I had a similar problem. But the fact is that there is no
way we can ignore an xml tag and go on to its children. You have to specify a
class descriptor for the "tel" tag. (I got to know this from this mailing
list).
If
you are able to solve this problem, please let me know. (although I didn't
try giving "tel/number")
- [castor-dev] XML mapping Viral Tolat
- [castor-dev] XML MAPPING Alessandro Salina
- [castor-dev] XML mapping Jaspreet Singh
- [castor-dev] XML mapping Sin Chada, Veerpal
- Re: [castor-dev] XML mapping Keith Visco
- [castor-dev] xml mapping Bill Marcum
- Re: [castor-dev] xml mapping Arnaud Blandin
- [castor-dev] xml mapping Anna Kerekes
- Re: [castor-dev] xml mapping anarang