I have designed an XML schema in which defines the data structures expected in an xml file that our software will import. This is used to validate the files.
The current problem is that the validation passes any correctly formatted xml file that does not contain any of our data structures. Is it possible to put something in the schema that says that at least one instance of our toplevel datatype must be included in the file?. I know using minOccurs="1" but I can only see how to use with a definition of a datatype - not the xml file itself.
Somebody used a simple XML file from a different system and tried to validate it with my schema and it passed - because it contained no data structures that were defined in the schema. I wondered if the schema can be modified to detect this situation.
I can modify my import code to report when the file contains no relevant data - but I would really like the schema to catch this situation when the file is validated using a standard Microsoft validation function.