Use PHP and XML for website programming (1) _ PHP Tutorial

Source: Internet
Author: User
Use PHP and XML for website programming (1 ). I. limitations of HTML 1. poor HTML scalability. As a general application, HTML should be sufficient, but HTML has obvious disadvantages when dealing with symbols such as mathematics and chemistry, and I. limitations of HTML

1. poor HTML scalability. As a general application, HTML should be enough, but HTML has obvious disadvantages when dealing with symbols such as mathematics and chemistry, and it cannot be expanded, in this way, its development has been greatly restricted.

2. the link cannot be automatically corrected after it is lost. Because the URL address on the web page changes frequently, you must manually modify the information when changing the URL address. Otherwise, the information "404URL address Not Found" is displayed, this greatly increases the web page maintenance workload.

3. long data search time. HTML is mainly used to control the display of web pages. as a result, the same data has different storage formats on different web pages. in this way, you cannot quickly find the desired information during data search.

4. HTML does not support double-byte or multi-country text. For example, the Chinese information page cannot be displayed on different platforms.

Due to these shortcomings, people have studied the Web page production language that can replace HTML. Some of them have been put into use: Extensible Markup Language XML, Cascading Style Sheets (CSS), Dynamic HTML (DHTML), and so on.

II. XML composition

Here we will briefly list several major XML technologies:

1. DTD(Document Type Declaration)

The main function of DTD is to define the content mode of XML, limit the data range marked by XML, and define the data type of attributes. However, because it is not written in XML, it has poor scalability and only provides several limited data types, so its role is limited.

2. XML Schema

The role of XML Schema is similar to that of DTD. However, the difference is that the Schema file describes the specific types of elements and attributes in the XML file that references it. In addition, because it is written in XML, Schema has the following advantages over DTD:

◆ The XML Schema content model is open and can be expanded at will, while the DTD cannot parse the expanded content.

◆ DTD can only define the content type as a string, while XML Schema can define the content type as integer, floating point, Boolean, or many other simple data types.

◆ XML Schema uses Namespaces to associate special nodes in the document with the Schema. an XML file can have multiple corresponding schemas, and an XML file can have only one DTD.

3. XLink

As a Web language, the link capability of XML is very important. XML links and addressing mechanisms include XLink, XPath, and XPointer. XLink provides powerful link methods to establish one-way or multi-direction complex links between documents, as well as annotation links, summary links, extended link sets, and other link functions. XPath is used in XSLT and XPointer. it supports locating relative nodes and node sets in XML documents. Based on XPath, XPointer provides positioning for the internal structure (such as a string or a selected paragraph) of the content of the XML document. The link capability of XML is greatly enhanced than that of HTML.

4. CSS and XSL

A major feature of XML is the separation of content and format. that is to say, XML documents do not contain information about how to display/represent documents. CSS and XSL (XML Style Language) solve the XML document display problem.

CSS (stacked style sheet) can also be used in HTML and XML. XSL fully uses the XML syntax, which is much more powerful than CSS.

5. DOM

The Document Object Model (DOM) is a platform-and language-independent program interface that provides a means to dynamically access and update the content, structure, and style of a document. The text can be further processed and the processing result is updated to the presentation page.

The purpose of DOM is to define a standard programming interface for XML and HTML, which includes three parts: core, HTML, and XML. The core part of DOM establishes a set of underlying object sets, which can represent any structured documents. HTML and XML provide high-level interfaces for convenient document views. DOM norms consist of objects and methods. Programmers can use them to access and operate specific types of documents more easily.

6. Namespaces

Namespaces is a set of all the names in the elements and attributes of the XML file that are differentiated by URLs. In XML, you can define tags and elements by yourself. Therefore, if you merge multiple XML files into one, conflicts may occur. Namespaces solves this problem.

1

Protocol 1. poor HTML scalability. As a general application, HTML should be enough, but HTML has obvious disadvantages when dealing with symbols such as mathematics and chemistry, and...

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.