Castor doesn't support preseving order of text nodes that appear as
mixed content. The only way to get around it is to wrap the text in
additional elements such as:

 <Text>
   <fragment>This is example text</fragment>
   <Link>link 1 </Link>
   <fragment>This is some more example text</fragment>
   <Link>link 2 </Link>
   <fragment>This is the end of the example text</fragment>
<Text>

If you don't want to change your XML, you can always use an XSLT
stylesheet to transform your XML before trying to unmarshl it.

--Keith

greg dupan wrote:
> 
> I'm using the source generator to generate my classes from my schema.  my problem is 
>the following. I have an element that is a complexType with content that is mixed.  I 
>want to be able to keep the order of the content of the element and the subelements 
>as they are in my xml instance document.  With the below schema I can get the links 
>or the content but not in the order that they are in the xml.  Below is a subsection 
>of my .xsd file and a subsection of my .xml document.  Any help would be appreciated.
> 
> .xsd
> <xsd:element name="Text" ref="Text" minOccurs="0" maxOccurs="1" />
> 
> <xsd:element name="Text">
>   <xsd:complexType mixed="true">
>     <xsd:sequence>
>       <xsd:element name="Link" type="xsd:string" minOccurs="0" maxOccurs="1" />
>     </xsd:sequence>
>   </xsd:complexType>
> </xsd:element>
> 
> .xml
> <Text>
>   This is example text
>   <Link>link 1 </Link>
>   This is some more example text
>   <Link>link 2 </Link>
>   This is the end of the example text
> <Text>
> 
> 
> 
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-dev

----------------------------------------------------------- 
If you wish to unsubscribe from this mailing, send mail to
[EMAIL PROTECTED] with a subject of:
        unsubscribe castor-dev

Reply via email to