語言

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 介面中的其他方法。

定位器允許應用程式判斷任何文件相關事件的終點位置,即使解析器未回報錯誤。 通常,應用程式會利用這些資訊來回報自身的錯誤(例如字元內容與應用程式的商業規則不符)。 定位器回傳的資訊可能不足以供搜尋引擎使用。

請注意,定位器僅在此介面中呼叫事件時才會回傳正確資訊。 應用程式不應在其他時間嘗試使用該資料。

org.xml.sax.DocumentHandler.setDocumentLocator(org.xml.sax.Locator)Java 檔。

此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。

適用於

另請參閱