Hi,
I have been facing with one problem. I have tried a lot to
resolve the problem. But i could't solve the problem. Please give me the
solution.
I have one p_news.xsd file. Inside p_news.xsd file we are including c_H3GML.xsd file and using base="contentItem" in p_news.xsd file.
I have Generated java objects using sourceGenerator. So it generated H3GSchema.java and ContentItem.java,News.java and so..on.
But while unmarshalling the my xml file it is unable to instantiate the News object.
What i have observed is Inside ContentItem.java there is no set,get methods for News. That'y i am it's unable to unmarshall the data.
it's giving unable to instantiate News Object.
If i add p_news.xsd content in c_H3GSchema.xsd then it able to generate setNews(),getNews() methods in ContentItem.java and able to unmarshall the data.
Could you please tell me whether Castor supports this type of Schemas.
Here with i am givng the two Xsd files.
p_news.xsd
<xsd:include schemaLocation="c_H3GML.xsd"/>
<xsd:complexType name="News">
<xsd:complexContent>
<xsd:extension base="ContentItem">
<xsd:sequence>
<xsd:choice>
<xsd:element ref="Article" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="Video" type="VideoClip" maxOccurs="unbounded"/>
</xsd:choice>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
.....................
..................
</xsd:schema>
c_H3GML.xsd
<xsd:element name="H3GSchema">
<xsd:annotation>
<xsd:documentation>Root element for any HML instance document</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ContentItem" type="ContentItem" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>Extensible variable content container providing standard components.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="FeedMetadata" type="FeedMetadata"/>
</xsd:sequence>
<xsd:attribute name="SchemaVersion" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="ContentItem" abstract="true">
<xsd:annotation>
<xsd:documentation>Variable content container for content</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="ContentMetadata" type="ContentMetadata" minOccurs="0"/>
<xsd:element name="TopicMap" type="TopicMap" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Topic (a.k.a. keyword) mapping structure</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
...................
.................
</xsd:schema>
Thanks in advance
Thanks & Regards
sudhakar goud.T
I have one p_news.xsd file. Inside p_news.xsd file we are including c_H3GML.xsd file and using base="contentItem" in p_news.xsd file.
I have Generated java objects using sourceGenerator. So it generated H3GSchema.java and ContentItem.java,News.java and so..on.
But while unmarshalling the my xml file it is unable to instantiate the News object.
What i have observed is Inside ContentItem.java there is no set,get methods for News. That'y i am it's unable to unmarshall the data.
it's giving unable to instantiate News Object.
If i add p_news.xsd content in c_H3GSchema.xsd then it able to generate setNews(),getNews() methods in ContentItem.java and able to unmarshall the data.
Could you please tell me whether Castor supports this type of Schemas.
Here with i am givng the two Xsd files.
p_news.xsd
<xsd:include schemaLocation="c_H3GML.xsd"/>
<xsd:complexType name="News">
<xsd:complexContent>
<xsd:extension base="ContentItem">
<xsd:sequence>
<xsd:choice>
<xsd:element ref="Article" minOccurs="0" maxOccurs="unbounded"/>
<xsd:element name="Video" type="VideoClip" maxOccurs="unbounded"/>
</xsd:choice>
</xsd:sequence>
</xsd:extension>
</xsd:complexContent>
</xsd:complexType>
.....................
..................
</xsd:schema>
c_H3GML.xsd
<xsd:element name="H3GSchema">
<xsd:annotation>
<xsd:documentation>Root element for any HML instance document</xsd:documentation>
</xsd:annotation>
<xsd:complexType>
<xsd:sequence>
<xsd:element name="ContentItem" type="ContentItem" maxOccurs="unbounded">
<xsd:annotation>
<xsd:documentation>Extensible variable content container providing standard components.</xsd:documentation>
</xsd:annotation>
</xsd:element>
<xsd:element name="FeedMetadata" type="FeedMetadata"/>
</xsd:sequence>
<xsd:attribute name="SchemaVersion" type="xsd:string" use="required"/>
</xsd:complexType>
</xsd:element>
<xsd:complexType name="ContentItem" abstract="true">
<xsd:annotation>
<xsd:documentation>Variable content container for content</xsd:documentation>
</xsd:annotation>
<xsd:sequence>
<xsd:element name="ContentMetadata" type="ContentMetadata" minOccurs="0"/>
<xsd:element name="TopicMap" type="TopicMap" minOccurs="0">
<xsd:annotation>
<xsd:documentation>Topic (a.k.a. keyword) mapping structure</xsd:documentation>
</xsd:annotation>
</xsd:element>
</xsd:sequence>
</xsd:complexType>
...................
.................
</xsd:schema>
Thanks in advance
Thanks & Regards
sudhakar goud.T
Confidentiality Notice The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain confidential or privileged information. If you are not the intended recipient, please notify the sender at Wipro or [EMAIL PROTECTED] immediately and destroy all copies of this message and any attachments. |
-----------------------------------------------------------
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
unsubscribe castor-user
