RE: parsing a xml file against the schema

Hi again,

After looking at it more closely, I found a problem in your schema.  You have an element declaration that looks like this:

<xs:element name="Amount" maxOccurs="3">
	<xs:complexType>
		<xs:simpleContent>
			<xs:restriction base="xs:decimal">
				<xs:totalDigits value="10"/>
				<xs:fractionDigits value="2"/>
			</xs:restriction>
		</xs:simpleContent>
	</xs:complexType>
</xs:element>

You can't restrict a simple type to result in a complex type with simple content.  It should look like this instead:

<xs:element name="Amount" maxOccurs="3">
	<xs:simpleType>
		<xs:restriction base="xs:decimal">
			<xs:totalDigits value="10"/>
			<xs:fractionDigits value="2"/>
		</xs:restriction>
	</xs:simpleType>
</xs:element>

Once I changed that, I got the expected errors from Xerces-J 2.0.1 (for the strings instead of integer values).

Hope that helps!

Priscilla

-----------------------------------------------------
Priscilla Walmsley             priscilla@walmsley.com
Author, Definitive XML Schema     (Prentice Hall PTR)
-----------------------------------------------------

Received on Tuesday, 16 April 2002 14:44:34 UTC