Hi Nicolas

From: "Nicolas Fonrose" <[EMAIL PROTECTED]>
> When I don't put namespaces (ie prefixes) in my XPath expressions,
> DOM4J strangely behaves as if the document was not containing
> namespaces ! Is this a normal behavior ?

AFAIK when you don't put prefixes in an XPath expression it should just
match on local name only (i.e. ignores prefixes). So I think thats correct
behaviour. Do you think it should behave otherwise?


> As one can expect, when I include NS prefixes in the requests, DOM4J
> is not able to use the expression because it doesn't have the
> bindings beetween the prefixes and URIs. It produces the following
> message :
>
> SHORT_CIRCUIT: NO_NAMESPACE
>
> Is it possible to "inform" DOM4J's XPath engine about these bindings ?

Well spotted Nicolas, you found a bug! Many thanks.

I've just patched the code and checked it into CVS so XPath expressions
using namespace prefixes should work now.

I've also added a JUnit test case that should ensure this stays working
(though I'm sure the JUnit test case could be improved somewhat). If you're
interested its in src/test/org/dom4j/xpath/TestPrefix.java

The daily build should include these fixes also so if you upgrade to either
the current CVS image or the daily build you should have this problem fixed
for you. The 0.5 release will happen some time this week so this patch will
make it into a stable release number soon.

James



_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com


_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
http://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to