Can Nokogiri Parse a Nokogiri Object?

Posted by Jesse J on Stack Overflow See other posts from Stack Overflow or by Jesse J
Published on 2010-05-26T20:15:48Z Indexed on 2010/05/26 21:11 UTC
Read the original article Hit count: 487

Filed under:
|
|

I'm trying to parse a part of the result of a parse, like this:

queries = @doc.xpath("//spectrum_query")

queries.each do |query|
    hits = query.xpath("//search_hit")
end

But instead of Nokogiri only searching for search_hits inside the query, it searches for search_hits in the whole document. I'm sure there's a different way to accomplish what I want, but doing it like this would be the simplest.

Anyone know if it's possible to search just the query object?

© Stack Overflow or respective owner

Related posts about Xml

Related posts about ruby