Guest User

Untitled

a guest
Sep 3rd, 2018
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. (defn parse
  2.   "Parses and loads the source s, which can be a File, InputStream or
  3.  String naming a URI. Returns a tree of the xml/element struct-map,
  4.  which has the keys :tag, :attrs, and :content. and accessor fns tag,
  5.  attrs, and content. Other parsers can be supplied by passing
  6.  startparse, a fn taking a source and a ContentHandler and returning
  7.  a parser"
  8.   {:added "1.0"}
  9.   ([s] (parse s startparse-sax))
  10.   ([s startparse]
  11.     (binding [*stack* nil
  12.               *current* (struct element)
  13.               *state* :between
  14.               *sb* nil]
  15.       (startparse s content-handler)
  16.       ((:content *current*) 0))))
Add Comment
Please, Sign In to add comment