Non-Deterministic Schema

Description

With a non-deterministic schema, the parser cannot determine a sequence for the elements in the document being processed. The following XML Schema example shows a non-deterministic schema. The W3C Standard specifically disallows such schemas, but some tools will allow you to create them, and tell you they are valid ( they are not!) .

If you see this error then there is a problem with your schema, not with Liquid XML.

<?xml version="1.0" encoding="utf-8" ?> <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"> <xs:element name="root" type="rootTypes" /> <xs:complexType name="myKitchen"> <xs:choice> <xs:sequence> <xs:element name="apple"/> <xs:element name="berry"/> </xs:sequence> <xs:sequence> <xs:element name="apple"/> <xs:element name="coffee"/> </xs:sequence> </xs:choice> </xs:complexType> </xs:schema>

During the processing of an instance document against the preceding non-deterministic schema, when the parser encounters the element root followed by an element apple, it is unable to determine, without looking ahead to the next element, if the <apple> element is the first part of the sequence of <apple> and <berry> or the first part of the sequence of <apple> and <coffee>. As the parser used by the Schema Object Model (SOM) does not perform forward checking, the parser generates the error message 'Content model must be deterministic' when validation is attempted using a non-deterministic schema.

Notes

Descrption Value
Article Created 7/2/2006
Versions All