Javax.Xml.Validation.ValidatorHandler Class
Streaming validator that works on SAX stream.

See Also: ValidatorHandler Members

Syntax

[Android.Runtime.Register("javax/xml/validation/ValidatorHandler", DoNotGenerateAcw=true)]
public abstract class ValidatorHandler : Java.Lang.Object, Org.Xml.Sax.IContentHandler, IDisposable

Remarks

Streaming validator that works on SAX stream.

A Javax.Xml.Validation.ValidatorHandler object is a thread-unsafe, non-reentrant object. In other words, it is the application's responsibility to make sure that one Javax.Xml.Validation.ValidatorHandler object is not used from more than one thread at any given time.

Javax.Xml.Validation.ValidatorHandler checks if the SAX events follow the set of constraints described in the associated Javax.Xml.Validation.Schema, and additionally it may modify the SAX events (for example by adding default values, etc.)

Javax.Xml.Validation.ValidatorHandler extends from Org.Xml.Sax.IContentHandler, but it refines the underlying Org.Xml.Sax.IContentHandler in the following way:

  1. startElement/endElement events must receive non-null String for uri, localName, and qname, even though SAX allows some of them to be null. Similarly, the user-specified Org.Xml.Sax.IContentHandler will receive non-null Strings for all three parameters.
  2. Applications must ensure that Javax.Xml.Validation.ValidatorHandler's Org.Xml.Sax.IContentHandler.StartPrefixMapping(string, System.String) and Org.Xml.Sax.IContentHandler.EndPrefixMapping(string) are invoked properly. Similarly, the user-specified Org.Xml.Sax.IContentHandler will receive startPrefixMapping/endPrefixMapping events. If the Javax.Xml.Validation.ValidatorHandler introduces additional namespace bindings, the user-specified Org.Xml.Sax.IContentHandler will receive additional startPrefixMapping/endPrefixMapping events.
  3. Org.Xml.Sax.IAttributes for the Org.Xml.Sax.IContentHandler.StartElement(string, System.String, System.String, System.String) method may or may not include xmlns* attributes.

A Javax.Xml.Validation.ValidatorHandler is automatically reset every time the startDocument method is invoked.

Recognized Properties and Features

This spec defines the following feature that must be recognized by all Javax.Xml.Validation.ValidatorHandler implementations.

http://xml.org/sax/features/namespace-prefixes

This feature controls how a Javax.Xml.Validation.ValidatorHandler introduces namespace bindings that were not present in the original SAX event stream. When this feature is set to true, it must make sure that the user's Org.Xml.Sax.IContentHandler will see the corresponding xmlns* attribute in the Org.Xml.Sax.IAttributes object of the Org.Xml.Sax.IContentHandler.StartElement(string, System.String, System.String, System.String) callback. Otherwise, xmlns* attributes must not be added to Org.Xml.Sax.IAttributes that's passed to the user-specified Org.Xml.Sax.IContentHandler.

(Note that regardless of this switch, namespace bindings are always notified to applications through Org.Xml.Sax.IContentHandler.StartPrefixMapping(string, System.String) and Org.Xml.Sax.IContentHandler.EndPrefixMapping(string) methods of the Org.Xml.Sax.IContentHandler specified by the user.)

Note that this feature does NOT affect the way a Javax.Xml.Validation.ValidatorHandler receives SAX events. It merely changes the way it augments SAX events.

This feature is set to false by default.

[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