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

Re: MSXML Validation Fails - Error 1072898035

From: Paul Kiel <paul@hr-xml.org>
Date: Wed, 10 Sep 2003 14:36:21 -0400
Message-ID: <006201c377ca$6ecc7ca0$6701a8c0@monkeyboy>
To: "EVANGELISTA Luca" <luca@webmediastrategy.com>, <xmlschema-dev@w3.org>
I don't get the same error as you, but I do see that your schema is non-deterministic.  How can the parser know which "song" element is in an instance given the schema?  It can't.  You can either rename one of them or you could simply eliminate one and make the additional two elements optional.  Perhaps something like this?

<xs:schema targetNamespace="http://localhost/Liquid/XML/Schema" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns="http://localhost/Liquid/XML/Schema" 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>
<xs:element name="song" maxOccurs="unbounded">
<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" minOccurs="0"/>
<xs:element name="previewPrice" type="xs:decimal" minOccurs="0"/>
</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"/>
</xs:complexType>
</xs:element>
</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>



----- Original Message ----- 
From: "EVANGELISTA Luca" <luca@webmediastrategy.com>
To: <xmlschema-dev@w3.org>
Sent: Tuesday, September 09, 2003 5:44 AM
Subject: 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 Wednesday, 10 September 2003 14:36:20 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Tuesday, 11 January 2011 00:14:39 GMT