MSXML Validation Fails - Error 1072898035

Hello everybody.

	I'm creating a new Web Application based on MSXML 4.0 about
digital music management and distribution. I'm working on a batch
procedure to import songs data in a DataBase. I've created this schema:

<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="http://localhost/Liquid/XML/Schema"
xmlns="http://localhost/Liquid/XML/Schema"
xmlns:xs="http://www.w3.org/2001/XMLSchema"
elementFormDefault="qualified" attributeFormDefault="unqualified">
	<xs:annotation>
		<xs:documentation xml:lang="EN">
			Songs schema for batch data import.
			Copyright  XXX. All rights reserved.
		</xs:documentation>
	</xs:annotation>
	<xs:element name="catalogue">
		<xs:complexType>
			<xs:sequence maxOccurs="unbounded">
				<xs:choice>
					<xs:sequence>
						<xs:element name="song">
							<xs:complexType>
	
<xs:sequence>
	
<xs:element name="barcode" type="barcodeType"/>
	
<xs:element name="volume" type="xs:positiveInteger"/>
	
<xs:element name="track" type="xs:positiveInteger"/>
	
<xs:element name="title" type="notNullStringType"/>
	
<xs:element name="duration" type="xs:time"/>
	
<xs:element name="price" type="xs:decimal"/>
	
</xs:sequence>
	
<xs:attribute name="ISRC" type="ISRCType" use="optional"/>
	
<xs:attribute name="streaming30" type="xs:boolean" use="required"/>
	
<xs:attribute name="preview" type="xs:boolean" fixed="false"/>
	
</xs:complexType>
						</xs:element>
					</xs:sequence>
					<xs:sequence>
						<xs:element name="song">
							<xs:complexType>
	
<xs:sequence>
	
<xs:element name="barcode" type="barcodeType"/>
	
<xs:element name="volume" type="xs:positiveInteger"/>
	
<xs:element name="track" type="xs:positiveInteger"/>
	
<xs:element name="title" type="notNullStringType"/>
	
<xs:element name="duration" type="xs:time"/>
	
<xs:element name="price" type="xs:decimal"/>
	
<xs:element name="previewExpirationDate" type="xs:date"/>
	
<xs:element name="previewPrice" type="xs:decimal"/>
	
</xs:sequence>
	
<xs:attribute name="ISRC" type="ISRCType" use="optional"/>
	
<xs:attribute name="streaming30" type="xs:boolean" use="required"/>
	
<xs:attribute name="preview" type="xs:boolean" fixed="true"/>
	
</xs:complexType>
						</xs:element>
					</xs:sequence>
				</xs:choice>
			</xs:sequence>
		</xs:complexType>
	</xs:element>
	<xs:simpleType name="barcodeType">
		<xs:restriction base="xs:string">
			<xs:length value="13"/>
			<xs:pattern value="\d{13}"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="ISRCType">
		<xs:restriction base="xs:string">
			<xs:length value="15"/>
			<xs:pattern value="\d{15}"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="notNullStringType">
		<xs:restriction base="xs:string">
			<xs:pattern value=".+"/>
		</xs:restriction>
	</xs:simpleType>
	<xs:simpleType name="priceType">
		<xs:restriction base="xs:string">
			<xs:pattern value="[0-9]+\.[0,9]{2}"/>
		</xs:restriction>
	</xs:simpleType>
</xs:schema>


This is an example file base on this schema:


<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<catalogue xmlns="http://localhost/Liquid/XML/Schema"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://localhost/Liquid/XML/Schema
C:\Inetpub\wwwroot\Liquid\XML\schema\ImportBrani.xsd">
	<song ISRC="123456789012345" streaming30="true" preview="true">
		<barcode>1234567890123</barcode>
		<volume>1</volume>
		<track>1</track>
		<title>Song 1</title>
		<duration>00:03:20</duration>
		<price>1.20</price>
	
<previewExpirationDate>2003-01-01</previewExpirationDate>
		<previewPrice>2.40</previewPrice>
	</song>
	<song streaming30="true" preview="false">
		<barcode>1234567890123</barcode>
		<volume>1</volume>
		<track>2</track>
		<title>Song 2</title>
		<duration>00:03:46</duration>
		<price>1.20</price>
	</song>
	<song streaming30="true" preview="true">
		<barcode>1234567890123</barcode>
		<volume>1</volume>
		<track>3</track>
		<title>Song 3</title>
		<duration>00:03:33</duration>
		<price>1.20</price>
	
<previewExpirationDate>2003-01-01</previewExpirationDate>
		<previewPrice>1.40</previewPrice>
	</song>
</catalogue>

While validating this file with XMLSpy I've no errors, but if I try to
import the file with MSXML this error is returned:

Error : -1072898035
Line/Col: 2/218

The element 'catalogue' is used but not declared in the DTD/Schema.

Probably it could be a MSXML 4.0 bug... Could you help me to resolve it?

Thanks.

Received on Tuesday, 9 September 2003 11:01:40 UTC