When schema types are known, Saxon examines path expressions and issues warnings when the path cannot select anything because it is inconsistent with the schema. Two cases have been found where these warnings are spurious, because although the declared type has no children or attributes, there are types derived from that type by extension that do have such children or attributes. These cases are
(a) when the declared type has complex content with an empty content model
(b) when the declared type is a simple type (a complex type with simple content can be defined by extending a simple type, with the addition of attributes.)
Case (a) arises in the FpML schema, where the base type Document (an abstract type) is extended to define the content model of all valid messages. Case (b) is not known to have arisen in practice.
In some cases, after issuing a warning that the path cannot select anything, Saxon generates code that makes use of this inference, which means that if the inference were wrong, the path expression would select nothing. In both these cases, however, the path expression is correctly evaluated despite the warning.
Case (a) will be fixed in the 9.0 branch in any future maintenance release of Saxon-SA. Case (b) is more difficult to fix, and this will have to wait till Saxon 9.1.
Case (b) is particularly complicated by the fact that it is possible to define a complex type (with simple content) that extends a built-in type such as xs:string. To cope with types derived by extension, Saxon ensures consistency between the compile-time schema and the run-time schema by "sealing" any namespace used at compile time, so that types in that namespace cannot subsequently have new subtypes defined by extension. Sealing the XML Schema namespace, however, might give usability problems. Instead, the proposed solution is that Saxon will continue to report warnings based on the extended types that are known at compile-time, but will generate run-time code that executes correctly if new extended types are subsequently introduced.