The problem is your default namespace, you will have to map this
namespace to a prefix and use the prefix in your xpath expressions

HashMap map = new HashMap();
map.put("html", "http://www.w3.org/1999/xhtml";);

XPath xpath = doc.createXPath("/html:html/html:head/html:title");
xpath.setNamespaceContext(new SimpleNamespaceContext(map));

System.out.println(xpath.evaluate(document));

There are no "tbody" elements in the document. Please try the following instead:

xpath = 
doc.createXPath("/html:html/html:body/html:table/html:tr/html:td/html:table[2]/html:tr/html:td/html:table[2]//html:tr");
xpath.setNamespaceContext(new SimpleNamespaceContext(map));

System.out.println(xpath.evaluate(document));

Regards,
Edwin
-- 
http://www.edankert.com/

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
dom4j-user mailing list
dom4j-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to