Compartir a través de


ISAXLocator

A version of this page is also available for

Windows Embedded CE 6.0 R3

4/8/2010

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 ISAXContentHandler::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

ISAXLocator::getColumnNumber Method

Returns the column number where the current document event ends.

ISAXLocator::getLineNumber Method

Returns the line number where the current document event ends.

ISAXLocator::getPublicId Method

Returns the public identifier for the current document event.

ISAXLocator::getSystemId 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 ISAXContentHandler::startDocument Method event, the application should assume that a locator is not available.

Requirements

Header msxml2.h, msxml2.idl
Library uuid.lib
Windows Embedded CE Windows CE .NET 4.0 and later
Windows Mobile Windows Mobile Version 5.0 and later

See Also

Reference

XML SAX Interfaces