1 8 package org.apache.avalon.excalibur.xml.xpath; 9 10 import org.apache.avalon.framework.thread.ThreadSafe; 11 import org.apache.avalon.framework.component.Component; 12 import org.apache.avalon.framework.logger.AbstractLoggable; 13 import org.w3c.dom.Node ; 14 import org.w3c.dom.NodeList ; 15 import org.apache.xpath.XPathAPI; 16 17 32 public class XPathProcessorImpl 33 extends AbstractLoggable 34 implements XPathProcessor, ThreadSafe 35 { 36 45 public Node selectSingleNode(Node contextNode, String str) 46 { 47 try { 48 return XPathAPI.selectSingleNode(contextNode, str); 49 } catch (javax.xml.transform.TransformerException e){ 50 return null; 51 } 52 } 53 54 62 public NodeList selectNodeList(Node contextNode, String str) 63 { 64 try { 65 return XPathAPI.selectNodeList(contextNode, str); 66 } catch (javax.xml.transform.TransformerException e){ 67 return new NodeList (){ 68 public Node item(int index) { return null;} 69 public int getLength(){return 0;} 70 }; 71 } 72 } 73 } 74 | Popular Tags |