del
1
Can anyone explain these result to me (see bottom)?
require ‘rexml//document’
d = REXML::Document.new %{
test
3
4
}
REXML::XPath.match d, “/html/body/p[@id=‘foo’]”
#-> []
REXML::XPath.match d, “/html/body/p[@id]”
#-> []
REXML::XPath.match d, “/html/body/p[@*]”
#-> [
… </>,
… </>]
del
2
OK I just removed xmlns=“XHTML namespace” from the
tag (the default namespace) and now it works.
Is this a bug?
del
3
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.