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

RE: group or abstract type?

From: Mikael Joukakelian <mikaelj@cae.com>
Date: Fri, 6 Sep 2002 11:11:40 -0400
Message-ID: <719A38AB7279D511B91900D0B7444A9E02611703@caemsx03.cae.ca>
To: "'ht@cogsci.ed.ac.uk'" <ht@cogsci.ed.ac.uk>
Cc: xmlschema-dev@w3.org

Thank you for pointing out that the SEVERITY is 0. However, my problem
remains unsolved. 

ERROR TYPE: 2 means:
"2/ XML_SCHEMA_REPRESENTATION : an error occurred because the XML
representation is not valid against DTD for Schema and/or against other
constraints on the way an XML Schema should be represented as XML document.

And also MSXML4.0 returns a S_FALSE (meaning, the document is invalid
according to schema) when I validate an instance of this schema. 

Is there any way of resolving my errors?

Thanks in advance.

-----Original Message-----
From: ht@cogsci.ed.ac.uk [mailto:ht@cogsci.ed.ac.uk]
Sent: Friday, September 06, 2002 5:37 AM
To: Mikael Joukakelian
Cc: xmlschema-dev@w3.org
Subject: Re: group or abstract type?

Mikael Joukakelian <mikaelj@cae.com> writes:

> Consider the following schema which, if I understood the email below
> correctly, is valid:
> <?xml version="1.0" encoding="UTF-8"?>
> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
> elementFormDefault="qualified" attributeFormDefault="unqualified">
> 	<xs:element name="AbstractMenuEntry" abstract="true"/>
> 	<xs:element name="MenuStructure">
> 		<xs:complexType>
> 			<xs:sequence>
> 				<xs:element ref="AbstractMenuEntry"
> maxOccurs="unbounded"/>
> 			</xs:sequence>
> 		</xs:complexType>
> 		<xs:unique name="menuIdConstraint">
> 			<xs:selector xpath="MenuEntry"/>
> 			<xs:field xpath="@menuId"/>
> 		</xs:unique>
> 	</xs:element>
> 	<xs:element name="MenuEntry" substitutionGroup="AbstractMenuEntry">
> 		<xs:complexType>
> 			<xs:attribute name="menuId"/>
> 		</xs:complexType>
> 	</xs:element>
> </xs:schema>
> This validates in XML Spy, but not in MSXML4.0 and SQC2.1.1. Until
> I was using XML Spy and life was easy, but I also need to use MSXML4.0 and
> get the following error message from SQC2.1.1: 
> No node in element MenuStructure corresponds to <xs:selector
> xpath="MenuEntry"/>
>  defined in <xs:unique name="menuIdConstraint">
>     <selector xpath="MenuEntry"/>
>     <field xpath="@menuId"/>
> </xs:unique>
> . Invalid XPath starting from MenuStructure:MenuEntry.

Note this is SEVERITY: 0.  Your schema is valid.

> XML Spy doesn't even check if menuId exists anywhere, that is, changing
> <xs:field xpath="@menuId"/> to <xs:field xpath="@menuId777"/> would not
> generate an error. Would this be a W3C conformant schema even if menuId777
> does not exist? 

Yes.  There's nothing to stop you writing XPaths that are never satisfied.

  Henry S. Thompson, HCRC Language Technology Group, University of Edinburgh
          W3C Fellow 1999--2002, part-time member of W3C Team
     2 Buccleuch Place, Edinburgh EH8 9LW, SCOTLAND -- (44) 131 650-4440
	    Fax: (44) 131 650-4587, e-mail: ht@cogsci.ed.ac.uk
		     URL: http://www.ltg.ed.ac.uk/~ht/
 [mail really from me _always_ has this .sig -- mail without it is forged
Received on Friday, 6 September 2002 11:13:20 GMT

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