I've come across a couple of bugs in schema handling, specifically dealing with min & max occurrences on elements and sequences. If an element has a minOccur='0' and maxOccur > 1 and the element is not present in the xml file being validated, then the validation fails. See attached elem.* files for test case. Also minOccur and maxOccur on sequence are not handled at all. I (hopefully) fixed the problems in xmlSchemaBuildAContentModel with the attached patch, but I don't really understand the automata routines so the patch needs checking. The patch also adds a check for unbounded case when building a model for choice types. Charlie B.
Attachment:
elem.xsd
Description: Text document
Attachment:
elem.xml
Description: Text Data
Attachment:
seq.xsd
Description: Text document
Attachment:
seq.xml
Description: Text Data
Attachment:
xmlschemas.pat
Description: Text document