1 50 51 package org.openlaszlo.iv.flash.xml.caucho; 52 53 import org.openlaszlo.iv.flash.xml.*; 54 55 import java.util.Iterator ; 56 import org.w3c.dom.*; 57 import javax.xml.transform.TransformerException ; 58 59 import com.caucho.xpath.*; 60 61 68 public class XPathProcessorImpl implements XPathProcessor { 69 70 78 public Iterator selectNodeList(String expr, Node node) throws TransformerException { 79 try { 80 return XPath.select(expr, node); 82 } catch( XPathException e ) { 83 throw new TransformerException (e); 84 } 85 } 86 87 95 public Node selectSingleNode(String expr, Node node) throws TransformerException { 96 try { 97 Iterator it = XPath.select(expr, node); 99 if( it.hasNext() ) return (Node) it.next(); 100 return null; 101 } catch( XPathException e ) { 102 throw new TransformerException (e); 103 } 104 } 105 } 106 107 108 109 110 | Popular Tags |