XJC Java class generation for <xs:choice> element which is not unbounded
After this similar question yesterday I have another question concerning inheritance in XML schema and XJC bindings. Given the following choice element such that Book and Journal have a common parent type ( Publication ). <xsd:choice > <xsd:element name="Book" type="Book" /> <xsd:element name="Journal" type="Journal" /> </xsd:choice> The Java class properties which are generated are like: private Book book; private Journal journal; Since <xsd:choice> means that there might be either a Book or a Journal I would prefer private Publication bookOrJournal; If I had a list of Publications by setting