| Author |
split big DOM xml file ??
|
kri shan
Ranch Hand
Joined: Apr 08, 2004
Posts: 1303
|
|
|
How can i split big DOM xml file in to small files?
|
 |
Lasse Koskela
author
Sheriff
Joined: Jan 23, 2002
Posts: 11962
|
|
You could do that in two ways: 1) Use XML entity references in a top-level XML document to "include" other XML documents. This approach splits the file, but the DOM parser will still read it as one big XML document. 2) Split the XML document and write Java code to merge the documents together after parsing each. Could you explain a bit more about why you need to split the big file?
|
Author of Test Driven (2007) and Effective Unit Testing (2013) [Blog] [HowToAskQuestionsOnJavaRanch]
|
 |
kri shan
Ranch Hand
Joined: Apr 08, 2004
Posts: 1303
|
|
|
If i use big DOM xml file, it occupies more memory. I want to reduce this..
|
 |
JayaSiji Gopal
Ranch Hand
Joined: Sep 27, 2004
Posts: 303
|
|
|
If it is about parsing a big xml file and working with the nodes, u can use SAX parser. SAX is event based. Hence, memory constraints are reduced.
|
SCJP 1.4, SCWCD 1.4<br /> <br />Thanks in advance!<br />Jayashree.
|
 |
William Brogden
Author and all-around good cowpoke
Rancher
Joined: Mar 22, 2000
Posts: 12327
|
|
I think the important question is - what kind of processing do you have to do with the big XML file? For a simple pass through the entire document, extracting specific information, SAX processing will use very little memory. If you have to modify the document structure extensively and rewrite it you may be buying more memory... How big are we talking about anyway? Bill
|
Java Resources at www.wbrogden.com
|
 |
 |
|
|
subject: split big DOM xml file ??
|
|
|