I'm using XStream and I have an XML sample:
<person>
<firstname>Joe</firstname>
<lastname>Walnes</lastname>
<phone value="1234-456" />
<fax value="9999-999" />
</person>
and I whant to map it to the class
public class Person {
private String firstname;
private String lastname;
private String phone;
private String fax;
}
So the idea is to map attribute of nested element to the current object. I tried to find any ready-to-use converter with no success. I believe that's possible by implementing new converter but may be someone already did this. Or there's a solution I haven't found.
Updated:
The idea I'm trying to implement is omitting unnecessary entities of being created and mapped. I don't need Phone and Fax entities at all, I need only their attributes in my model. The XML schema I'm trying to parse is thirdparty for me and I can't change it.