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

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 UTC