XML Programming
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsProgramming Languages - MoreXML Programming

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 23rd, 2004, 09:25 AM
passionlessDron passionlessDron is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Posts: 1 passionlessDron User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Creating Large XML documents

Hello friends. I'm wondering if anyone has solved a problem that I'm looking at. I'd like to try to exchange an XML file between clients that could get pretty large at times. I anticipate fifty thousand or so elements on a standard day and as many as ten times that amount during peak periods. I worry about memory consumption trying to create such a beast before writing out to the OS. If anyone can provide any insight, I'd be very appreciative.

Thanks.

pD

Reply With Quote
  #2  
Old June 23rd, 2004, 03:56 PM
latrosicarius latrosicarius is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2004
Posts: 75 latrosicarius User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 11 h 1 m 11 sec
Reputation Power: 5
Send a message via AIM to latrosicarius
I too have this question.

I posted it a few days ago and nobody has answered me. It's here:
http://forums.devshed.com/t156981/s.html

Hopefully they will answer you.

-- Matt

Reply With Quote
  #3  
Old June 23rd, 2004, 05:06 PM
DevCoach DevCoach is offline
Contributing User
Dev Shed Beginner (1000 - 1499 posts)
 
Join Date: Feb 2004
Location: London, England
Posts: 1,254 DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level)DevCoach User rank is Captain (20000 - 30000 Reputation Level) 
Time spent in forums: 1 Week 6 Days 8 h 9 m
Reputation Power: 265
There is no reason why the XML document has to be held all in memory. You could open a file and create it a line at a time, writing each line to the file as you go.

Similarly when reading an XML file, SAX parsers are designed to read and parse it an element at a time, so are not limited by memory either. DOM parsers on the other hand generally DO read the whole document and create an in-memory representation, so may have problems with huge files.

If you are concerned with passing large files around you can compress it once you have written it to disk, using a standard compression format such as zip, gzip etc. XML files contain a LOT of redundant information so can compress down to a fraction of their original size.

Dave - The Developers' Coach

Reply With Quote
  #4  
Old July 1st, 2004, 10:22 PM
takashi0128 takashi0128 is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jun 2004
Location: Kuala Lumpur, Malaysia
Posts: 7 takashi0128 User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
As we are doing this for other people (read: customers, clients), we have to make sure it's perfect and wont have any "side-effects" or we may lose the client. It's very important we get it right.

My company's client wanted to develop a HUGE knowledge store about species of trees, parts, usage, etc etc and they have over 15,000 species to be included at 1st version. I am assigned to write the XML file to load the information into Flash and I was given 2 months to write just all that in XML (that's about 250 species per day). But I really do not think writing 15,000 different trees together with their sub information is practical on 1 single XML file. I read somewhere, too large a XML can freeze the user's pc. If this happens, then we have lost the client.

These are to be packed into a CD to be sold and the user is supposed to put the CD in and the Flash loads, and then search whatever trees he wants.

One more thing though, how to you write the search algorithm to search for the thing the user wants?

Reply With Quote
  #5  
Old July 2nd, 2004, 12:18 AM
fractalvibes fractalvibes is offline
Contributing User
Dev Shed Novice (500 - 999 posts)
 
Join Date: Jun 2003
Location: Waco, Texas
Posts: 636 fractalvibes User rank is Sergeant (500 - 2000 Reputation Level)fractalvibes User rank is Sergeant (500 - 2000 Reputation Level)fractalvibes User rank is Sergeant (500 - 2000 Reputation Level)fractalvibes User rank is Sergeant (500 - 2000 Reputation Level)fractalvibes User rank is Sergeant (500 - 2000 Reputation Level) 
Time spent in forums: 1 Week 16 h 10 m 47 sec
Reputation Power: 22
Good question, and I would like to know the answer myself.
Our company has to send a HUGE amount of statistical info off to regulatory agencies on a regular basis. Currently I think this is still done with old-time cobol batch programs writing tapes, mostly; perhaps some via ftp; dunno for sure about that last one as I work on the web side of stuff. Would be interesting to hear from folks who's companies have to do similar reporting functions and have moved to newer technologies such as XML/Web services...

fv
__________________
...because that is the way we have always done it. We've been doing it like that for 80 Years! (How do we change that mindset?)

Reply With Quote
Reply

Viewing: Dev Shed ForumsProgramming Languages - MoreXML Programming > Creating Large XML documents


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 4 hosted by Hostway
Stay green...Green IT