views:

23

answers:

1

Hi,

I am getting different results from the same xpath expression in nokogiri when using ruby and jruby,

In ruby the following xpath expression returns a node while in jruby it returns a nodeset:

parent = node.xpath("./ancestor::node()[name(.) = 'div' or name(.) = 'p'][1]")

Has anybody else noticed similar behaviour?

Thanks

Paul

A: 

There seems to be a difference between how libxml2 (used in the MRI Nokogiri) and whatever library the pure-Java version uses in how they handle predicates that match only one node. You should report this to the nokogiri-talk mailing list.

Mark Thomas
Thanks, I will bring this up.
dagda1