Using Castor to parse the following xml into POJOs using a mapping file is fairly straightforward:
<human name="bob"/>
<dog owner="alice"/>
It uses the name of the element to map to the class. But what if an attribute should be used to do the mapping? e.g.:
<animal type="human" name="bob"/>
<animal type="dog" owner="alice"/>
This contrived example is based on XML that I have to consume (tho I didn't author it!). Any ideas on how to approach this with Castor mapping files?