*/
public boolean element2Locator(Element e, SimpleLocator l) {
if (l == null)
return false;
if (e instanceof ElementImpl) {
ElementImpl ele = (ElementImpl)e;
// get system id from document object
Document doc = ele.getOwnerDocument();
String sid = (String)fDoc2SystemId.get(doc);
// line/column numbers are stored in the element node
int line = ele.getLineNumber();
int column = ele.getColumnNumber();
l.setValues(sid, sid, line, column);
return true;
}
if (e instanceof ElementNSImpl) {
ElementNSImpl ele = (ElementNSImpl)e;
// get system id from document object
Document doc = ele.getOwnerDocument();
String sid = (String)fDoc2SystemId.get(doc);
// line/column numbers are stored in the element node
int line = ele.getLineNumber();
int column = ele.getColumnNumber();
l.setValues(sid, sid, line, column);
return true;
}
return false;
}