>
> I've read the clojure.data.xml.zip docs carefully and looked at many 
> examples, but I don't understand this behavior:
>
 
(require '[clj-http.client :as client]
         '[clojure.zip :as z]
         '[clojure.data.zip :as dz]
         '[clojure.data.zip.xml :as dzx]
         '[crouton.html :as html])
(def my-html "<html>\n<body>\n<input src='a.png'/>\n</body>\n</html>")
(def my-zipper (z/xml-zip (html/parse-string my-html)))
(dzx/xml1-> my-zipper)
(dzx/xml1-> my-zipper dz/descendants)
(dzx/xml1-> my-zipper :html)

 I am starting with this so that I can understand step-by-step what is 
happening here.  I built a simple HTML string, converted it into an XML 
zipper and then tried a few *xml1 *calls on it:

(dzx/xml1-> my-zipper)

gives me the original zipper, which is what I expected.

(dzx/xml1-> my-zipper dz/descendants)

gives me what appears to be the original zipper structure, which I wasn't 
expecting.  I was expecting a flattened-out seq of the nodes.

(dzx/xml1-> my-zipper :html)

returns *nil*, which I *really *wasn't expecting.  Examples on the web led 
me to believe that this last call should match on the html tag.  Can anyone 
provide any explanation on these call and why I got these return values?



-- 
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to clojure@googlegroups.com
Note that posts from new members are moderated - please be patient with your 
first post.
To unsubscribe from this group, send email to
clojure+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/clojure?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"Clojure" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to clojure+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to