Access to an object which is not in the same XSD with Jaxb

quee-quee

New Member
First, I have a XSD containing references to commentType object :\[code\]...<xs:complexType> <xs:sequence> <xs:element name="entry" type="ref:commentType">...\[/code\]commentType is described as (same XSD):\[code\]...<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="http://stackoverflow.com/questions/13823788/PRODUCT"/> <!--Several values--> </xs:restriction> </xs:simpleType> </xs:attribute></xs:complexType>...\[/code\]In the XML file I'm parsing using Jaxb, entry refers to a opDetails object, which is defined in another XSD...\[code\]...<entry date="2010-03-26T10:40:27Z" type="PRODUCT"> <opDetails xmlns="http://path/to/opDetails"> <!--Object properties--> </opDetails>...\[/code\](I've simplied names and structure for clarity)Questions :How to map correctly this other object in my code ?I have a entry.getContent() which is a list of TinyElementImpl.Obviously, generating classes of the 2 xsd's and trying to cast TinyElementImpl as opDetails is not an option :)
 
Back
Top