PDA

View Full Version : Loading Huge XML file in a Datagrid


salim_designer
05-21-2007, 06:41 AM
I have a huge XML file of 64 MB. I want to load data from that XML file to a datagrid but the data is so huge that it fails to load.

Is there any way to load the data in different Parts and use Pagination.

I mean to load first 100 rows of data and then next 100 etc. That way I will not have to load the entire XML file but a part of it.

Please let me know if this can be done.

Flash Gordon
05-21-2007, 06:58 AM
don't think so.

If it is a dynamic xml file, just query the data you need. If not, no you need to load the whole thing, but I couldn't image it failing to load...

salim_designer
05-21-2007, 07:33 AM
As the XML file size is very large (64mb) I am getting an Error message

Error: Error #1502: A script has executed for longer than the default timeout period of 15 seconds.
at mx.core::UIComponent/::addedHandler()
at flash.display::DisplayObjectContainer/addChildAt()
at mx.core::UIComponent/http://www.adobe.com/2006/flex/mx/internal::$addChildAt()
at mx.core::UIComponent/addChild()
at mx.charts.chartClasses::ChartElement/addChild()
at mx.charts.chartClasses::InstanceCache/set count()
at mx.charts.series::PieSeries/mx.charts.series:PieSeries::updateDisplayList()
at mx.core::UIComponent/validateDisplayList()
at mx.managers::LayoutManager/::validateDisplayList()
at mx.managers::LayoutManager/::doPhasedInstantiation()
at Function/http://adobe.com/AS3/2006/builtin::apply()
at mx.core::UIComponent/::callLaterDispatcher2()
at mx.core::UIComponent/::callLaterDispatcher()

dr_zeus
05-21-2007, 06:38 PM
You're asking Flash Player to parse 64MB of XML. That's a bit much. You might be able to load it in as a string and do some tricky parsing to access a hundred rows at a time, but if that won't work, I recommend you have an outside source (like a server-side script) break it up for Flash.

Flash Gordon
05-21-2007, 07:33 PM
it doesn't sound like it is the file size of the xml file that is the trouble. Flash/Flex is taking too long to parse.

Don't know what to tell you.

xml_monkey
06-06-2007, 05:11 AM
64MB is not huge... try VTD-XML, it would consume 100MB of memory
while completing parsing in about 1 sec
http://vtd-xml.sf.net

xml_monkey
06-06-2007, 05:11 AM
64MB is not huge... try VTD-XML, it would consume 100MB of memory
while completing parsing in about 1 sec
http://vtd-xml.sf.net:D

salim_designer
06-06-2007, 08:04 AM
What, actually, I will have to do then? :confused: