-- upgrading Clojure to 1.2 RC3; code changes to reflect
[bkell-clj.git] / src / xml_handler.clj
blob3b0dd8123d80d439c58f39d28b0a0c69fb85d714
2 (use 'helpers) 
4 (import 'java.io.ByteArrayInputStream) 
5 (require 'clojure.xml)
7 (defn xml_handler [node handler] 
8    (if (instance? com.interrupt.bookkeeping.cc.node.AXmlCommandInput (. node getCommandInput) )
9                         (do 
10                            
11                            (println "XML input[" (.. node getCommandInput toString) "]")
12                            (let [xml-string (filterSpacesFromXML (.. node getCommandInput toString))] 
13                                         
14                                         (println "XML filtered[" xml-string "]")
15                                         (handler (clojure.xml/parse (ByteArrayInputStream. (.getBytes xml-string "UTF-8"))))
16                                         
17                            )
18                            
19                         )
20    )