Hi Avinash,

Castor treats xsd:sequence and xsd:all basically the same. Castor
primarily does object model validation and from an object model
perspective the order is typically not important. The Castor object
validation just checks that the values exist and that they're in the
correct range and value space as specified in the schema. We plan on
supporting order, but it's just not a high priority, especially since
this can be achieved by the parser itself.

If order is important to you, then you can simply enable parser
validation. The XML parser will verify that the order is correct during
the parsing.

We do realize that this adds additional overhead to Castor, which is why
we plan on supporting order natively. To help alleviate this additional
overhead however, you can disable the object model validation in Castor.
If the parser has validated the XML instance, you should be able to
assume that the unmarshalled object model is valid.

--Keith


Avinash Lakshman wrote:
> 
> Hi
> 
> I noticed that Castor doesn't care about order of a elements that are defined as 
> complexTypes in the Schema file. For instance if I define an element as,
> 
> <xs:element name="TEST" >
>       <xs:complexType>
>              <xs:sequence>
>                        <xs:element name="A" type="xsd:string" />
>                        <xs:element name="B" type="xsd:string" />
>             </xs:sequence>
>     </xs:complexType>
> </xs:element>
> 
> and if the element appears in the Xml as,
> 
> <TEST>
>      <B>Foo</B>
>     <A>Bar</A>
> </TEST>
> 
> Castor unmarshalls it without complaining about the order. Shouldn't order be 
> respected ? Any reasons why this is ignored ?
> 
> Thanks
> Avinash
> 
> -----------------------------------------------------------
> 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