5,693,062 members and growing! (18,634 online)
Email Password   helpLost your password?
Languages » XML » General     Intermediate

XML Reading Using DOM and SAX

By rosen

Example of reading XML using two interfaces DOM and SAX
C#, XML, Windows, .NET 1.0, .NETVisual Studio, VS.NET2002, Dev

Posted: 10 Aug 2002
Updated: 10 Aug 2002
Views: 71,968
Bookmarked: 8 times
Announcements
Loading...



Search    
Advanced Search
Sitemap
53 votes for this Article.
Popularity: 2.51 Rating: 1.45 out of 5
22 votes, 78.6%
1
1 vote, 3.6%
2
0 votes, 0.0%
3
1 vote, 3.6%
4
4 votes, 14.3%
5
Note: This is an unedited contribution. If this article is inappropriate, needs attention or copies someone else's work without reference then please Report This Article
There are two simple methods in my application: one is reading xml file by using DOM method and the other is reading the same file using SAX method. I’m not gonna explain the difference between DOM & SAX, only telling this that in DOM , a parser must read the whole file u r reading before u can read anything. In other words the file is loaded into the memory of your application, where DOM makes an object model of it, then u can traverse throw the elements of this object model & receive/update needed information. SAX method, reads file step by step, so it is a resource benefit . Of course there can be said a lot about that but if u r interested I’m sure u’ll find more complex info. I made this example when I was studying XML and its two models/interfaces for making parsers – DOM & SAX and it was interesting for me to use them throw NET.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

rosen



Occupation: Web Developer
Location: Bulgaria Bulgaria

Other popular XML articles:

Article Top
Sign Up to vote for this article
You must Sign In to use this message board.
FAQ FAQ Noise ToleranceSearch Search Messages 
 Layout  Per page   
 Msgs 1 to 8 of 8 (Total in Forum: 8) (Refresh)FirstPrevNext
General[Message Removed]memberhankjmatt23:18 13 Oct '08  
GeneralI got what I was looking formemberAshutosh Bhawasinka11:30 6 Dec '06  
Generalwhere is SAX?membertheGrim7:25 11 Oct '06  
GeneralARTICLE SUCKSsussAnonymous0:16 15 Dec '04  
GeneralArticle suckssussAnonymous5:52 17 Oct '03  
GeneralRe: Article sucksmemberdog_spawn6:02 17 Oct '03  
GeneralPoor ArticlememberPaul A. Howes3:35 12 Aug '02  
GeneralRe: Poor ArticlememberBubba21465:26 12 Aug '02  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 10 Aug 2002
Editor:
Copyright 2002 by rosen
Everything else Copyright © CodeProject, 1999-2008
Web18 | Advertise on the Code Project