Subject:   Parsing a Namespace node with JDK 5.0
Date:   2006-02-22 09:15:26
From:   Gerg
Response to: Parsing a Namespace node with JDK 5.0

I'm getting an unexplanatory XPathExpressionException when I evaluate the following xpath


after setting a namespace context

NamespaceContextImpl nsctx = new NamespaceContextImpl();
nsctx.setNamespaceURI("xml", "");
nsctx.setNamespaceURI("xhtml", "");

The source XML document is an XHTML web page with its root element being declared as belonging to namespace:

<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "">
<html xml:lang="en" xmlns="">

I can't see anything wrong with the xpath expression, nor can I find any documentation explaining why an XPathExpressionException would be thrown in this case.

Could you tell any possisble causes for the exception being thrown?