README example on using Enumerator for input.
This commit is contained in:
1 parent
b8f9d04b17
commit
f88df486ba
1 file changed
+10
@@ -44,6 +44,16 @@ Parsing an IO handle using the pull parser:
|
||||
end
|
||||
end
|
||||
|
||||
Using an Enumerator to download and parse an XML document on the fly:
|
||||
|
||||
enum = Enumerator.new do |yielder|
|
||||
HTTPClient.get('http://some-website.com/some-big-file.xml') do |chunk|
|
||||
yielder << chunk
|
||||
end
|
||||
end
|
||||
|
||||
document = Oga.parse_xml(enum)
|
||||
|
||||
Parse a string of XML using the SAX parser:
|
||||
|
||||
class ElementNames
|
||||
|
||||
Reference in new issue
Block a user