- From: Srinivasan, Sriram <SSrinivasan@filenet.com>
- Date: Tue, 4 Nov 2003 18:14:57 -0800
- To: <xmlschema-dev@w3.org>
- Message-ID: <2CFDD422D26CF442AB21AFFFCF33AEC37714DE@hq-ex2kpo1.filenet.fn.com>
I have the following sample XML. <TestScript> <Description>My Test Script</Description> <FileName>sample.in</FileName> <Usage>Usage description</Usage> <PreTest> ..... </PreTest> <Test> ..... </Test> <PostTest> ..... </PostTest> </TestScript> All these element can appear only once. The Description, FileName is required. Usage is optional. And the PreTest, Test and PostTest sections are required. The order of the Description, FileName and Usage elements is not important. that is they are an unordered list of elements. But they should appear before the PreTest, Test and PostTest element. But the order of the PreTest, Test and PostTest elements are important and should be in that order. how do u specify a schema for this. I tried defining a group with xs:all containing the Description, FileName and Usage elements. And then for the element TestScript i defined a complex type which is a sequence of the group and the PreTest, Test and PostTest elements. Wheni try to validate this, i get the following error: org.xml.sax.SAXParseException: cos-all-limited.1.2: An 'all' model group must appear in a particle with {min occurs} = {max occurs} = 1, and that particle must be part of a pair which constitutes the {content type} of a complex type definition. Any help on this. I havent defined any min occurs or maxoccurs for the xs:all element.
Received on Tuesday, 4 November 2003 21:24:29 UTC