Last active
April 27, 2016 19:24
-
-
Save slipset/071b6fb4065913ff810f94787e95afc1 to your computer and use it in GitHub Desktop.
why is :foo not working
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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