Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

NodeSet#search behavior #74

Closed
trans opened this issue Jun 8, 2009 · 3 comments
Closed

NodeSet#search behavior #74

trans opened this issue Jun 8, 2009 · 3 comments

Comments

@trans
Copy link

trans commented Jun 8, 2009

Is this how NodeSet#search ought to behave?

require 'nokogiri'

xml = Nokogiri::XML <<-EOS
  <root><x><m id="a" class="q">dummy</m><n id="b" class="q">dummy</n></x></root>
EOS

nodeset = xml.search('.q')

p nodeset
<m id="a" class="q">dummy</m><n id="b" class="q">dummy</n>

p nodeset.search('#a')
=> nil

nil? I guess it is searching inside of each node in the set, but I would think it would match against the top nodes as well --which would be useful for a procedure of filtering steps for instance.

@flavorjones
Copy link
Member

this is a duplicate of #73

@trans
Copy link
Author

trans commented Jun 8, 2009

ah. so it is. should have read over the other reports first. I'll go ahead and close this issue then. thanks.

@flavorjones
Copy link
Member

No worries, this issue was actually opened in response to your ruby-talk email!

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants