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/xpath_visitor.rb,
lib/nokogiri/css/generated_parser.rb,
lib/nokogiri/css/generated_tokenizer.rb

Overview

Modules to convert CSS selectors to valid XPath

Defined Under Namespace

Classes: GeneratedParser, GeneratedTokenizer, 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 self.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 self.xpath_for selector, options={}
  Parser.new(options[:ns] || {}).xpath_for selector, options
end