Compartir a través de


ISAXLocator:IUnknown (Windows CE 5.0)

Send Feedback

The ISAXLocator interface associates a Simple API for XML (SAX) event with a document location. The SAX2 reader provides location information by implementing this interface and passing an instance to the application using the putDocumentLocator method of the ISAXContentHandler interface. The application can use the Locator object to obtain the location of any other document handler event in the XML source document.

The Locator object has a one-to-one relationship with the reader. As a result, each new event updates the information inside the Locator object. For example, an application saves a reference to the Locator object for handler call A. After that, the application tries to access the Locator object in handler call B. The information provided by the Locator object is now specific to handler call B because the object updates with each event. Correct usage for the Locator object is to save a reference to it within the content handler and access it from there. For ErrorHandler methods, the Locator object is passed as a parameter.

Method Description
getColumnNumber This method returns the column number where the current document event ends.
getLineNumber This method returns the line number where the current document event ends.
getPublicId This method returns the public identifier for the current document event.
getSystemId This method returns the system identifier for the current document event.

Remarks

Results returned by the object are valid only during the scope of each document handler method. The application receives unpredictable results if it attempts to use the locator at any other time. If the reader supplies a locator, it must do so before reporting any other document events. If no locator is set by the time the application receives the startDocument event, the application should assume that a locator is not available.

Requirements

OS Versions: Windows CE .NET 4.0 and later.
Header: Msxml2.h, Msxml2.idl.
Link Library: Uuid.lib.

Send Feedback on this topic to the authors

Feedback FAQs

© 2006 Microsoft Corporation. All rights reserved.