REXML XPath question

Can anyone explain these result to me (see bottom)?

require ‘rexml//document’
d = REXML::Document.new %{

test

3

4

5

6

}

REXML::XPath.match d, “/html/body/p[@id=‘foo’]”
#-> []

REXML::XPath.match d, “/html/body/p[@id]”
#-> []

REXML::XPath.match d, “/html/body/p[@*]”
#-> [

… </>,

… </>]

OK I just removed xmlns=“XHTML namespace” from the
tag (the default namespace) and now it works.

Is this a bug?

Wow, 2 replies from myself…

I just found out that XPath 1.0 does not work correctly with a default
namespace. So this is “correct” behavior.