Click here to Skip to main content
Click here to Skip to main content

XML Reading Using DOM and SAX

, 10 Aug 2002
Rate this:
Please Sign up or sign in to vote.
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. <!-- Download Links -->


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

Web Developer
Bulgaria Bulgaria
No Biography provided

Comments and Discussions

GeneralMy vote of 1 PinprotectorBarry Lapthorn21-Feb-10 22:37 
GeneralMy vote of 1 Pinmemberxandervdm14-Sep-09 1:36 
General[Message Removed] Pinmemberhankjmatt13-Oct-08 23:18 
GeneralI got what I was looking for PinmemberAshutosh Bhawasinka6-Dec-06 11:30 
Questionwhere is SAX? PinmembertheGrim11-Oct-06 7:25 
GeneralARTICLE SUCKS PinsussAnonymous15-Dec-04 0:16 
GeneralArticle sucks PinsussAnonymous17-Oct-03 5:52 
GeneralRe: Article sucks Pinmemberdog_spawn17-Oct-03 6:02 
GeneralPoor Article PinmemberPaul A. Howes12-Aug-02 3:35 
No offense, but you really need to make the article more complete. First off, reading abbreviations, such as "u r" instead of "you are" is painful. Leave those in the chat rooms where they belong. Second, talk a little more about your experiences: What problems did you run in to while developing this code? Why were you working on this at all? What are some of the differences between processing a file with SAX versus the DOM?
If you can make these changes, then I will be more than happy to vote for your article.
"I drank... WHAT?"
GeneralRe: Poor Article PinmemberBubba214612-Aug-02 5:26 

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.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.141220.1 | Last Updated 11 Aug 2002
Article Copyright 2002 by rosen
Everything else Copyright © CodeProject, 1999-2014
Layout: fixed | fluid