C # Discovery Tour Tenth lecture Document Object model

Source: Internet
Author: User
Tags object model web database

To get a deeper understanding and use of C #, we will begin this series of technical lectures on the "C # Discovery Tour". Given that most of you are in the Web database development, and the so-called discovery is found that we are unfamiliar with the field, so this series of lectures will be C # in the Web database development outside the application. The main content of the current planning is graphic development and XML development, and plans to organize a number of courses. In the next C # Discovery Tour, we follow the step-by-step steps to explore and discover the other unknown areas of C #, a deeper understanding and mastery of the use of C # for software development, broaden our horizons, enhance our comprehensive software development capabilities.

Course description

This course is devoted to the concept of the Document Object model, is theoretically strong, requires careful thinking, and there is no demo program, this course is the C # Discovery Tour series of the end of the course, but do not rule out my future C # Discovery Tour of the possibility of the sequel.

Document Object Model Definition

Document Object Model in English, the name is the "Documents" object, referred to as DOM, it is a more important software design patterns, not programming skills. It can be said that the life does not recognize the DOM, then called the hero is in vain, we should know more about its ability.

Document Object model is the embodiment of object-oriented programming technology, without complete object-oriented programming, it is impossible to understand and develop the Document Object model, if the developer can develop the Document Object model, it means that he/she has a complete understanding and mastery of object-oriented programming ideas.

This is the definition of the Document Object Model (excerpted from http://www.w3.org/DOM/) by the International Organization for global access.

The Document Object Model is a Platform-and language-neutral interface that would allow programs and scripts to Dynamicall Y access and update the content, structure and style of documents. The document can be further processed and the results of that processing can is incorporated back into the presented page. This is a overview of dom-related materials here and around the web.

In my own English level translation is as follows

A Document Object model is a platform or language-neutral interface that a program or script can use to access and update structured documents. These documents can be further processed and the processing results can be made into a valid page. This is the general view of the Document object model principles on the web.

Document

Let's step through the definition. First, what is a document. Documents are packets that are organized together in a structure. For example, a MS Word document is a document that contains many characters, pictures, paragraph data, and is saved in a binary file using a specific organizational structure. HTML documents, for example, contain text, pictures, links, form data, and can be organized into a hierarchical structure in a string or text file, in accordance with the exposed HTML syntax.

Structured documents

Second, what is structured document, many documents its content organization presents a hierarchical structure. That is, its content abstraction can form a tree-like structure, such as HTML documents, XML documents.

For ordinary text documents, it is a string from the developer's perspective, where there is no correlation between the characters or substrings. The normal text document is not a structured document, and the text document becomes a hierarchical document if the parsing of a support hierarchy is imposed on the text document.

If an HTML document is not interpreted in HTML syntax, it is a plain text document, an ordinary string, and if the HTML syntax is imposed on the string, the plain text document becomes immediately a fairly complex structured document. In the same way, plain text documents, such as XML files, SQL statements, are an ordinary string before it is interpreted, and then become xmldom,sqldom.

Programming interface

Dom is an interface or platform, for software developers, this so-called interface or platform is the programming interface (API), there are many kinds of APIs, there are direct call function interface, such as the traditional Win32API function, there is the exposure of programmable objects, programming objects have public property methods or events, than such as COM interfaces or. NET class library interfaces. There is also a web-based WebService programming interface. In general, for DOM, the programming interface is represented as a programming interface for programmable objects, where the DOM publishes several programmable objects, and other applications or scripting languages can invoke the exposed members of those programmable objects.

An important feature of DOM is that applications or scripting programs can use it to access and update structured documents. This means that DOM provides a number of programmable objects that are internally used to ensure that it maintains a relationship with a part of a structured document, especially when the attributes of the object and the attributes of the document fragment remain mapped. But the external program obtains the programmable object the attribute, passes through the DOM internal mapping relation, actually is equivalent to obtains a certain document fragment the attribute, the external program modifies the programmable object the attribute, passes through the internal mapping relation, eventually causes the document fragment the attribute the modification. So DOM is the proxy between application software and structured documents, where the application uses the DOM to pivot out the contents of the document and also to modify the contents of the document through the DOM "GE Cow" way.

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.