RE: Behaviour when unknown xsi:type or subst group member found

> 
> Can you remind me what a schema enabled XML processor should 
> do if it encounters an unknown xsi:type when parsing an 
> instance?  Should it just skip over it, or flag an error etc.

References are to XSD 1.1.

Assuming that the xsi:type attribute is being validated (i.e., not skipped),
then under 3.2.4.1 Attribute Locally Valid, the xsi:type attribute itself is
not locally valid and this will be exposed in the value of its [validity]
property in the PSVI (the spec doesn't speak of "flagging an error").
> 
> Similarly, what is the desired behaviour when an unknown 
> substitution group member is found (or an unknown element is 
> encountered where a substitution group member element might 
> be expected [I guess the element could be optional]).

If you encounter an unknown element, you have no way of knowing whether it
might have been intended to be a member of the substitution group of an
element that would be permitted in that context. The element is invalid
against the content model defined by the type of the parent element.
> 
> Oh, and while I'm here, does the whitespace facet have any 
> affect on attribute values, or are attribute values always collapsed?
> 

Assuming there is no DTD, attribute values are first normalized as defined
in the XML spec (3.3.3) for CDATA attributes, which basically means
replacing each unescaped x9, xA, or xD character by a single x20 character.
Then XSD-defined whitespace facet rules are applied to the result.

Michael Kay
http://www.saxonica.com/

Received on Thursday, 12 March 2009 11:21:35 UTC