Share via


IDocumentHandler.SetDocumentLocator(ILocator) Method

Definition

Caution

deprecated

Receive an object for locating the origin of SAX document events.

[Android.Runtime.Register("setDocumentLocator", "(Lorg/xml/sax/Locator;)V", "GetSetDocumentLocator_Lorg_xml_sax_Locator_Handler:Org.Xml.Sax.IDocumentHandlerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")]
[System.Obsolete("deprecated")]
public void SetDocumentLocator (Org.Xml.Sax.ILocator? locator);
[<Android.Runtime.Register("setDocumentLocator", "(Lorg/xml/sax/Locator;)V", "GetSetDocumentLocator_Lorg_xml_sax_Locator_Handler:Org.Xml.Sax.IDocumentHandlerInvoker, Mono.Android, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null")>]
[<System.Obsolete("deprecated")>]
abstract member SetDocumentLocator : Org.Xml.Sax.ILocator -> unit

Parameters

locator
ILocator

An object that can return the location of any SAX document event.

Attributes

Remarks

Receive an object for locating the origin of SAX document events.

SAX parsers are strongly encouraged (though not absolutely required) to supply a locator: if it does so, it must supply the locator to the application by invoking this method before invoking any of the other methods in the DocumentHandler interface.

The locator allows the application to determine the end position of any document-related event, even if the parser is not reporting an error. Typically, the application will use this information for reporting its own errors (such as character content that does not match an application's business rules). The information returned by the locator is probably not sufficient for use with a search engine.

Note that the locator will return correct information only during the invocation of the events in this interface. The application should not attempt to use it at any other time.

Java documentation for org.xml.sax.DocumentHandler.setDocumentLocator(org.xml.sax.Locator).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to

See also