W3C home > Mailing lists > Public > xmlschema-dev@w3.org > January 2009

Re: Ignore Order while validating XSD

From: Eduardo Oliveira <eduardo.oliveirared@gmail.com>
Date: Mon, 26 Jan 2009 14:08:16 -0200
Message-ID: <f7c898bc0901260808o4c866dex3fa21aa0032a7c17@mail.gmail.com>
To: "C. M. Sperberg-McQueen" <cmsmcq@acm.org>, xmlschema-dev@w3.org
Youīre completly write.
Iīd detected this problem.
To fix it, I group my fields in a group tag and use it before and after the
"a" element, for instance.
It is because I have so many fields to repeat in the code as the present
example...
Even, I have a problem because I can not limit the repeating size because
the elements are inside an unbounded size choice element, isnīt it?
Another problem I had is using xs:all inside the xs:group cause an error. Is
it not possible?

Thanks again, and sorry my mistake!

Eduardo

2009/1/26 C. M. Sperberg-McQueen <cmsmcq@acm.org>

>
> On 26 Jan 2009, at 04:55 , Eduardo Oliveira wrote:
>
>  Hello Mr. Sperberg-McQueen!
>>
>> Thatīs ok! Your solution run as I expected it to run!
>>
>> I just took the freedom to make a little change to reduce the code size,
>> setting the element "a"īs maxOccurs="unbounded", eliminating the second
>> block  as below!
>>
>> Thanks a lot!
>>
>> Eduardo
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
>> elementFormDefault="qualified">
>>  <xs:element name="root">
>>    <xs:complexType >
>>      <xs:sequence>
>>        <xs:choice minOccurs="0" maxOccurs="unbounded">
>>          <xs:element name="b"/>
>>          <xs:element name="c"/>
>>          <xs:element name="x"/>
>>        </xs:choice>
>>        <xs:element name="a" maxOccurs="unbounded"/>
>>      </xs:sequence>
>>    </xs:complexType>
>>  </xs:element>
>> </xs:schema>
>>
>
> This is fine, if you do not mind the sequence
>
>  <b/><b/><a/><b/>
>
> being rejected.  I didn't have the impression, from the sketches using
> choice and all, that the 'a' element was required to be the last one,
> or that 'b', 'c', and 'x' were forbidden to appear after the 'a'. But
> if that doesn't trouble you, then yes, the second choice can be dropped.
>
> --
>  C. M. Sperberg-McQueen, W3C XML Activity
>  http://www.w3.org/People/cmsmcq
>  http://cmsmcq.com/mib/
>  http://www.balisage.net/
>
>
>
>
Received on Monday, 26 January 2009 18:31:53 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 23:15:50 UTC