When you run validation from the command line then the validator will in general continue after an error, and will report all the errors that it finds. There's no need to set any special options. (The message you cited was using the validation API, which is different).

However, the validator does try to avoid reporting spurious errors. For example if you misspell an element name, it tries to avoid giving you two errors, one for the presence of the unknown element and one for the absence of the expected element. Similarly, if it can't find a schema declaration for a particular element, it generally won't give you any errors that relate to the subtree below that element. This means that if it can't find a top-level declaration for the root element, you will typically only get one error.

If there are cases where you think multiple errors should be reported but aren't, then I would be interested to see the test case - it's only by looking at real error cases arising in the wild that one can fine-tune the diagnostics.

Michael Kay

On 20/03/2012 12:59, John Janssen wrote:
Apologies if this has already been asked, but the markmail searchable archives seem to be unreachable.
During our XML processing we plan to validate user input XML against an XSD, using the following command line call:
/usr/bin/java –cp /tools/saxon/saxon9ee.jar com.saxonica.Validate –s:myinput.xml –xsd:myschema.xsd
Unfortunately during testing this only returned the first error, and never a complete list of problems, which we would very much prefer.
Using stackoverflow I found this little gem: http://stackoverflow.com/questions/7351478/xsd-validation-using-saxon-api
which seems to relate to the same problem, only in a C#.NET context. Delving through the documentation I found the suggested solution there should translate to the command line option “--validation-warnings”, but adding this to my command line call does not seem to produce a more complete list of validation error either.
So does this not work for command line, is my research wrong, or is a complete list of errors as output just not possible?
Maybe someone could suggest another solution in that case?

This SF email is sponsosred by:
Try Windows Azure free for 90 days Click Here 

saxon-help mailing list archived at http://saxon.markmail.org/