The public interface of a DOM is specified in its application programming interface (API). Objects in the DOM tree may be addressed and manipulated by using methods on the objects. For example, with text nodes that cannot have child nodes, trying to add child nodes results in a DOM error. All objects can inherit properties and methods for dealing with parent and child nodes, but not all of the objects have parent or child nodes. It can be an element node, attribute node, text node, or any type that is described in section "node type". Notation represents a notation declared in the DTDĪ node object is represented by a single node in a tree.CDATASection represents a CDATA section in a document (text that will NOT be parsed by a parser).Text represents textual content in an element or attribute.EntityReference represents an entity reference. ProcessingInstruction represents a processing instruction.DocumentType provides an interface to the entities defined for the document.DocumentFragment represents a "lightweight" Document object, which can hold a portion of a document.Document represents the entire document (the root-node of the DOM tree).This object uses the Element interface to define all the methods and properties of that particular node.ĭifferent W3C World Wide Web Consortium node types and descriptions: So if a node type property is the constant node ELEMENT_NODE, one can know that this node object is an object Element. Each node has a node type property, which specifies the type of node, such as sibling or leaf.įor example, if the node type property is the constant properties for a node, this property specifies the type of the node. In other words, the node type is defined by how it communicates with other nodes. Node type ĭifferent types of nodes in a tree are represented by specific interfaces. While XML, HTML and XHTML provide the language and expression, the DOM serves as a translator. Though similar in how it is approached by a programmer, HTML and CSS is typically the language used to develop website text and design. For this reason XML is used to create common communication protocols used in office productivity software, and serves as the base for the development of modern web markup languages like XHTML. In programming, XML is used to communicate information between computer programmers and computers alike.
0 Comments
Leave a Reply. |