com.ten60.netkernel.util
Class FastXPath
java.lang.Object
com.ten60.netkernel.util.FastXPath
- public class FastXPath
- extends 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 List |
eval(Node aContextNode,
String aXPath)
Returns a nodeset of matching nodes for the evaluation of the xpath
at the given context node |
static Node |
getSingleNode(Node aContextNode,
String aXPath)
|
static boolean |
isSuitable(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 List eval(Node aContextNode,
String aXPath)
throws TransformerException
- Returns a nodeset of matching nodes for the evaluation of the xpath
at the given context node
- Throws:
TransformerException
getSingleNode
public static Node getSingleNode(Node aContextNode,
String aXPath)
throws TransformerException
- Throws:
TransformerException
isSuitable
public static boolean isSuitable(String aXPath)
- Returns true if it is possible to evaluate the xpath using this engine
Copyright © 2002-2004 1060 Research Ltd. All Rights Reserved.