官术网_书友最值得收藏!

What is the DOM?

The DOM is an application programming interface that is linked to HTML, XHTML, or XML documents and treats these similar to a tree where each node in the tree represents a part of the document.

In simple words, the DOM can be compared to a tree where there is a root node, intermediate nodes, and leaf nodes.

The root node has no parent; the intermediate nodes have a parent, one or more siblings, and one or more children. This is a very important concept and will help at the time of creating relative or customized XPaths, which we will see in a later part of the chapter.

Shown here is a sample DOM:

In the preceding diagram, there are three leaf nodes, two intermediate nodes, and one root node. All of this is contained in a document. The question that arises next is: how do we get to a particular node in this tree structure? This is where terms such as XPath and CSS come into picture.

XPath stands for XML Path and is a querying language to query the nodes in a DOM.

CSS stands for Cascading Style Sheets and is a style sheet language used for describing the look and format of a document written in any markup language.

主站蜘蛛池模板: 二手房| 阿坝县| 蛟河市| 西平县| 宝丰县| 岢岚县| 凤凰县| 东城区| 甘德县| 安岳县| 光泽县| 新田县| 聂拉木县| 和平县| 承德市| 长沙市| 台东市| 松溪县| 崇仁县| 甘泉县| 富蕴县| 北辰区| 长宁县| 舟曲县| 静海县| 梨树县| 庆安县| 西吉县| 克山县| 伊春市| 高淳县| 阿巴嘎旗| 海淀区| 甘孜县| 遂平县| 宝山区| 壶关县| 三原县| 海南省| 松溪县| 洛扎县|