Here is a small part of the schema I have -
<xs:complexType name="MixedContentType" mixed="true">
<xs:choice minOccurs="0" maxOccurs="unbounded">
<xs:element name="Hyper" type="HyperTextType" />
<xs:element name="Style" type="StyleClassType" />
<xs:element name="Paragraph" type="ParagraphType" />
<xs:element name="Choose" type="ChooseType" />
<xs:element name="If" type="WhenType" />
<xs:element name="Value-Of" type="ValueOfType" />
</xs:choice>
</xs:complexType>
and
<xs:element name="StyledText" type="MixedContentType" minOccurs="0" />
<xs:complexType name="StyleClassType" mixed="true">
<xs:complexContent>
<xs:extension base="MixedContentType">
<xs:attribute name="class" type="xs:string" />
</xs:extension>
</xs:complexContent>
</xs:complexType>
So a <StyledText> element can look like this –
<StyledText>Hello how are you ? <Style class="bold">I am fine.
</Style> Are you ? <Style class="italic"> I am ok </Style> Ok.
</StyledText>
The generated class MixedContentType looks like this –
public class MixedContentType implements java.io.Serializable {
//--------------------------/
//- Class/Member Variables -/
//--------------------------/
/**
* internal content storage
*/
private java.lang.String _content = "";
/**
* Field _items
*/
private java.util.ArrayList _items;
//----------------/
//- Constructors -/
//----------------/
public MixedContentType()
{
super();
setContent("");
_items = new ArrayList();
} //-- com.intuit.tools.cate.generated.view.MixedContentType()
}
When unmarshalling castor complains about the text in red "Are you
?" It puts the first string "Hello how are you ?" in the _content
and then
unmarshalls Style and when it encounters "Are You ?" says this is an
invalid Text node and cannot be added as a MixedContentType.
Looks like Castor does not support this kind of schema or I am I doing
something wrong ? Should I write a custom field handler for this ? Any
hints on how to
go about this issue ?
Thanks in advance for any help.
---------------------------------------------------------------------
To unsubscribe from this list please visit:
http://xircles.codehaus.org/manage_email