Click here to Skip to main content
Licence 
First Posted 10 Aug 2002
Views 86,578
Bookmarked 13 times

XML Reading Using DOM and SAX

By | 10 Aug 2002 | Article
Example of reading XML using two interfaces DOM and SAX
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

Web Developer

Bulgaria Bulgaria

Member



Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMy vote of 1 PinprotectorBarry Lapthorn21:37 21 Feb '10  
GeneralMy vote of 1 Pinmemberxandervdm0:36 14 Sep '09  
General[Message Removed] Pinmemberhankjmatt22:18 13 Oct '08  
GeneralI got what I was looking for PinmemberAshutosh Bhawasinka10:30 6 Dec '06  
Questionwhere is SAX? PinmembertheGrim6:25 11 Oct '06  
GeneralARTICLE SUCKS PinsussAnonymous23:16 14 Dec '04  
GeneralArticle sucks PinsussAnonymous4:52 17 Oct '03  
GeneralRe: Article sucks Pinmemberdog_spawn5:02 17 Oct '03  
GeneralPoor Article PinmemberPaul A. Howes2:35 12 Aug '02  
GeneralRe: Poor Article PinmemberBubba21464:26 12 Aug '02  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web02 | 2.5.120517.1 | Last Updated 11 Aug 2002
Article Copyright 2002 by rosen
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid