Skip to content

Instantly share code, notes, and snippets.

@winmillwill
Last active August 29, 2015 14:12
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save winmillwill/ace2ae2f2fa2eeb5d50d to your computer and use it in GitHub Desktop.
Save winmillwill/ace2ae2f2fa2eeb5d50d to your computer and use it in GitHub Desktop.
(ns xml.core
(:require [clojure.data.xml :as xml]
[clojure.java.io :as io]
))
(defn root
"Get the root element."
[input]
(-> input io/resource io/input-stream xml/parse))
(defn tables
"Get the tables."
([root n]
(cons
(-> root :content (nth n) :content first)
(lazy-seq (tables root (inc n))))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment