Added README example on using CSS selectors.
This commit is contained in:
parent
c253254e24
commit
72c8cafcb1
|
|
@ -70,6 +70,12 @@ Querying a document using XPath:
|
||||||
|
|
||||||
document.xpath('string(people/person)') # => "Alice"
|
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:
|
Modifying a document and serializing it back to XML:
|
||||||
|
|
||||||
document = Oga.parse_xml('<people><person>Alice</person></people>')
|
document = Oga.parse_xml('<people><person>Alice</person></people>')
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue