Module: Nokogiri::CSS

Defined in:
lib/nokogiri/css.rb,
lib/nokogiri/css/node.rb,
lib/nokogiri/css/parser.rb,
lib/nokogiri/css/tokenizer.rb,
lib/nokogiri/css/syntax_error.rb,
lib/nokogiri/css/parser_extras.rb,
lib/nokogiri/css/xpath_visitor.rb

Defined Under Namespace

Classes: Node, Parser, SyntaxError, Tokenizer, XPathVisitor, XPathVisitorAlwaysUseBuiltins, XPathVisitorOptimallyUseBuiltins

Class Method Summary collapse

Class Method Details

.parse(selector) ⇒ Object

Parse this CSS selector in selector. Returns an AST.



17
18
19
# File 'lib/nokogiri/css.rb', line 17

def parse selector
  Parser.new.parse selector
end

.xpath_for(selector, options = {}) ⇒ Object

Get the XPath for selector.



23
24
25
# File 'lib/nokogiri/css.rb', line 23

def xpath_for selector, options={}
  Parser.new(options[:ns] || {}).xpath_for selector, options
end