posted 13 years ago
You're asking "Given an XML document, how can I find a schema against which it will validate successfully?" Of course there is no possible answer to that, except perhaps to produce a schema which allows all documents as valid.
If you ask the user, and the user tells you the wrong schema, then the document will be invalid. There is no way you can distinguish this case from the case where the user tells you the right schema but the document is not valid according to that schema. It's up to the user to figure out what's going on in that case, not the programmer.