}
public boolean process(XPointerContext xpointerContext) throws SAXException, ResourceNotFoundException {
Document document = xpointerContext.getDocument();
ServiceManager manager = xpointerContext.getServiceManager();
XPathProcessor xpathProcessor = null;
try {
try {
xpathProcessor = (XPathProcessor)manager.lookup(XPathProcessor.ROLE);
} catch (Exception e) {
throw new SAXException("XPointerPart: error looking up XPathProcessor.", e);
}
NodeList nodeList = xpathProcessor.selectNodeList(document, expression, xpointerContext);
if (nodeList.getLength() > 0) {
XMLConsumer consumer = xpointerContext.getXmlConsumer();
LocatorImpl locator = new LocatorImpl();
locator.setSystemId(xpointerContext.getSource().getURI());
consumer.setDocumentLocator(locator);