|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.taleo.integration.client.customstep.util.XPathHelper
public class XPathHelper
XPath Helper.
Constructor Summary | |
---|---|
XPathHelper()
Constructor without argument. |
|
XPathHelper(javax.xml.namespace.NamespaceContext nsContext)
Constructor with the namespace context. |
Method Summary | |
---|---|
Object |
evaluate(InputStream xml,
String xPath,
javax.xml.namespace.QName returnType)
Evaluate an XPath expression on an XML fragment. |
Object |
getVariable(Object name)
Get a variable value. |
void |
setVariable(String name,
Object value)
Set a variable to be resolved while evaluating XPath. |
static String |
stripNamespacePrefixes(String xPath)
Strip the namespace prefixes from an XPath expression. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public XPathHelper()
Note that this instance cannot evaluate XPath expressions that use any namespace.
public XPathHelper(javax.xml.namespace.NamespaceContext nsContext)
Note that this instance cannot evaluate XPath expressions that use the default namespace.
nsContext
- The namespace context to evaluate the XPath expression.Method Detail |
---|
public void setVariable(String name, Object value)
name
- The variable name.value
- The variable value.public Object getVariable(Object name)
name
- The variable name.
public Object evaluate(InputStream xml, String xPath, javax.xml.namespace.QName returnType) throws ParserConfigurationException, SAXException, IOException, javax.xml.xpath.XPathExpressionException
xml
- The XML fragment as an InputStream.xPath
- The XPathExpression as a String.returnType
- The return type as defined in XPathConstants
.
ParserConfigurationException
SAXException
IOException
javax.xml.xpath.XPathExpressionException
public static String stripNamespacePrefixes(String xPath)
This is useful because SAXReader
does not work with
namespaces.
For example, the XPath "/x:A/y:B/C" would result in "/A/B/C".
xPath
- The XPath expression.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |