[libxml-devel] .//xpath can't find the current node
Phlip
phlip2005 at gmail.com
Thu Feb 21 10:41:26 EST 2008
LibXml:
(I will escalate this question to the libxml mothership if necessary.)
I'm porting assert_xpath to libxml. That effort leads to this test case:
def test_deep_node_searches
node = assert_libxml('<foo><bar>content</bar></foo>')
assert{ node.instance_of? XML::Node }
assert{ node.find_first('/foo') }
# assert{ node.find_first('foo') }
# assert{ node.find_first('./foo') }
# assert{ node.find_first('.//foo') }
end
The first assertion with /foo passes, but the rest fail. I would prefer them to
pass! The goal is some assert_xpath calls target a specific foo, but others just
want any foo south of the current node.
What should I put inside assert_xpath - the find_first, or some other method
that treats its xpathage differently?
http://assertxpath.rubyforge.org/ <-- only REXML or Hpricot so far!
--
Phlip
http://assert2.rubyforge.org/
More information about the libxml-devel
mailing list