This section looks at the process of XML Schema validation.
Although a full treatment of XML Schema is beyond the scope of this tutorial, this section shows you the steps you take to validate an XML document using an XML Schema definition.
But, through this approach, we cannot get information about all validation errors in the XML file in a single run.
If an XML file has multiple validation errors (say four), then in first run, the exception will be thrown as soon as the first error will be encountered and we do not get to know about remaining three errors.
SAXException; public class XMLValidation Employee validates against Employee.xsd? true Exception: cvc-elt.1: Cannot find the declaration of element ' Employee'.
Recently in my project, I had a requirement to validate XML file against XSD schema file and list all validation errors.
The validation process verify that an XML document is an instance of a specified XML schema file or XSD file.
Best Regards klein zhang thanks for giving useful reply i tried but still i am unable to validate XML.If I use "Extern Validation" everything works fine.But if I use the validate-button or a validation-scenario, in which I specify the schema-file above, the validation is always correct, although I have made an obvious mistake in the xml-file (e.g.valid (What I think is wrong.) I may understand this three different approaches in the wrong way.I don't really understand the difference between "Extern Validation" and "Validation Scenario". And if I use the "Validation Button", shouldn't oxygen use the schema location specified in the xml-file to validate against.We can use ‘line Number’ and ‘column Number’ fields of SAXParse Exception object to know where exactly the error is.