Hear us Roar
Article:
 |
|
XML Data Binding with Castor
|
| Subject: |
|
conditional bind xml attribute |
| Date: |
|
2007-04-10 08:52:42 |
| From: |
|
techijr
|
|
|
|
Hi, I have my XML like this
<person>
<name>..</name>
<contactdetail>
<phone type="work">123456</phone>
<phone type="cell">45624</phone>
</contactdetails>
</person>
And because of my other design limitations, I have my bean like this (and not possible to change this)
Class ContactDetails{
String cellPhone;
String workPhone;
}
QUESTION:
How should my mapping.xml to parse this? Adding a condition while binding the XML. Appreciate any suggestions..
|
|
| |