I have logic that maintains the current xpath of a series of documents:
<path>/rootNode[itg:fts(.,' "information to find" ')]</path>
where itg:fts() is a full text search and the double-quotes in the search string serves to designate a phrase to search instead of tokens.
I want to find the particular document element by matching on the value of path with this evaluation:
String query = "//document[path=\"/rootNode[itg:fts(.,'"information to find"')]\"]";
NodeList nodes = (NodeList) xpath.evaluate(query,documents,XPathConstants.NODESET);
but the evaluation returns no nodes. I'm expecting the entity " to match the literal double-quote in the element path. It doesn't seem to work. There are literal quotes also in the predicate of the string. Any ideas how to solve this?