# Conformance with XML Schema 1.0

The schema-aware version of the Saxon product (Saxon-SA) includes an almost complete implementation of XML Schema 1.0. This version of the product is available from Saxonica Limited.

Known limitations include the following:

- Default or fixed values specified for an element whose type is a complex type with complex content are ignored when validating instance documents.

- Facets are evaluated according to XPath rules rather than XML Schema rules. For example, the pattern syntax allows the extended syntax permitted in the XPath `matches()` function, and comparisons against facets such as `minInclusive` and `maxInclusive` follow the XPath semantics for the `lt` and `gt` operators. This may be slightly different when comparing values such as dates, times, and durations.

- Saxon imposes limits on the values of `minOccurs` and `maxOccurs` appearing on any particle in a content model. These limits are designed to prevent out-of-memory errors. By default, the upper limit for `minOccurs` is 100 and the upper limit for `maxOccurs` is 250. If these limits are exceeded, a warning is output, and the values specified are replaced with the highest allowed value (which is "unbounded" in the case of `maxOccurs`). The limits are configurable using the method `setOccurrenceLimits()` in the class `SchemaAwareConfiguration`. If they are set too high, however, out-of-memory or stack overflow errors will occur either during schema compilation or during instance validation.

- Uniqueness and key/keyref constraints are implemented only where the keys are atomic values (that is, they are not implemented for list-valued elements or attributes). Also, where element values participate in such constraints they must not be interleaved with comments or processing instructions. When evaluating these constraints, equality of values is assessed according to XPath rules rather than XML Schema rules. This means, for example, that a decimal and a double can be equal to each other, which is never the case under the XML Schema rules. (However, the schema processor never treats strings and anyURI values as equal, even though they can now be equal under XPath.)

- ID and IDREF constraints are checked only for values typed as `xs:ID`, `xs:IDREF`, or `xs:IDREFS`. They are not checked for types derived from these base types.

- Any failure to resolve a QName in a schema document (that is, a reference within a schema to a component that has not been defined) is treated as a fatal error. The XML schema specification says this should only be an error if the component is actually required for validation.

- Saxon implements schema processing only to the extent required for XPath, XSLT, and XQuery processing. This means that PSVI properties beyond those required for the XPath data model are not provided. It also means that validation errors are fatal, they do not result in a PSVI that indicates the validation outcome for individual nodes.

- Elements and attributes of type `xs:ENTITY` or `xs:ENTITIES` are not checked against the list of unparsed entities declared in the document. (This check is not required during XSLT or XQuery validation, but it is required by standalone schema validation.)

- Saxon uses a different algorithm to evaluate type subsumption from the one given in the specification. The Saxon algorithm (an implementation of the algorithm published by Henry Thompson and Richard Tobin of the University of Edinburgh) is more accurate than the one in the W3C specification in deciding whether one complex type subsumes another.

- Saxon also uses the Thomson and Tobin algorithm to evaluate the Unique Particle Attribution constraint. In a few cases this permits constructs that are unambiguous, but are not allowed according to the W3C specification. Specifically, no UPA violation is reported when a complex type contains two element particles that are references to the same element declaration, since the element declaration can be identified unambiguously.

Expand | Next