RE: XML Schema:

Xml Schema Primer Section 2.7: Building Content Models:
<snip> 
	XML Schema stipulates that an all group must appear as the sole child at the top of a content model.
</snip>


-----Original Message-----
From: xmlschema-dev-request@w3.org [mailto:xmlschema-dev-request@w3.org] On Behalf Of Srinivasan, Sriram
Sent: Tuesday, November 04, 2003 6:15 PM
To: xmlschema-dev@w3.org
Subject: XML Schema:




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:38:31 UTC