3 (set! *warn-on-reflection* true)
6 (use 'clojure.xml) ;; use XML library
7 (def flareXML (parse "etc/xml/bookkeeping.system.xml")) ;; load XML from file
9 (. System/out println (str "parsed XML [" (.getClass flareXML) "] [" flareXML "]") )
10 ;;(. System/out println (str "raw XML [" (emit flareXML) "]") )
12 (require 'clojure.contrib.http.agent) ;; use HTTP client library
13 (require 'clojure.contrib.io)
16 ;; connect to a eXist server ; push the XML object out
17 (clojure.contrib.http.agent/result (clojure.contrib.http.agent/http-agent "http://localhost:8080/exist/rest/thing"
19 :header {"Content-Type" "text/xml"}
20 :body (with-out-str (emit flareXML))
21 ;; :handler (fn [agnt] (with-open [w (clojure.contrib.io/writer "/tmp/out")] (clojure.contrib.io/copy (clojure.contrib.http.agent/stream agnt) w)))