Skip to content

Instantly share code, notes, and snippets.

Created January 9, 2014 10:30
Show Gist options
  • Save anonymous/8332220 to your computer and use it in GitHub Desktop.
Save anonymous/8332220 to your computer and use it in GitHub Desktop.
(ns xml-test.core
(:require [clojure.java.io :as java.io]))
; https://github.com/clojure/data.xml
(load-file "./clojure/data/xml.clj")
(def large-file "./collecttion_20130320102554_10.11.14.15.xml") ; 310MB
(def xml
(-> large-file
java.io/input-stream
clojure.data.xml/source-seq)) ; http://clojure.github.io/data.xml/#clojure.data.xml/source-seq
(def ^:dynamic counter)
(defn consume-seq [col]
(binding [counter 0]
(doseq [c col]
(set! counter (inc counter))
(println counter))))
(consume-seq xml)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment