diff --git a/README.md b/README.md index af394c8..2ab2eb4 100644 --- a/README.md +++ b/README.md @@ -31,6 +31,17 @@ Parsing an IO handle pointing to XML (this also works when using Oga.parse_xml(handle) +Parsing an IO handle using the pull parser: + + handle = File.open('path/to/file.xml') + parser = Oga::XML::PullParser.new(handle) + + parser.parse do |node| + parser.on(:text) do + puts node.text + end + end + Querying a document using XPath: document = Oga.parse_xml('Alice')