- source
- XML to be validated. Must not be null.
- result
- The Javax.Xml.Transform.Result object that receives (possibly augmented) XML. This parameter can be null if the caller is not interested in it. Note that when a Javax.Xml.Transform.Dom.DOMResult is used, a validator might just pass the same DOM node from Javax.Xml.Transform.Dom.DOMSource to Javax.Xml.Transform.Dom.DOMResult (in which case source.getNode()==result.getNode()), it might copy the entire DOM tree, or it might alter the node given by the source.
Type Reason Java.Lang.IllegalArgumentException If the Javax.Xml.Transform.Result type doesn't match the Javax.Xml.Transform.ISource type, or if the specified source is not a Javax.Xml.Transform.Sax.SAXSource, Javax.Xml.Transform.Dom.DOMSource or Javax.Xml.Transform.Stream.StreamSource. Org.Xml.Sax.SAXException If the Org.Xml.Sax.IErrorHandler throws a Org.Xml.Sax.SAXException or if a fatal error is found and the Org.Xml.Sax.IErrorHandler returns normally. Java.IO.IOException If the validator is processing a Javax.Xml.Transform.Sax.SAXSource and the underlying Org.Xml.Sax.IXMLReader throws an Java.IO.IOException. Java.Lang.NullPointerException If the source parameter is null.
Validates the specified input and send the augmented validation result to the specified output.
This method places the following restrictions on the types of the Javax.Xml.Transform.ISource/Javax.Xml.Transform.Result accepted.
To validate one Javax.Xml.Transform.ISource into another kind of Javax.Xml.Transform.Result, use the identity transformer (see Javax.Xml.Transform.TransformerFactory.NewTransformer).
Errors found during the validation is sent to the specified Org.Xml.Sax.IErrorHandler.
If a document is valid, or if a document contains some errors but none of them were fatal and the Org.Xml.Sax.IErrorHandler didn't throw any exception, then the method returns normally.