I think you can use Saxon with dom4j. Check out the javadocs for SAXReader; it talks about setting the reader to whatever parser you want.

If for some reason, SAXReader won't work with Saxon, you could also try passing SAXReader's "read" method a File instead of the InputSource/StringReader combo:

reader.read(new File(xmlFileName));

I have no idea if that'll make a difference... the memory usage may be the same or worse. But it couldn't hurt to try it.

Sorry I don't know a surefire answer to your problem.

Ben



Mladen Adamovic wrote:
I tried to use dom4j for large file XPath processing, but with 8MB file I get OutOfMemory error. Saxon can do it with 8MB file.

Comments? Did I oversee something?

Here is my source:

SAXReader reader = new SAXReader();
InputSource is = new InputSource(new StringReader(content));

Document doc;

try {
doc = reader.read(is);
System.out.println("here am i...");
//do Xpath Expression
List list = doc.selectNodes(query);
....


------------------------------------------------------------------------
Do you Yahoo!?
Y! Messenger <http://us.rd.yahoo.com/mail_us/taglines/msgr/evt=26088/*http://messenger.yahoo.com> - Communicate in real time. Download now.


-------------------------------------------------------
This SF.Net email is sponsored by: YOU BE THE JUDGE. Be one of 170
Project Admins to receive an Apple iPod Mini FREE for your judgement on
who ports your project to Linux PPC the best. Sponsored by IBM.
Deadline: Sept. 24. Go here: http://sf.net/ppc_contest.php
_______________________________________________
dom4j-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/dom4j-user

Reply via email to