String query2 ="for $cd in /CATALOG/CD" + " return $cd/TITLE/text()";
XQSequence results = expression.executeQuery(query2);When i run it , error:
XPDY0002: Finding root of tree: the context item is undefined
javax.xml.xquery.XQException: Finding root of tree: the context item is undefined
I know that you cant create new elements with XPath, but I can select and compare elements and put my new elements in a Stringbuffer (Java) and then print it to my screen am I right ?But an other meaby better solution is XQuery or XSLT?!. Can I do this also in Java ?I have to use Java not only XML documents to do ths Job.Thank you for quick replying.