Hi Gary,
you're right, Castor doesn't preserve the order of text nodes used as mixed
content.
This is not a requirement for a data-binding framework, it can be seen more
as a nice
feature.
As Keith pointed some days ago, you can whether change your XML and add some
wrapper tags around
your text or if you don't want to change your XML, you can always use an
XSLT
stylesheet to transform your XML before trying to unmarshal it.
Hope this helps,
Arnaud
> -----Original Message-----
> From: Gary Shea [mailto:[EMAIL PROTECTED]]
> Sent: Thursday, August 02, 2001 2:13 AM
> To: [EMAIL PROTECTED]
> Subject: [castor-dev] mixed content question
>
>
> I've never tried mixed content before, but today I was experimenting
> with something like
>
> <element name="in-list">
> <complexType mixed="true">
> <sequence>
> <element name="in" minOccurs="0" maxOccurs="unbounded">
> <complexType>
> <attribute name="name" type="string"/>
> </complexType>
> </element>
> </sequence>
> </complexType>
> </element>
>
> (Hopefully I got that right ;)
>
> where the input might look something like:
>
> <in-list>
> This is a list of in objects like <in name="dog"/>
> or <in name="cat"/>
> </in-list>
>
> I want to be able to treat the content as a list of strings
> interleaved with <in> objects, something that could be created
> with a sequence of statements like:
>
> content[0]="This is a list of in objects like ";
> content[1]=new In ("dog");
> ...
>
> I get the impression (although I'm not positive yet) that the castor
> result will instead give me all the text run together in a String, and
> a separate list of In objects. Hopefully I'm just missing something!
>
> What I'm looking for is a hint on whether it works the way I think it
> does, and if so, if there is a legitimate way to change the
> unmarshalling so that it does what I want to do. If this is indeed
> possible, I'm happy to take on the coding, but could use a few
> pointers on where to start.
>
> Thanks!
>
> Gary
>
> -----------------------------------------------------------
> 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