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
