Skip to content

Instantly share code, notes, and snippets.

@slipset
Last active April 27, 2016 19:24
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 slipset/071b6fb4065913ff810f94787e95afc1 to your computer and use it in GitHub Desktop.
Save slipset/071b6fb4065913ff810f94787e95afc1 to your computer and use it in GitHub Desktop.
why is :foo not working
(ns zip-fail.core
(:require
[clojure.xml :as c-xml]
[clojure.data.xml :refer [parse parse-str]]
[clojure.zip :refer [xml-zip]]
[clojure.data.zip.xml
:refer [xml-> xml1-> attr text= attr= text]]))
(def xml "<foo id = \"qix\">bar</foo>")
(def z (-> xml parse-str xml-zip))
(xml-> z
(text= "bar")
text)
;=> ("bar")
(xml-> z
(attr= :id "qix")
text)
;=> ("bar")
(xml-> z
:foo)
;=> ()
#_(defproject zip-fail "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url "http://example.com/FIXME"
:license {:name "Eclipse Public License"
:url "http://www.eclipse.org/legal/epl-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/data.csv "0.1.3"]
[org.clojure/data.zip "0.1.1"]
[org.clojure/data.xml "0.0.8"]])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment