next Design Patterns
up XML Parsing Stategy
previous The Simple API for XML
  Contents
PDF version   PostScript version

The Document Object Model

Unlike SAX, DOM is a statefull parsing strategy, and it consequently also represents a data structure. During parsing, new elements are added to a tree data structure, leading to a memory representation (DOM tree) of the integrality of the XML document. The DOM tree may then be traversed in any suitable fashion, and nodes may be altered if necessary. This flexibility may however have an important performance overhead, both in term of memory and processing requirement--depending on the size of the document.

SOAP messages are typically small documents, of in the order of 10 to 50 nodes, so that performance degradation is not an issue. Two more arguments are in favour of the use of the DOM strategy. First, all of the elements of the DOM tree are needed during the SOAP interpretation process. Then there is also a need to traverse the tree back-and-forth. Because of the flexibility offered by the DOM approach, it is also used during SOAP messages construction, by the Message class and its subclasses.


next Design Patterns
up XML Parsing Stategy
previous The Simple API for XML
  Contents

Copyright © 2001 Jean-Marc Rosengard