From 082af145e3ee75c19d030d0d19b7d2544b339c34 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Tue, 17 Nov 2015 16:32:46 +0100 Subject: [PATCH] Updated Nokogiri migration guide for CSS support --- doc/migrating_from_nokogiri.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/doc/migrating_from_nokogiri.md b/doc/migrating_from_nokogiri.md index 883eb70..f8bf72d 100644 --- a/doc/migrating_from_nokogiri.md +++ b/doc/migrating_from_nokogiri.md @@ -44,13 +44,18 @@ CSS selectors. In Nokogiri one queries a document as following: document.xpath('root/foo') document.css('root foo') -Oga currently only supports XPath expressions, CSS selectors will be added in -the near future. Querying documents works similar to Nokogiri: +Querying documents works similar to Nokogiri: document = Oga.parse_xml('bar') document.xpath('root/foo') +or using CSS: + + document = Oga.parse_xml('bar') + + document.css('root foo') + Nokogiri also allows you to query a document and return the first match, opposed to an entire node set, using the method `at`. In Nokogiri this method can be used for both XPath expression and CSS selectors. Oga has no such method,