I have an XPath expression that searches for a static value. In this example, \"test\" is that value:
XPathExpression expr = xpath.compile(\"//doc[contains(.
You don't need to evaluate Java (or whatever else PL variables in XPath). In C# (don't know Java well) I'll use:
string XPathExpression = "//doc[contains(., " + myVar.ToString() + ")]/*/text()"; XmlNodelist result = xmlDoc.SelectNodes(XPathExpression);