まず、commentType オブジェクトへの参照を含む XSD があります。
...
<xs:complexType>
<xs:sequence>
<xs:element name="entry" type="ref:commentType">
...
commentType は次のように記述されます (同じ XSD):
...
<xs:complexType name="commentType" mixed="true">
<xs:annotation>
<xs:documentation>Some text</xs:documentation>
</xs:annotation>
<xs:sequence minOccurs="0" maxOccurs="unbounded">
<xs:any/>
</xs:sequence>
<xs:attribute name="date" type="xs:dateTime" use="required"/>
<xs:attribute name="type" use="optional" default="PRODUCT">
<xs:simpleType>
<xs:restriction base="xs:token">
<xs:enumeration value="PRODUCT"/>
<!--Several values-->
</xs:restriction>
</xs:simpleType>
</xs:attribute>
</xs:complexType>
...
Jaxb を使用して解析している XML ファイルでは、エントリは別の XSD で定義されている opDetails オブジェクトを参照しています...
...
<entry date="2010-03-26T10:40:27Z" type="PRODUCT">
<opDetails xmlns="http://path/to/opDetails">
<!--Object properties-->
</opDetails>
...
(わかりやすくするために名前と構造を簡略化しています)
質問:
私のコードでこの他のオブジェクトを正しくマップする方法は?
TinyElementImpl のリストである entry.getContent() があります。
明らかに、2つのxsdのクラスを生成し、TinyElementImplをopDetailsとしてキャストしようとすることはオプションではありません:)