Javax.Xml.Validation.Validator.Validate Method
Validates the specified input and send the augmented validation result to the specified output.

Syntax

[Android.Runtime.Register("validate", "(Ljavax/xml/transform/Source;Ljavax/xml/transform/Result;)V", "GetValidate_Ljavax_xml_transform_Source_Ljavax_xml_transform_Result_Handler")]
public abstract void Validate (Javax.Xml.Transform.ISource source, Javax.Xml.Transform.IResult result)

See Also

Validator.Validate(Javax.Xml.Transform.ISource)

Parameters

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.

Exceptions

TypeReason
Java.Lang.IllegalArgumentExceptionIf 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.SAXExceptionIf 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.IOExceptionIf the validator is processing a Javax.Xml.Transform.Sax.SAXSource and the underlying Org.Xml.Sax.IXMLReader throws an Java.IO.IOException.
Java.Lang.NullPointerExceptionIf the source parameter is null.

Remarks

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.

Javax.Xml.Transform.ISource/Javax.Xml.Transform.Result accepted:

Javax.Xml.Transform.Sax.SAXSourceJavax.Xml.Transform.Dom.DOMSourceJavax.Xml.Transform.Stream.StreamSource
nullOKOKOKOK
Javax.Xml.Transform.Sax.SAXResultOKErrErrErr
Javax.Xml.Transform.Dom.DOMResultErrOKErrErr
Javax.Xml.Transform.Stream.StreamResultErrErrErrOK

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.

[Android Documentation]

Requirements

Namespace: Javax.Xml.Validation
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 8