module Nokogiri::XML::Searchable
def css(*args)
(e.g., "H1" is distinct from "h1").
found in an XML document, where tags names are case-sensitive
will match only lowercase CSS queries. However, "H1" might be
an HTML document, you'll never find anything, since HTML tags
to your document type. That is, if you're looking for "H1" in
Note that the CSS query string is case-sensitive with regards
}.new)
end
node_set.find_all { |node| node['some_attribute'] =~ /#{regex}/ }
def regex node_set, regex
node.css('title:regex("\w+")', Class.new {
arguments are ones that you pass in. For example:
method will be the current matching NodeSet. Any other
pseudo class you want defined. The first argument to the
custom pseudo classes, create a class and implement the custom
Custom CSS pseudo classes may also be defined. To define
node.css('bike|tire', {'bike' => 'http://schwinn.com/'})
A hash of namespace bindings may be appended. For example:
node.css('div + p.green', 'div#one')
node.css('body h1.bold')
node.css('title')
selectors. For example:
Search this object for CSS +rules+. +rules+ must be one or more CSS
call-seq: css *rules, [namespace-bindings, custom-pseudo-class]
##
def css(*args) rules, handler, ns, _ = extract_params(args) css_internal self, rules, handler, ns end