From dd47dd43a0021e26475f012a73ce3993a77d77b2 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Fri, 12 Sep 2014 16:54:36 +0200 Subject: [PATCH] Example on querying XML namespaces. --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index a1ff131..6d3d4a0 100644 --- a/README.md +++ b/README.md @@ -59,6 +59,13 @@ Modifying a document and serializing it back to XML: document.to_xml # => "Bob" +Querying a document using a namespace: + + document = Oga.parse_xml('') + div = document.xpath('root/x:div').first + + div.namespace # => Namespace(name: "x" uri: "foo") + ## Features * Support for parsing XML and HTML(5)