Example on querying XML namespaces.
This commit is contained in:
parent
9d798ce7b9
commit
dd47dd43a0
|
@ -59,6 +59,13 @@ Modifying a document and serializing it back to XML:
|
||||||
|
|
||||||
document.to_xml # => "<people><person>Bob</person></people>"
|
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
|
## Features
|
||||||
|
|
||||||
* Support for parsing XML and HTML(5)
|
* Support for parsing XML and HTML(5)
|
||||||
|
|
Loading…
Reference in New Issue