Hi Eddie,

I think zero is the correct number. 

The point is that XPath does not have the notion of "default namespace". 
If names are unprefixed in XPath, they are understood as not belonging to any 
namespace. Even if your document defines a default namespace, the XPath 
expressions you want to match against that document should contain prefixed 
names. Something like /x:a/x:b/x:c. And don't forget to bind this prefix to 
the same namespace URI as the default namespace in your document. 

The prefixes you use in your XPaths are totally unrelated to those you use in 
your documents. They are just symbolic links to the namespace URIs. Strange 
as it may seem at the first sight, match of an element/attribute to a XPath 
location step is defined as the equality of the local names and of the 
namespace URIs at the same time. Prefixes play no role here. 

Naturally, I don't know this from reading the spec up front, but from a good 
deal of time I spent experimenting and trying to figure what was up when I 
tried to match stuff in documents with a default namespace. Anyway, this is 
how I understand the matter now. 

Jan


Dne pá  3. květen 2002 19:42 Eddie Mc Greal napsal(a):
> Hi all,
>
> I'm getting close to getting all the test passing again. Turns out the
> IdentityHashMap was fine the problem was another one. Just wondering why
> one of the test seems to be wrong
>
> the test with document xml/defaultNamespace.xml
> select context /
> select /a/b/c was expecting 0 nodes - it shuld be 1
> Eddie

----------------------------------------
Content-Type: text/html; charset="iso-8859-1"; name="Příloha: 1"
Content-Transfer-Encoding: quoted-printable
Content-Description: 
----------------------------------------

_______________________________________________________________

Have big pipes? SourceForge.net is looking for download mirrors. We supply
the hardware. You get the recognition. Email Us: [EMAIL PROTECTED]
_______________________________________________
Jaxen-interest mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jaxen-interest

Reply via email to