| Author |
DOM API vs SAX API
|
Naina Si
Ranch Hand
Joined: Nov 05, 2003
Posts: 134
|
|
Where do you use these API's in real world scenarios, i know the difference between them theoretically just by reading books. Any experienced guys out there shed some light?
|
 |
Theodore Casser
Ranch Hand
Joined: Mar 14, 2001
Posts: 1902
|
|
Just depends on what you're trying to accomplish when you're parsing the XML (ie, are you searching it for specific nodes, or building something based on a single pass through the whole tree). You tailor your application to use one or the other given the requirements and resources. DOM recreates the tree in memory and forces you to walk through it, step by step, to find what you want. SAX lets you look for specific nodes as you wander, but does it all in one pass. So that's usually the guide for determining, in the real world, which one to use. Hope it helps.
|
Theodore Jonathan Casser
SCJP/SCSNI/SCBCD/SCWCD/SCDJWS/SCMAD/SCEA/MCTS/MCPD... and so many more letters than you can shake a stick at!
|
 |
 |
|
|
subject: DOM API vs SAX API
|
|
|