You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
The text was updated successfully, but these errors were encountered:
Is this how NodeSet#search ought to behave?
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.
The text was updated successfully, but these errors were encountered: