Checking for a Few Attributes

Q: Can I perform a single search and get all of the elements with “href” or “action” attributes? Something like this:"[@href]|[@action]")

Similarly, is it possible to get all elements with both attributes present?

A: In recent Hpricots (after 2006 Mar 17,) you can go ahead and use the search from the question:"[href]|[action]").

In earlier Hpricots, you’ll need to do two searches:

 ele ="[@href]")
 ele.push *"[@type]")

As for doing a search which finds elements with both attributes, you can go ahead and stack the search in newer Hpricots:"[@href][@type]")