Package org.kuali.rice.kew.xml.xstream
Class XStreamSafeEvaluator
java.lang.Object
org.kuali.rice.kew.xml.xstream.XStreamSafeEvaluator
Evaluates simple XPath expressions to follow paths through a document generated by XStream which uses
"reference" elements to handle circular and duplicate references. For example, an XML document
generated from XStream might look like the following:
<test>
<a>hello</a>
<b>
<a reference="../../a"/>
</b>
</test>
In the above case, the XPath expression /test/a would result in the "hello" text but the XPath expression /test/b/a would result in the empty string. However, if the evaluator below is mapped as an XPath function, than it could be used as follows on the second expression to produce the desired result of "hello": xstreamsafe('/test/b/a', root())
- Author:
- Kuali Rice Team (rice.collab@kuali.org)
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionEvaluates the given XPath expression against the given Node while following reference attributes on Nodes in a way which is compatible with the XStream library.getXpath()void
-
Constructor Details
-
XStreamSafeEvaluator
public XStreamSafeEvaluator() -
XStreamSafeEvaluator
-
-
Method Details
-
evaluate
public NodeList evaluate(String xPathExpression, Node rootSearchNode) throws XPathExpressionException Evaluates the given XPath expression against the given Node while following reference attributes on Nodes in a way which is compatible with the XStream library.- Throws:
XPathExpressionException- if there was a problem evaluation the XPath expression.
-
getXpath
-
setXpath
-