Attribute 'maxOccurs' cannot appear in element 'element' ..!!!! :(

Hi I am trying to validate an xml against the schema..and i get the following error :

Attribute 'maxOccurs' cannot appear in element 'element'

where my xsd is :

<?xml version="1.0" encoding="UTF-8"?>

<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified">

<xs:element name="_Record_" maxOccurs="unbounded">

<xs:complexType>

<xs:sequence>

<xs:element name="ParCo" type="xs:string"/>

<xs:element name="PrdId" type="xs:integer"/><xs:element name="EventID" type="xs:integer"/>

<xs:element name="ProdCaID" type="xs:string"/>

<xs:element name="EvStDa" type="xs:long"/>

<xs:element name="Volume" type="xs:integer"/>

<xs:element name="UOM1" type="xs:string"/>

</xs:sequence>

</xs:complexType>

</xs:element>

</xs:schema>

and the given xml is :

<_Record_>

<EventID>1</EventID>

<EvStDa>20050101010101</EvStDa>

<ParCo>DUMMYPRT</ParCo>

<UOM1>KB</UOM1>

<Volume>10</Volume>

<PrdId>1</PrdId>

<ProdCaID>PC</ProdCaID>

</_Record_>

even if i remove the maxoccurs thing i still en error like :

Invalid content starting with element 'EventID'. One of '{"":ParCo}' is expected.

the only workaround i find is removing maxoccurs and sorting the elements in the sequence given in XSD. i.e somewhat like this :

<_Record_>

<ParCo>DUMMYPRT</ParCo>

<PrdId>1</PrdId>

<EventID>1</EventID>

<ProdCaID>PC</ProdCaID>

<EvStDa>20050101010101</EvStDa>

<Volume>10</Volume>

<UOM1>KB</UOM1>

</_Record_>

[1932 byte] By [@developer@a] at [2007-11-27 8:10:09]
# 1
okie the latter part is ofcourse understood since they would appear only in the sequence specified in the XSD...so the only problem is the behaviour of maxOccurs!!
@developer@a at 2007-7-12 19:53:33 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...
# 2
Elements specified in xsd:sequence are required to be specified in the same sequence in the XML document.maxOccurs may not be specified on a top level element as defined in<xs:element name="_Record_" maxOccurs="unbounded">
dvohra09a at 2007-7-12 19:53:33 > top of Java-index,Enterprise & Remote Computing,Enterprise Technologies...