IDocumentHandler.SetDocumentLocator(ILocator) 方法

定义

注意

deprecated

接收用于查找 SAX 文档事件的源的对象。

[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

参数

locator
ILocator

可以返回任何 SAX 文档事件的位置的对象。

属性

注解

接收用于查找 SAX 文档事件的源的对象。

强烈建议 SAX 分析器(尽管不是绝对必需的)提供定位符:如果这样做,则必须在调用 DocumentHandler 接口中的其他任何方法之前调用此方法向应用程序提供定位符。

定位符允许应用程序确定任何与文档相关的事件的结束位置,即使分析器未报告错误也是如此。 通常,应用程序将使用此信息报告自己的错误(例如与应用程序的业务规则不匹配的字符内容)。 定位符返回的信息可能不足以与搜索引擎一起使用。

请注意,定位符仅在调用此接口中的事件期间返回正确的信息。 应用程序不应尝试在其他任何时间使用它。

Java文档org.xml.sax.DocumentHandler.setDocumentLocator(org.xml.sax.Locator)

本页的某些部分是根据 创建和共享的工作进行的修改,并根据 许可证中所述的条款使用。

适用于

另请参阅