- Document-Centric
Document Centric XML processing is a notion first introduced in
VTD-XML . Before VTD-XML, traditional XML processing models (e.g. DOM, SAX and JAXB etc.) are designed around the notion of objects. The XML text, merely as the serialization of the objects, is relegated to the status of a second-class citizen. You base your applications on DOM nodes, string and various business objects, but rarely on the physical documents. If you have followed my articles on DevX so far, it should quickly become obvious that this object-oriented approach of XML processing makes little sense because of the performance hits from virtually all directions. Not only are object creation and garbage collection inherently memory and CPU inefficient, but your applications incur the cost of re-serialization with even the smallest changes to the original text.With document-centric XML processing, the XML document (the persistent format of data) is the starting point from which everything else comes about. Whether it is parsing, XPath evaluation, modifying content, or slicing element fragments, by default you no longer work directly with objects. You only do that when it makes sense. More often than not, you treat documents purely as syntax, and think in bytes, byte arrays, integers, offsets, lengths, fragments and namespace-compensated fragments. The first-class citizen in this paradigm is the XML text. And the object-centric notions of XML processing, such as serialization and de-serialization (or marshalling and unmarshalling) are often displaced, if not replaced, by more document-centric notions of parsing and composition. Increasingly you will find that your XML programming experience is getting simpler. And not surprisingly, the simpler, intuitive way to think about XML processing is also the most efficient and powerful.
Wikimedia Foundation. 2010.