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

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

From: Michael Kay <mike@saxonica.com>
Date: Thu, 12 Mar 2009 11:20:47 -0000
To: "'Pete Cordell'" <petexmldev@codalogic.com>, <xmlschema-dev@w3.org>
Message-ID: <5FDF1864414A4AB3B2F0E8A101F2B1D0@Sealion>
> 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 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
Received on Thursday, 12 March 2009 11:21:35 UTC

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