1 50 51 package org.openlaszlo.iv.flash.xml.jaxen; 52 53 import org.openlaszlo.iv.flash.xml.XPathProcessor; 54 import java.util.Iterator ; 55 import javax.xml.transform.TransformerException ; 56 import org.jaxen.JaxenException; 57 import org.jaxen.dom.DOMXPath; 58 import org.w3c.dom.Node ; 59 60 61 68 public class XPathProcessorImpl implements XPathProcessor { 69 70 78 public Iterator selectNodeList(String path, Node node) throws TransformerException { 79 try { 80 DOMXPath xpath = new DOMXPath(path); 81 return xpath.selectNodes(node).iterator(); 82 } catch (JaxenException e) { 83 throw new TransformerException (e); 84 } 85 } 86 87 95 public Node selectSingleNode(String path, Node node) throws TransformerException { 96 try { 97 DOMXPath xpath = new DOMXPath(path); 98 return (Node )xpath.selectSingleNode(node); 99 } catch (JaxenException e) { 100 throw new TransformerException ((Throwable )e); 101 } 102 } 103 } 104 | Popular Tags |