Arnaud Blandin ([EMAIL PROTECTED]) wrote:
> 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.

Thanks for the timely reply!

I'm wondering why it's not a requirement?  Is it because the Java
object to XML mapping can be done without using mixed content, and
that is the direction that defines 'necessary'?

Is this a feature which I'm free to add and you will or won't give me
a bit of support getting started, or is it a feature which is not
wanted in Castor?

Sorry, I'm still trying to figure out the why ;)

> 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.

Ah, interesting thought.  I think you can see why I wouldn't change
the schema -- after all, we design schemas for a reason, in this case
that reason has to do with the customer since this XML will
(initially) be created by hand.  BUT, I hadn't considered the XSLT
approach.  I must admit it would make more sense to me if it was in
Castor, but you're right, it'll work with XSLT pre-processing.

        Gary

> 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
>
>

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

Reply via email to