Bugs item #19589, was opened at 2008-04-16 12:06
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=1971&aid=19589&group_id=494
Category: General
Group: v0.5
>Status: Closed
>Resolution: Accepted
Priority: 3
Submitted By: Jamie Orchard-Hays (jamieorc)
>Assigned to: Charlie Savage (cfis)
Summary: node.find_first() returns a node, but find() on the returned node
searches parent node
Initial Comment:
Here's an example:
meta = root.find_first('//meta')
correct_hits = root.find('//meta//hit') => yields just the meta hit
too_many_hits = meta.find('//hit') => yields all 3 hits
I expect meta.find() to search the context of the meta node, but it does not.
here's the XML for the example
<docHit>
<meta>
<hit>a meta hit</hit>
</meta>
<hit> a non-meta hit</hit>
<hit> another non-meta hit</hit>
</docHit>
----------------------------------------------------------------------
>Comment By: Charlie Savage (cfis)
Date: 2008-07-09 11:41
Message:
Also, there no longer appears to be a find_first method on node.
----------------------------------------------------------------------
Comment By: Mark Thomas (markthomas)
Date: 2008-04-16 17:06
Message:
Not a bug. The XPath spec treats a *leading* // as an absolute path from the
root. Try meta.find('.//hit') to see if it makes a difference.
----------------------------------------------------------------------
You can respond by visiting:
http://rubyforge.org/tracker/?func=detail&atid=1971&aid=19589&group_id=494
_______________________________________________
libxml-devel mailing list
[email protected]
http://rubyforge.org/mailman/listinfo/libxml-devel