Example on querying XML namespaces.

This commit is contained in:
Yorick Peterse 2014-09-12 16:54:36 +02:00
parent 9d798ce7b9
commit dd47dd43a0
1 changed files with 7 additions and 0 deletions

View File

@ -59,6 +59,13 @@ Modifying a document and serializing it back to XML:
document.to_xml # => "<people><person>Bob</person></people>"
Querying a document using a namespace:
document = Oga.parse_xml('<root xmlns:x="foo"><x:div></x:div></root>')
div = document.xpath('root/x:div').first
div.namespace # => Namespace(name: "x" uri: "foo")
## Features
* Support for parsing XML and HTML(5)