| |
GeekInterview.com > Placement Papers > Oracle > Java
| Print | |
Question: Difference between SAX and DOM?
|
| December 12, 2005 12:06:45 |
#4 |
| Habeeb Mohmed |
Member Since: Visitor Total Comments: N/A |
RE: Difference between SAX and DOM? |
SAX Historical Background ! Simple API for XML! Started as community-driven project " xml-dev mailing list! Originally designed as Java API " Others (C++, Python, Perl) are nowsupported ! SAX 2 " Namespaces SAX Features ! Event-driven " You provide event handlers! Fast and lightweight " Document does not have to be entirely in memory! Sequential read access only! One-time access! Does not support modification of document Historical Background l DOM is a standard defined by theW3C, just like XML l DOM was not designed specifically forJava technology (unlike SAX) l DOM is cross-platform and crosslanguageu Uses OMG’s IDL to define interfacesu IDL to language binding DOM Characteristics l Access XML document as atree structure l Composed of mostly element nodesand text nodes l Can “walk” the tree back and forthl Larger memory requirementsu Fairly heavyweight to load and storel Use it when for walking and modifyingthe tree |
| |
Back To Question | |