Code example for Locator

Methods: getPublicId, getSystemId

0
                public void setDocumentLocator( Locator loc ) {
                    this.locator = loc;
                } 
                public void startDocument() { 
                    if ( locator != null ) {
                        systemId = locator.getSystemId();
                        publicId = locator.getPublicId();
                    } 
                } 
                public void startElement( String namespaceURI, String localName,
                                          String qName, Attributes atts ) {
                    if ( ! started ) { 
                        topLocalName = localName;
                        topNamespaceURI = namespaceURI;
                        topAtts = atts;
                        started = true;
                    } 
                } 
                public void startPrefixMapping( String prefix, String uri ) {
                    namespaces.add( uri );
                }