XML Document Object Model DOM (on)

xiaoxiao2021-03-06  45

Document Object Model DOM is a subject to change and query documents by programming. Since the W3C organization provides a unified DOM interface, this makes various language cross-platform applications possible. If an application is based on DOM, we can do not have to care about what language implemented, DOM for various languages A unified object, attribute, method, and event are displayed. The DOM is a tree structure in the XML document in memory. When an XML file is loaded into the XML parser, a corresponding tree is established in memory. MSXML4.0 fully supports DOM, and provides an easy-to-use object model interacts with XMLDOM trees in memory so that we can easily manipulate the XML document through applications or scripts.

Three document models: Linear model: Good at handling static documents, like books, but if this book wants to change the format, or add content, change the number of pages, this model will be powerless. Tree model. Object Model: The XML object model is a collection of objects. With it we can operate data in the XML document, you can also see the XML object model as a tree, there is a corresponding node, each node contains the corresponding document data. However, it adds an object-specific attribute method and event equivalent to the tree model.

The following examples are expanded around this XML

tony blair

10 downing street, london, uk

(061) 98765 (061) 98765

blairl@everywhere.com

Bill Clinton

White House, USA

(001) 6400 98765 (001) 6400 98765

Bill@everywhere.com

Tom Cruise

57 Jumbo Street, New York, USA

(001) 4500 67859 (001) 4500 67859

cruise@everywhere.com

linda goodman

78 CRAX LANE, LONDON, UK

(061) 54 56789 (061) 54 56789 linda@everywhere.com

XML document node ixmldomnode domnode is the basic object in the DOM. Elements, attributes, comments, process instructions, and other document components can be considered ixmldomnode. In fact, the DomDocument object itself is also an ixmldomnode object. The interfaces listed below have inherited his methods and properties. Domdocument ixmldomelement ixmldomattribute ixmldomdomtomtystepe ixmldomentity ixmldomtext document node properties: LastChild; NextSibling: Points to the next brothers node of the same parent node, read-only properties. XML: Format this node and all child nodes in XML format, read-only properties.