Altova Mailing List Archives>Archive Index >xmlschema-dev Archive Home >Recent entries [Thread Prev] >Thread Next - restriction against base type (choice - elt) Re: Ignore Order while validating XSDTo: "C. M. Sperberg-McQueen" <cmsmcq@---.--->, xmlschema-dev@--.--- Date: 1/26/2009 12:08:00 PM You=B4re completly write. I=B4d 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=B4t it? Another problem I had is using xs:all inside the xs:group cause an error. I= s it not possible? Thanks again, and sorry my mistake! Eduardo 2009/1/26 C. M. Sperberg-McQueen <cmsmcq@a...> > > On 26 Jan 2009, at 04:55 , Eduardo Oliveira wrote: > > Hello Mr. Sperberg-McQueen! >> >> That=B4s 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"=B4s maxOccurs="unbounded", eliminating the sec= ond >> 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/ > > > > | ||||||
| Company | Legal | Press | Partners | Careers | Sitemap | Contact Us | Altova Blog | Mobile | Full Site | |||
|
