Hi,
Thanks very much for your answer.

I checked the schema and did not find the <xsd:all> compositor 
so I guess that is why order matters in this case.

Thanks again !

-----Message d'origine-----
De : norwoods [mailto:[EMAIL PROTECTED] 
Envoyé : mercredi 31 août 2005 19:34
À : [email protected]
Objet : Re: XML schema validation: order matters or not ?


the answer is, of course, it depends.  since you did not include the 
schema it is hard to make a definitive answer.  if your schema was like 
the following:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
        xmlns="http://test"; 
        targetNamespace="http://test";>
    <xsd:element name="father" type="father"/>
    <xsd:element name="child1"/>
    <xsd:element name="child2"/>
    <xsd:element name="child3"/>
    <xsd:complexType name="father">
        <xsd:sequence>
            <xsd:element name="child1"/>
            <xsd:element name="child2"/>
            <xsd:element name="child3"/>
        </xsd:sequence>
    </xsd:complexType>
</xsd:schema>
then order does matter because of the <xsd:sequence> compositor but if 
your schema was like:
<?xml version="1.0" encoding="UTF-8"?>
<xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema";
        xmlns="http://test"; 
        targetNamespace="http://test";>
    <xsd:element name="father" type="father"/>
    <xsd:element name="child1"/>
    <xsd:element name="child2"/>
    <xsd:element name="child3"/>
    <xsd:complexType name="father">
        <xsd:all>
            <xsd:element name="child1"/>
            <xsd:element name="child2"/>
            <xsd:element name="child3"/>
        </xsd:all>
    </xsd:complexType>
</xsd:schema>
then order does not matter because of the <xsd:all> compositor.

norwood sisson


Celinio Fernandes wrote:

>Hi,
>I have a question regarding the validation of an XML file myfile.xml 
>against his schema myfile.xsd, through the validate() method with 
>XMLbeans:
>
>If in my XSD schema file, I specified this order:
>
><father>
>       <child1></child1>
>       <child2></child2>
>       <child3></child3>
></father>
>
>
>And that I want to validate this XML file (child3 is before child2):
>
><father>
>       <child1>aa</child1>
>       <child3>cc</child3>
>       <child2>bb</child2>
></father>
>
>
>The validate() method says that child2 is expected but not found.
>
>So, in other words, it seems that order matters when validating an XML 
>file against a schema: am i right or wrong ?
>
>Thanks for your answers.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: [EMAIL PROTECTED]
>For additional commands, e-mail: [EMAIL PROTECTED]
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to