I am trying to evaluate XPath Expression "/feed/entry/title" using:
NodeList nodeList = (NodeList) inputXMLxpath.evaluate("/feed/entry/title", xmlDoc,
XPathConstants.NODESET);
If the xmlDoc is like this:
<?xml version="1.0" encoding="UTF-8"?>
<feed>
<entry>...
<feed>
I get proper results, but when xmlDoc is like this:
<?xml version="1.0" encoding="UTF-8"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en-US">
<entry>...
</feed>
the result of XPath evaluation is always an empty list.
Can anybody tell the reason for this and suggest a solution such that I get proper result in second case also?