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

Class Method Summary collapse

Class Method Details

.parse(selector) ⇒ Object

Parse this CSS selector in selector. Returns an AST.


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

def parse selector
  Parser.new.parse selector
end

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

Get the XPath for selector.


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

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