Mark Wilson I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :
03/24/2008
Times viewed :
134
The org.xml.sax.Locator Interface
All Known Implementing Classes: org.xml.sax.helpers.LocatorImpl
Members
Signature
Public methods
int
getColumnNumber()
int
getLineNumber()
String
getPublicId()
String
getSystemId()
Overview
This
interface is a complement to an XML document or other parsed constructs, as it
provides the document’s system ID and public ID as well as information about
the location within the file being processed. This is particularly helpful for
use in IDE applications and for identifying where errors occur in parsing
Method Overviews
The
first method you need to define is one that sets an org.xml.sax.Locator for use
within any other sax events. When callback event occurs, the class implanting a
handler often needs access to location of the SAX parser within an XML file. This
is used to help the application make decision about the event and its location
within the XML document, such as determining the line on which an error occur. The
Locator class has several usefull methods such as getLineNumber() and
getColumnNumber() that return the current location for the parsing process
within an XML file when invoked. Because this location is only valid for the
current parsing lifecycle, the Locator should be used only within the scope of
the ContentHandler Implementation. Since this might be handy to use later, the
code shown here saves the provided Locator instance to a member variable.
public
class ContentHandlerImpl implements ContentHandler{
/** Hold onto the locator for
location information*/