Validating xml file in java validating digital signature


The simple Java tool for validating XML against one or more XSDs has now been shown (complete code listing is at bottom of post). The sample application shown and explained here attempts to demonstrate that and is a useful tool for simple command line validation of XML documents against specified XSDs.

The complete code listing for the Java-based XML validation tool discussed in this post is included at the end of the post. Validator is obtained from the /** * Validate provided XML against the provided XSD schema files.

The most significant lines of code from that application when discussing validation of XML against one or more XSDs is shown next. Schema Schema(Source[]) (where the array of transform. * * @param xml File Path And Name Path/name of XML file to be validated; * should not be null or empty.

In other words, XSDs with no “include” dependencies will generally be provided on the command line before those XSDs that include them.

The next code listing is for the complete package dustin.examples.xmlvalidation; import sax.

There are numerous tools available for validating an XML document against an XSD.