I appreciate immensely all of your help and insight. The castor api is a
model for anyone that wants to measure there own success.

I think I can control the element order by starting at my root class and
calling the unmarshal method on each child node. I only have two concrete
classes in the api, Application and Component but I have two interface
classes Behavior and Control. The Control implementation is where a
developer would create events and behavior method would respond to those
events. If I can figure out a way to get the event collection populated
before any other methods get called on a control I can ensure that the
events will fire when they are expected to.

Have you looked into http://www.w3.org/TR/2003/REC-xml-events-20031014/ ? I
am not exactly trying to support this model but I am moving toward being
able to describe events that get executed on a remote machine if the event
criteria is present.



----- Original Message -----
From: "Keith Visco" <[EMAIL PROTECTED]>
To: <[email protected]>
Sent: Saturday, February 19, 2005 1:25 PM
Subject: Re: [castor-user] unmarshal sequence


>
> Bryan,
>
> During unmarshalling (XML->Java) elements are processed in document
> order, meaning the order in which they appear in the XML instance
> document. Since Castor uses SAX, it's stream based processing, so there
> is no way specify and order for which you'd like to elements to be
> processed. In the future we may prodive a means to specify unmarshalling
> order when we add support for pull parsing (Stax)...if you really want
> to enforce order today you'll need to provide your own SAX
> ContentHandler which can store elements and attributes as passed in from
> the XML Parser, handle the re-ordering, and then pass on the events to
> the Castor Unmarshaller in the order in which you want them processed.
>
> Attributes have no such guarantee to be processed in any particular
> order. They are simply processed in the order in which the XML parser
> decides to store them in the SAX AttributeList/Attributes objects. Keep
> in mind that the XML Specification itself states that attributes have no
> particular order.
>
> During Marshalling, Castor will output elements in the order in which
> they were defined in the mapping file (or XML Schema if you are using
> generated source + generated descriptors). Again, Attributes have no
> guaranteed ordering.
>
> --Keith
>
> Bryan LaPlante wrote:
> > I am interested in the order in which the elements and attributes get
> > unmarshalled. Is there any kind of interface or class I can extend that
will
> > allow me to tell the Unmarshaller to process my attributes in a
particular
> > order.
> >
> > I am concerned with events getting processed before any other attribute
that
> > may rely on it at the destination machine.
> >
> > Bryan LaPlante
> >
> >
> >
> > -----------------------------------------------------------
> > If you wish to unsubscribe from this mailing, send mail to
> > [EMAIL PROTECTED] with a subject of:
> >         unsubscribe castor-user
> >
> >
>
>
>
> -----------------------------------------------------------
> If you wish to unsubscribe from this mailing, send mail to
> [EMAIL PROTECTED] with a subject of:
>         unsubscribe castor-user



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

Reply via email to