XPath and the default namespace

Posted on Thu 01 September 2005
I've several times been hit by strange behaviours of XSLT with XPath expressions involving elements in the default namespace, when this one was actually defined (e.g. <foo xmlns="http://foo-ns">). These expressions where not matching whereas using a prefixed namespace declaration would work.

I thought about a Xalan bug and always ended up using prefixed namespaces instead of the default one, without looking for a further explanation or bug fix.

This is actually not a bug: XPath doesn't consider the namespace declaration of unprefixed elements.

You never stop learning...

Via Dave .



Welcome Kiwi

How to Decide What Bugs to Fix When