CHAPTER  4 The Document Object Model (DOM) WE HAVE SEEN HOW AN XML document can be transformed into an HTML docu- ment for presentation and into another XML document. What else can we do with an XML document? The next natural thing we would like to do is to manipu- late the data and structure in an XML document. The basic functions would include insertion of new information, modification or deletion of existing data in the document. In this chapter, we introduce DOM programming as a technique for achieving this objective. Introduction to DOM The Document Object Model (DOM) provides an application programming interface (API) that is platform- and language-neutral. Application developers can access and manipulate the data in an XML document through these inter- faces using their favorite scripting or programming languages and without having to worry about the platform on which the scripts will run. 107 NOTE  The freedom in choosing the platform and language is, however, dependent on the parser to be used to expose the XML DOM implementation of an XML document.We will look at DOM parsers in a moment. The World Wide Web Consortium (W3C) releases the DOM specifications according to levels: "  The DOM Level 1 specification was released as W3C Recommendation in October 1998. The working draft of the second edition is submitted in September 2000 to incorporate errata changes of the earlier version. "  The DOM Level 2 modules were released as W3C Recommendations in November 2000.