W3C home > Mailing lists > Public > xmlschema-dev@w3.org > August 2002

HELP: schema validation error

From: <ajerbi@mmm.com>
Date: Wed, 7 Aug 2002 10:20:49 -0400 (EDT)
To: xmlschema-dev@w3.org
Message-ID: <OF2333BF79.8264B783-ON86256C0E.004C8B9F@mmm.com>

I use the following parser to parse my XML data:
Here is the schema I am using:
     Define the Request element
  <xs:element name="request">
          <xs:group ref="requestGroup"/>
          <xs:element ref="field" minOccurs="0" maxOccurs="unbounded"/>
     Define the request group
  <xs:group name="requestGroup">
       <xs:element name="facilityName" type="xs:string"/>
       <xs:element name="printerName" type="xs:string" />
       <xs:element name="copies" type="xs:positiveInteger" default="1"/>

     Define the Field element
  <xs:element name="field">
       <xs:attribute name="name" type="xs:string" use="required"/>
       <xs:attribute name="value" type="xs:string" use="required"/>

Here is the error message I get when I parse an xml file that uses the
above schema with the following parser: org.apache.xerces.parsers.SAXParser
Error:  cos-all-limited.1.2: A group whose content is "all" must only
appear as the content type of a complex type definition.  Saw group in
I don't get this error when I use a different parser.

My goal is to write a schema that will allow the 'request' element to have
the first three elements ('facilityName','printerName','copies') in any
order possible followed by any number of 'field' elements.

Is it possible to write such a schema? I would appreciate any help. Thank

Received on Thursday, 8 August 2002 05:40:25 UTC

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