W3C home > Mailing lists > Public > xmlschema-dev@w3.org > November 2003

RE: XML Schema:

From: Zafar Abbas <zafara@microsoft.com>
Date: Tue, 4 Nov 2003 18:38:24 -0800
Message-ID: <563BD3496D37BB4B9F4E8F896A58F2B3171429@RED-MSG-50.redmond.corp.microsoft.com>
To: "Srinivasan, Sriram" <SSrinivasan@filenet.com>, <xmlschema-dev@w3.org>

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

-----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. 
  <Description>My Test Script</Description>
  <Usage>Usage description</Usage>
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

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:56:03 UTC