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

Re: Validation with <xs:anyAttribute namespace="##other"/>

From: Jeni Tennison <jeni@jenitennison.com>
Date: Tue, 12 Mar 2002 11:44:22 +0000
Message-ID: <122611684996.20020312114422@jenitennison.com>
To: "Max Voskob" <Max.Voskob@telecom.co.nz>
CC: xmlschema-dev@w3.org
Hi Max,

> Example:
> <?xml version="1.0" encoding="UTF-8"?>
> <root xmlns="myNS" xmlns:zzz="myNS-zzz"
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:schemaLocation="myNS faultxsd.xsd" validAtt="aaa"
> undeclared:invalid="bbb" justInvalid="ccc">
>         <zzz:invalid>ddd</zzz:invalid>
> </root>
> The document above is valid for the schema below according to XML
> Spy 4.3 with MS XML 4. To my understanding the document is not
> valid.

The document isn't valid according to the Namespace Recommendation,
because you haven't got a namespace declaration for the prefix
'undeclared'. Schema validators can only work on documents that adhere
to the Namespace Recommendation.

If you add that namespace declaration:

<root xmlns="myNS"
      xsi:schemaLocation="myNS test.xsd" 

Then MSXML4 reveals three errors:

 - the attribute undeclared:invalid is not defined in the schema
 - the attribute justinvalid is not defined in the schema
 - the element zzz:invalid is used but not declared in the schema

which is what I'd expect from the schema that you've specified.



Jeni Tennison
Received on Tuesday, 12 March 2002 06:44:24 UTC

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