This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes XML and Related Technologies and the fly likes XML Conversion of millions of records Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Engineering » XML and Related Technologies
Bookmark "XML Conversion of millions of records" Watch "XML Conversion of millions of records" New topic

XML Conversion of millions of records

Renjith Panikar

Joined: Nov 06, 2012
Posts: 20
Hi All,

I am working on an application in which i have to convert the contents of a text file to xml format.

Text file contains millions of records. Format is given below.

Data of Header1 (1)
Data of Header1(n)
Data of Header2 (1)
Data of Header2(n)

This has to be converted to XML of format


Each header and it data from 1-n create a single record.
Since there can be millions of records, we cannot take entire records and convert it as XML.
Currently it fetches first 100 records , convert it into XML then fetch next 100 and so on.
XML decleration and <ItemInfo> tags are generated using stax parser. records are converted
tom<Item> using jaxb. But it is taking long time to execute. eg. 4 minutes to convert 1000 records in windows machine
with 4 gb memory.

The reason why i used stax is that, i donno how to insert <Item> inside <ItemInfo> tags after creating <Iteminfo > </ItemInfo>
tags using Jaxb.

Can you suggest me a better solution for this issue.

Is it possible to use jaxb alone to do this?

thanks in advance.


subject: XML Conversion of millions of records
Similar Threads
column width in rich:datatable
Header, Footer with dynamic data
Double line column header problem in SWT
convert Excel to XML format
Regex Servlet issue