Win a copy of Mastering Corda: Blockchain for Java Developers this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Bear Bibeault
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Jj Roberts
  • Carey Brown
Bartenders:
  • salvin francis
  • Frits Walraven
  • Piet Souris

split big DOM xml file ??

 
Ranch Hand
Posts: 1491
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can i split big DOM xml file in to small files?
 
author
Posts: 11962
5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
kri shan
Ranch Hand
Posts: 1491
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If i use big DOM xml file, it occupies more memory. I want to reduce this..
 
Ranch Hand
Posts: 303
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Can you really tell me that we aren't dealing with suspicious baked goods? And then there is this tiny ad:
the value of filler advertising in 2020
https://coderanch.com/t/730886/filler-advertising
reply
    Bookmark Topic Watch Topic
  • New Topic