Hi, AFAIK the currently supposed way of parsing XML with Clojure is to use a combination of clojure.xml, clojure.zip, data.zip and data.zip.xml. Please correct me if I'm wrong.
I am trying to extract the equivalent of a union of nodesets from an XML file (speaking in XPath terms). Example: input.xml: <root> <a> <b1> <c>C1</c> <c>C2</c> </b1> <b2> <c>C3</c> <c>C4</c> </b2> <b3> <c>C5</c> <c>C6</c> </b3> </a> </root> Suppose I have an array (or whatever) with the allowed b-tags, e.g. b1 and b3. Now I want to extract all c-tags underneath b1 and b3 but skip those under b2. Using clojure.xml/parse, clojure.zip/xml-zip and data.zip.xml/xml-> I can easily extract certain nodes but I have not found a way to extract such a union, yet. A rather lispy approach would be using or in a manner similar to this: (def x (clojure.zip/xml-zip (clojure.xml/parse "/path/to/input.xml"))) (clojure.data.zip.xml/xml-> x :a (or :b1 :b3) :c) And I did not yet understand how to write my own predicates there. Any pointers? Kind regards, stefan -- 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