Page 118 - DCAP202_Fundamentals of Web Programming
P. 118

Unit 9: DOM Model




          taken from an HTML document:                                                          Notes
            <TABLE>
            <ROWS>
            <TR>
            <TD>Shady  Grove</TD>
            <TD>Aeolian</TD>
            </TR>
            <TR>
            <TD>Over  the  River,  Charlie</TD>
            <TD>Dorian</TD>
            </TR>
            </ROWS>
            </TABLE>
          The Document Object Model represents this table like Figure 9.1.
                           Figure  9.1: DOM  Representation of  the  Example  Table























          The name “Document Object Model” was chosen because it is an “object model” is used in the
          traditional object oriented design sense: documents are modeled using objects, and the model
          encompasses not only the structure of a document, but also the behavior of a document and the
          objects of which it is composed. In other words, the nodes in the above diagram do not represent
          a data structure, they represent objects, which have functions and identity. As an object model,
          the Document Object Model identifies:

              the interfaces and objects used to represent and manipulate a document
              the semantics of these interfaces and objects – including both behavior and attributes
              the relationships and collaborations among these interfaces and objects
          The Document Object Model currently consists of two parts, DOM Core and DOM HTML. The
          DOM Core represents the functionality used for XML documents, and also serves as the basis for
          DOM HTML.

               !

             Caution  All DOM implementations must support the interfaces listed as “fundamental” in
             the Core specification; in addition, XML implementations must  support the interfaces
             listed as “extended” in the Core specification.




                                           LOVELY PROFESSIONAL UNIVERSITY                                   111
   113   114   115   116   117   118   119   120   121   122   123