Added README example on using CSS selectors.

This commit is contained in:
Yorick Peterse 2014-11-17 23:21:55 +01:00
parent c253254e24
commit 72c8cafcb1
1 changed files with 6 additions and 0 deletions

View File

@ -70,6 +70,12 @@ Querying a document using XPath:
document.xpath('string(people/person)') # => "Alice"
Querying a document using CSS:
document = Oga.parse_xml('<people><person>Alice</person></people>')
document.css('people person') # => NodeSet(Element(name: "person" ...))
Modifying a document and serializing it back to XML:
document = Oga.parse_xml('<people><person>Alice</person></people>')