Thanks a lot for both responses. I really appreciate it! The zip is really nice.
On Fri, Feb 4, 2011 at 11:39 AM, Despite <desp...@gmail.com> wrote: > I like to use zip and zip-filter with xml files. For example (suppose > clojure.zip is aliased as zip and clojure.contrib.zip-filter.xml is > aliased as zf): > > (def bo-zip (zip/xml-zip (xml/parse "http://api.twitter.com/1/statuses/ > friends/barackobama.xml" > > Then I can use zip-filters to get the info I want. To get all the > user id's: > > (zf/xml-> bo-zip :user :id zf/text) > > To get screen names: > > (zf/xml-> bo-zip :user :screen_name zf/text) > > To get both at once, use juxt (normally I would give the filters names > ahead of time, to improve readablity): > > ((juxt #(zf/xml-> % :user :id zf/text) #(zf/xml-> % :user :screen_name > zf/text)) bo-zip) > > That gives you a vector of two lists. You could interleave them, and > turn them into a hash map, or deal with them as is. > > -- > 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 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