Browse files

Added a case for SPACE stream constants. Doesn't look like those even…

…ts are emitted from the JDK parser. Adding it to be more complete.
  • Loading branch information...
1 parent 1b4d287 commit 262550f7d3f438993acffc343594804987aadd6d @senior senior committed Jan 16, 2012
Showing with 8 additions and 4 deletions.
  1. +8 −4 src/main/clojure/clojure/data/xml.clj
@@ -199,7 +199,10 @@
; Note, sreader is mutable and mutated here in pull-seq, but it's
; protected by a lazy-seq so it's thread-safe.
-(defn- pull-seq [^XMLStreamReader sreader]
+(defn- pull-seq
+ "Creates a seq of events. The XMLStreamConstants/SPACE clause below doesn't seem to
+ be triggered by the JDK StAX parser, but is by others. Leaving in to be more complete."
+ [^XMLStreamReader sreader]
(loop []
(condp == (.next sreader)
@@ -217,10 +220,11 @@
(.getText sreader))]
(cons (event :characters nil nil text)
(pull-seq sreader))
- (pull-seq sreader))
+ (recur))
- (pull-seq sreader)
+ (recur)
+ XMLStreamConstants/SPACE
+ (recur)

0 comments on commit 262550f

Please sign in to comment.