using XPath to find node under a context node does not work (firefox/firebug/javascript)

You are calling evaluate on the document. Hence, the XPath expression is being evaluated from the root of the XML tree. Also, if you want XPath to select a node from within the current context, e.g. among the children of the current node, you should use the .// context selector.


If you start an XPath expression with "/" then you are starting down from the root node/document node of the context node. So instead of "//div[@class = 'title']" use "descendant::div[@class = 'title']", that way you are selecting the descendant div elements of the context node.