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.



7
8
9
# File 'lib/nokogiri/css.rb', line 7

def parse(selector)
  Parser.new.parse(selector)
end

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

Get the XPath for selector.



13
14
15
# File 'lib/nokogiri/css.rb', line 13

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