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

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

From: <vobla73@paradise.net.nz>
Date: Thu, 07 Mar 2002 11:31:24 +1300 (NZDT)
To: xmlschema-dev@w3.org
Message-ID: <1015453884.3c8698bce9c0c@www.paradise.net.nz>
Hello people,

XML Spy 4.3 doesn't try to obtain the schema for the required namespaces and 
validate any element and attribute from non-target namespaces. It always says 
that the document is valid whatever you place in the document. Basically it 
does processContent="skip" even if u set it to strict.

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.

Please, tell me if it is correct that the document above is valid for the 
schema below.


<?xml version="1.0" encoding="UTF-8"?>
<xs:schema targetNamespace="myNS" xmlns="myNS" 
xmlns:xs="http://www.w3.org/2001/XMLSchema" elementFormDefault="qualified" 
attributeFormDefault="unqualified">
	<xs:element name="root">
		<xs:complexType>
			<xs:sequence>
				<xs:any minOccurs="0" maxOccurs="unbounded" 
namespace="##other" processContents="strict"/>
			</xs:sequence>
			<xs:attribute name="validAtt"/>
			<xs:anyAttribute namespace="##other" 
processContents="strict"/>
		</xs:complexType>
	</xs:element>
</xs:schema>

Attributes "undeclared:invalid" and "justInvalid" are not declared in the 
schema above.
Element "zzz:invalid" wasn't declared either.
processContent is strict in both cases.


Thanx,
Max 
Received on Wednesday, 6 March 2002 17:31:34 GMT

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