Hi all,
I'm attempting to parse a large (500MB) XML, specifically I am trying to
extract various parts using XPath. I've been using the examples presented
here: http://clojure-doc.org/articles/tutorials/parsing_xml_with_zippers.html
and all was going when tested against small files, however now that I am
using the larger file Fireplace/Vim just hangs and my laptop gets hot then
I get a memory exception.
I've been playing around with various other libraries such as
clojure.data.xml and and found that the following works perfectly well for
parsing... but when I come to search inside root, things start to snarl up
again.
(ns example.core
(:require [clojure.java.io :as java.io]
[clojure.data.xml :as data.xml]
))
(def large-file "/path-to-large-file")
;; using clojure.data.xml returns quickly with no problems whereas
clojure.xml/parse from the link above causes problems..
(def root
( -> large-file
java.io/input-stream
data.xml/parse
))
(class root) ;clojure.data.xml.Element
Does anyone know a way of searching within root that won't consume the heap?
Forgive me, I'm new to Clojure and these forums, I've searched through
previous posts but not managed to answer my own question.
Thanks in advance.
--
--
You received this message because you are subscribed to the Google
Groups "Clojure" group.
To post to this group, send email to [email protected]
Note that posts from new members are moderated - please be patient with your
first post.
To unsubscribe from this group, send email to
[email protected]
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 [email protected].
For more options, visit https://groups.google.com/groups/opt_out.