Website refactoring: discussing XHTML2.0 and HTML5.0

Source: Internet
Author: User
Tags object interface modify naming convention reference return version zip

After the team's CSS3.0 Chinese handbook in the domestic starting, the recent popular everywhere blowing HTML5.0 and CSS3.0 spring Breeze; It seems that in this browser to ridicule each other in the era, the achievements of a lot of industry gossip topic.

Years ago, Google's Chrome team came to the company to do the related exchanges, the company asked me to do a preliminary discussion plan. Then thought for a moment, which mentioned three points:

    1. Chrome support for font size above 12px
    2. Chrome's developer tools are integrated, but not as flexible and easy to use as Firebug.
    3. The interpretation of the Web page should be rendered with two interpretations of its kernel.

The previous two points are more targeted to chrome itself, and the 3rd, I think, is more about writing programmers for our new age browsers, and our foreign friends who are working on the standards of the Global Consortium.

Recalling that the time of war between XHTML2.0 and HTML5.0 spanned nearly 4 years (2002/8/5--2006/7/26), the result of the battle was now XHTML2.0 to retreat.

This war, we are above XHTML2.0. The first thing worth saying is the reflection that he left behind in his thoughts: (See Nicholas Chase Master's " the Web "s future:xhtml 2.0 "Click to Skip foreplay. )

1, will be such as B, I and other purely on the performance of the label and the use of semantic instead. (structure, behavior, performance separation of the three)

<i> emphasis on </I> <b> more emphasis </b>

And

<em> emphasis on </EM> <strong> more emphasis </strong>

2, the IMG and other content pictures using SRC attribute instead, and use srctype for type definition. (Display text Description when external resources fail to load, remove alt restriction)

<object> introduction of Apple by using object audio </object>

<p> This is a description of the fruit of the apple. </p>

And

<p src= "Apple.mp3" srctype= "Audio/x-mpeg" >
<span src=http://www.webjx.com/css/"Apple.png" srctype= "Image/png" > This is a picture of an apple </span>
This is an explanation of the fruit of the apple.
</p>

3, the "no level" of the article using

And

<title> Web page modularity </title>
<body>
<section>
&LT;P&GT;2010 Year v2.0 version </p>
<section>
<p> modularity refers to the process of dividing a software system into several modules from top to bottom when solving a complex problem. Each module completes a specific sub function, and all modules are assembled in a way that becomes a whole and accomplishes the functions required by the entire system. </p>
<section>
Each of the <p> pages has independent content and can give the title to the fragment. </p>
</section>
</section>
<section>
Why should <p> Collaborative development with a part of the overall control, but each individual can handle their own part of the code, while not interfering with other members of the code, a high degree of efficiency. Modify only need to deal with the independent need to modify the module, the rest of the module will not affect, the error to navigate to the specific module, directly for this piece version rollback. High risk reduction. </p>
</section>
<section>
<p> the main content to refine the content of the two ways to separate the block, by the PM for the naming convention, assigned to the hands of the code to write. Finally, the code fragment is merged by PM. </p>
</section>
<section>
What do <p> common part of the code permissions need to return to the PM hand management; allow the code to be bloated periodically, with regular version integration of the public parts. </p>
</section>
</section>
</body>

4, the original <ul> or <ol> misuse of the navigation list menu using <nl> Replace. (The premise is that the list is best to have a description of the principle)

<ul>
<li><a href= "index.html" > Home </a></li>
<li>
<ul>
<li><a href= "cn.html" > Chinese </a></li>
<li><a href= "jk.html" > Japan and South Korea </a></li>
<li><a href= "eu.html" > Europe </a></li>
</ul>
</li>
<li><a href= "bbs.html" > Forum </a></li>
</ul>

And

<nl>
<label> navigation Menu </label>
<li href= "index.html" > Home </li>
<nl>
<label> Music Library </label>
<li href= "cn.html" > Chinese </li>
<li href= "jk.html" > Japan and South Korea </li>
<li href= "eu.html" > Europe </li>
</nl>
<li href= "bbs.html" > Forum </li>
</nl>

5. There are "ubiquitous links" in the example above. (Removal of unnecessary tags)

Of course, the discerning eye can be seen from the Nicholas Chase 's "The Web" s future:xhtml 2.0 of the content (for the last, the HTML5.0 of the draft has been updated). There are one by one explanations in his article, and I don't do one by one of explanations here.

OK, or this early stage is too long, we return to the theme of speed. Some of the great virtues of the XHTML2.0 we mentioned above can be found in the new HTML5.0 draft of the same match. However, Twinsen has always considered XHTML to be the intersection of HTML and XML (which, of course, is often said to be a transition product); XHTML should be a class database framework with content and information architecture at its core (that is, XHTML can act as a pure expression, and its cosmetic appearance lies in CSS On the other hand, it can be referenced as XML as data; Then we can see a new idea in Jeremy Keith's "Misunderstanding Markup"and"The chaos of the Mark language" (translation) . Jeremy with milk analogy HTML4.0, and use cheese analogy XHTML1.0, and then use soy milk analogy XHTML2.0, here Twinsen again boldly will HTML5.0 analogy to yogurt. Here you can imagine, Cheese and yogurt are derived from milk extraction and lactic acid bacteria fermentation (XHTML1.0 and HTML5.0 from HTML4.0 refining and fermentation), and soy milk but there is a fundamental difference (XHTML2.0 from the composition of the three have nothing to do with it), of course, here are different flavors of yogurt is added to the taste material (canvas) and other new elements So that it can be clearly a few language standards for a new comb. and Twinsen to emphasize the difference between HTML and XHTML as mentioned in Jeremy's article:

    1. All labels must be closed (or self closed)
    2. attribute must be enclosed in quotes
    3. No label for misplaced nesting
    4. Label attributes are unified with lowercase

May Jeremy a more tactful way of technical guidance; But perhaps he did not come to China, aware of the history and Development of Chinese website reconfiguration. China has a modern saying: "A Chinese is a dragon, a group of Chinese people is a worm." "And this sentence from China's most ambitious Mr. Lu Xun began, has been the thinking has been circulating." We can recall the dial-up era, when Twinsen came by, and saw a jumble of CGI HTML3.0, then mixed with table and ASP or PHP HTML4.0. The era has been extended to the emergence of Atzie, the Web site to reconstruct a book with that let countless Chinese Internet boss has seen the PPT; this has completely overturned the past thinking, guiding a new trend. Under their leadership, people are proud to pass standard validation, and "Valid XHTML 1.0 Strict" appears below each site. And how many people can understand the true meaning of this mark? As Freud said: "People's Oedipus complex will eventually evolve into an idol worship." ”。 It is the same as Grandpa Mao, and the back of the spring elder brother's appearance, Atzie became a generation of idols, but sadly, the swift Swift retreat out of the world of Reconstruction. At this point many of the new refactoring engineers joined, and they started questioning, and a part of the old refactoring engineers began to get confused. China began to circulate a not for the standard verification and do the page, and then began to cheat (mark disorder still use XHTML1.0 strict type of doctype). From idol worship, evolution to follow, to the back of the deception. This, of course, has its historical inevitability and contingency.

At this point we may also cite some words from Twinsen's first idol to see ourselves:

Reference Content
Mao on Chinese house prices
We are now talking about the high prices, this is also the fact that the price is high? I think there's a demand pull, not a cost boost, not because of the high cost. What is demand pull? is a lot of people willing to buy, your price He also bought, this is the demand to pull high. You know economics, do not ask you to buy a house, is to ask you not too expensive. Sociological use of questionnaires, the economics of the conduct of the assessment of the market, you even though you said that you pay to buy, it means that you are not too expensive, you too expensive will not buy.

We can calculate, IE6 how big, ff how big, ch how big, op how big, sa how big ... All clearly, there is no need to question. We hate IE6 every day, but we are still doing IE6 compatibility. Does that mean you don't hate IE6? From the technical thinking, this is completely contradictory, because there is no macro-control, is the demand to pull IE6 survival, rather than cost-driven IE6 survival.

Reference Content
about Mao who prevents us from getting rich?
You run after a bus, but just want to step on the car when the conductor closes the door, ring to start, away;
When you write, you forget to write the other's zip code, although you know this code;
You do not know the ZIP code, so did not write, the result letter was returned by the post office;
There is a quarrel on the road, we stop to wait and see, with infinite interest, will want to poor it so just willing to go;
-Red traffic, crossroads whack, each other squeezed can not move;
-The police overturned the goods of the stall hawker and even threw the Hawker's tricycle on the lorry;
--The meeting time someone has not arrived, everybody waits for more than 10 minutes.
......
These phenomena are common to us every day, and no one can think of any relationship between them. But from an economist's point of view, these phenomena are not conducive to China's development is an important reason.
From the basic point of view of economics, poor because many productive potential can not play, because people's labor is not used in production, and even in the efforts to counteract the achievements of other people's work, but also because of a wide range of waste is widespread, the society has consumed huge wealth, but everyone can do nothing about it.

There is another very classic section of the summary.

Reference Content
about Mao who prevents us from getting rich?
It does not fall within the jurisdiction of the law, and it is not an offence or even a moral issue, but the end result of a large number of such events is detrimental to social development. The cause of this kind of thing, the responsibility lies in each of us people, whether you are a salesman, a driver, a teacher, a telephone operator, or a government clerk, changing the principles of your affairs may increase the wealth of the community, and when everyone thinks so, the country becomes rich, and the same work you pay will be paid higher.

you do the Web, and it won't go wrong, not even read, but the end result of a lot of such events is that the browser will not be sealed for your label, attributes do not write double quotes, but to write more cumbersome code, more expensive CPU operations. as mentioned in the three paragraphs above, do you understand why the IE6 you hate every day is so big? Why does it exist so far? All of us--these web site refactoring people single-handedly caused by a foot!!

Looking back, the title of the article is called "Walk with the Chinese characteristics of the Web site Reconstruction Road." RMB appreciation, China's comprehensive national strength to upgrade, the world is moving closer to China. And the birth of HTML5.0, he returned to the HTML4.0 defeated HTML3.0 era, a new technology was born in the era, a promotion of free application of the era; in China countless just debut "page Tsai" will be in such an era of trouble (200 yuan to build stations, Direct Fireworks Chettu Generate pages ... And at this point, we have been worshipping FF, CH, OP, SA ... Do you want to go back to the old path like IE6? and are we going to start hating and hating them the same way? And is this the process that we as a comprehensive national power in this time should not be "a worm"?

Of course, Twinsen is not simply to raise questions and criticisms, not to oppose HTML5.0; we can think of a more sensible solution:

    1. Use XHTML's requirements (4 points above) to write HTML5.0.
    2. Recommended browsers use a dual-resolution kernel, one to the standard page, one to non-standard. (When non-standard pages use standard DOCTYPE, parsing is misplaced or directly closed or unresolved; this is what I recommend to the Chrome team.) )
    3. Teach everyone around you to maintain the purpose and importance of the standard.
    4. always remember that you are not a "page boy", a refactoring engineer; or even more, you are affecting the development of the human information society.

Also bring a question to everyone, without the "ISO9002" verified products you dare to use it? What about the Web pages that have not been validated by the "Internet"? So what's the proof for? (thank you for always taught me the importance of ISO9000 system Qingjie) or we imagine your business trip, the hotel's network interface is not RJ45, and then you can not plug into the network (each browser has a private attribute to the CSS3); or the hotel's network cable interface is a row, corresponding to RJ42, RJ43, RJ44, RJ45, RJ46 ... From the door has been routed to the Windowsill (browser to compatible with a variety of cluttered pages of code bloated).

In the end, I quote some words from the Jeremy article: "As long as you want, HTML5.0 can immediately become XHTML5.0"; XHTML2.0 dead, XHTML and HTML5 are kingly. ”。



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.