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

Re: qname resolution question

From: Jeni Tennison <jeni@jenitennison.com>
Date: Mon, 31 Dec 2001 20:54:40 +0000
Message-ID: <731716137.20011231205440@jenitennison.com>
To: "Takuki Kamiya" <takuki@pacbell.net>
CC: xmlschema-dev@w3.org
Hi Taki,

> I am wondering if the following schema is valid or not. Both XSV and
> xerces passes validation with it.
> What is the namespace name for the "documentBody" qname below? Is it
> "http://www.w3.org/2001/XMLSchema", or is it none (as
> targetNamespace is not provided)?

The schema is not valid because the reference to the QName
'documentBody' is resolved using the default namespace, which is the
XML Schema namespace http://www.w3.org/2001/XMLSchema. The schema
validator looks for an element declaration for
{http://www.w3.org/2001/XMLSchema}documentBody, and finds none, and
should give an error (XSV, MSV and Xerces-C++ all give an error).

To create a schema for no namespace in which you reference types and
element/attribute declarations, you need to use a prefix for the XML
Schema namespace:

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

<xs:element name = "envelope">
      <xs:element ref = "documentBody"/>

<xs:element name = "documentBody" type="anyType"/>



Jeni Tennison
Received on Tuesday, 1 January 2002 04:52:25 UTC

This archive was generated by hypermail 2.3.1 : Wednesday, 7 January 2015 14:55:54 UTC