Four basic interfaces of DOM object model (1)

Source: Internet
Author: User

In the DOM object model interface specification, there are four basic interfaces. Among these four basic interfaces, the Document interface is the entry for operations on documents, which is inherited from the Node interface. The Node interface is the parent class of most other interfaces, while the NodeList interface is a collection of nodes that contain all the child nodes in a Node. The NamedNodeMap interface is also a set of nodes.

Four basic interfaces of the DOM object model

In the DOM object model interface specification, there are four basic interfaces: Document, Node, NodeList, and NamedNodeMap. Among the four basic interfaces, the Document interface is the entry for Document operations, which is inherited from the Node interface. The Node interface is the parent class of most other interfaces. interfaces such as javaset, Element, Attribute, Text, and Comment are inherited from the Node interface. The NodeList interface is a collection of nodes that contain all the subnodes of a node. The NamedNodeMap interface is also a set of nodes. Through this interface, you can establish a one-to-one ing between node names and nodes, so that you can directly access specific nodes by using node names. The following describes the four interfaces.

1. Document Interface

The Document interface represents the entire XML/HTML Document. Therefore, it is the root of the entire Document tree and provides an entry for accessing and operating the data in the Document.

Because elements, text nodes, comments, and processing commands cannot exist independently from the context of the Document, the Document interface provides a method to create other node objects, the Node object created using this method has an ownerDocument attribute to indicate who created the current node and the connection between the node and the Document.

Shows the relationship between the Document interface and other interfaces in the DOM tree:

The figure shows that the Document node is the root node in the DOM tree, that is, the entry node for operations on the XML Document. With the docuemts node, you can access other nodes in the document, such as instructions, annotations, document types, and root element nodes of the XML document. In addition, we can also see that in a DOM tree, the Document node can contain multiple processing commands and comments as its subnodes, the document type node and the XML document root element node are both unique.

The Document interface's IDLInterfaceDefinitionLanguage Interface Definition Language (IDLInterfaceDefinitionLanguage) and some of the more common attributes and methods can be found in many reference books.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.