com.ten60.netkernel.util
Class FastXPath
java.lang.Object
com.ten60.netkernel.util.FastXPath
public class FastXPath
- extends java.lang.Object
A Fast implementation XPath for simple expressions.
Evaluation shows it is an order of magnitude faster than xalan and will
work for about 2/3 of expressions in normal usage.
It will evaluate xpaths of the forms:
- /a/b (absolute)
- a/b (relative)
- /a/* /c (disregard name)
- /a/b[1] (element position)
|
Method Summary |
static java.util.List |
eval(org.w3c.dom.Node aContextNode,
java.lang.String aXPath)
Returns a nodeset of matching nodes for the evaluation of the xpath
at the given context node |
static org.w3c.dom.Node |
getSingleNode(org.w3c.dom.Node aContextNode,
java.lang.String aXPath)
|
static boolean |
isSuitable(java.lang.String aXPath)
Returns true if it is possible to evaluate the xpath using this engine |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
FastXPath
public FastXPath()
eval
public static java.util.List eval(org.w3c.dom.Node aContextNode,
java.lang.String aXPath)
throws javax.xml.transform.TransformerException
- Returns a nodeset of matching nodes for the evaluation of the xpath
at the given context node
- Throws:
javax.xml.transform.TransformerException
getSingleNode
public static org.w3c.dom.Node getSingleNode(org.w3c.dom.Node aContextNode,
java.lang.String aXPath)
throws javax.xml.transform.TransformerException
- Throws:
javax.xml.transform.TransformerException
isSuitable
public static boolean isSuitable(java.lang.String aXPath)
- Returns true if it is possible to evaluate the xpath using this engine
Copyright © 2002-2004 1060 Research Ltd. All Rights Reserved.