Html, xhtml, xml differences in definitions and

1 Origins 

  SGML, HTML, XML, XHTML, HTML5
  from the name of five persons, we can see the "ML" these two letters, so we start with the "ML" start.

  "ML" that is "Markup language (markup language)." According to Wikipedia on it, "Markup language" is the standard tags to interpret the content of plain text documents, providing information on how the document structure of the document or rendering. Development of markup languages ​​can be represented by the following chart:

   

  GML is the first generation markup language, so that the document can clearly separate labeling and content, so the file using the same labeling method.

  SGML organize on the basis of GML, formed a set of very strict file description method. It consists of three parts of the syntax definition, DTD, Document Instance. SGML were too strict norms of more than 500 pages, and therefore not easy to learn, easy to use, difficult to achieve, so it has developed on the basis of other markup language easier to use.

  HTML is that people extracted a tiny subset of SGML and extracted. Loose its early specifications, but relatively easy to learn.

  XML is a subset of SGML, but the use of more stringent mode.

  The emergence of XHTML is because HTML is not good expandability, performance content not keep up with the changing times (if you can not represent certain chemical symbols, etc.), and because of performance problems, the official becoming more and more strict mode, using strict XML W3C XHTML became a regular program in HTML replacement.

  HTML through a series of amendments, and now talking generally refers to HTML HTML 4.01; and now HTML 5 is the fifth revision of the HTML, the main goal is to semantic Internet, in order to better be read humans and machines , while providing better support a variety of media embedding. And HTML5 is not the technology itself, but rather the standard. It uses technology already very mature, domestic commonly referred to as html and css3 html5 is actually a combination of JavaScript and api and so on, probably can be illustrated by the following equation: HTML5≈HTML + CSS3 + JavaScript + API.

 

2 Definitions and characteristics

(1)   XML

  Extentsible Markup Language XML is the Extensible Markup Language

  XML is a meta language used to define other languages, the predecessor of SGML (Standard Generalized Markup Language). It does not set label (tag set), nor the rules of grammar (grammatical rule). But it has syntax rules (syntax rule).

  Whatever XML documents regardless of the application and to correct what type of parsing must be well-formed (well-formed). That is, each open tab must have a matching closing tag, label must not contain reverse order, but syntactically should meet the technical specifications. XML documents can be effective (valid), but not necessarily require effective. The so-called valid document refers to document its compliance with its document type definition (DTD) of.

  Suppose a document compliance with a prescribed pattern (schema) of. Well, this document is a valid model (schema valid).

(2)   HTML

  HTML is the Hypertext Markup Language Hypertext Markup Language.

  HTML (HyperTextMark-upLanguage) that is HTML, WWW is a narrative description language. HTML language is designed to be able to be stored in a computer text or graphics and there is a computer in text or graphics to easily link together to form an organic whole, people do not consider the detailed information on the current computer or on other computer networks. We just need to use the mouse to take an icon in a document midpoint. Internet will immediately go to the icon associated with this content up. And this information may be stored in the network as well as a computer.

  HTML text is a narrative description of the text by the HTML commands composed, HTML commands can explanatory text, graphics, animation, sound, tables, links and so on. HTML structure includes a head (Head), the body (Body) two parts, of which the head of the information needed to describe the narrative browser. The main details to be explained is included. Additionally, HTML is the common language of the network, a simple, common-wide home Markup Language. It agreed to establish a complex web authoring page of text and pictures combination, these pages can be online no matter what other people browse to, no matter what type of computer or browser.

 

(3)   XHTML

  XHTML is EXtensible HyperText Markup Language Extensible Hypertext Markup Language

  As the next generation of HTML. We can understand XHTML is an upgraded version of HTML. XHTML is a transitional HTML language like XML. It will be high than HTML rigor. Then follow the basic language or HTML tags. Just abolished the label portion of the presentation layer, and colleagues on the high standards strict nesting spot for example tags, labels and so on end. In today's market there are different browser technology. Some browsers executed in a computer, executes some browsers on mobile phones and handheld devices. The latter no ability and means to explain the bad markup language.

  Therefore, the HTML and XML respective benefits be combined, we get in now and in the future can come in handy markup language - XHTML. XHTML can be read by all XML-enabled device. Before the same time to upgrade to XML support in the rest of the browsers, XHTML gives us the ability to write a document has a good structure. These documents can very well work in all browsers, and backward compatibility.

 

3 difference and contrast

3.1 XML sum HTML

XML and HTML controls:

(1) XML is designed to describe narrative data, the focus is: What is the data, how to store data.
(2) HTML was designed to display data, focusing on: how to display data and display data to better it.

The relationship between HTML and XML:

(1) In fact no difference between HTML and XML is certainly linked, XML is not to replace HTML, XML can actually regarded as a complement to the HTML.

(2) XML and HTML different objectives: HTML design goal is to focus on the display data and the data faade. The design goals for XML data and narrative description is focused on the content of the data.

(3) similar to HTML, XML not matter what operating. Although XML tags can be used to describe the structure of the narrative item orders and the like, but it does not include or be used to send orders and ensure that the process no matter what the code according to the order of delivery, other people have to write code to the actual data in XML format to run these operations.
  Unlike HTML, XML schema or mark defined by the author of the document, but it is unlimited.
  HTML tags are defined in advance; HTML authors can only use the current standard HTML tags supported.

(4) Unlike HTML. XML tags or document architecture defined by the author, but also unlimited. HTML tags are defined in advance; HTML authors can only use the current standard HTML tags supported.

 

3.2 HTML and XHTML

  HTML and XHTML controls:
  XHTML as an upgraded version of HTML. Of course there are many other specifications. For example the following details:

(1) all of the tags necessary to have a corresponding end tag.
  Once in HTML. You can open a lot of labels, such as and <li> and not necessarily write the corresponding </ li> to close them. But in XHTML, which is not legal.
  XHTML requires strict structure, all tags must be closed.
  Suppose a separate unpaired tag. In the last label plus a "/" to close it.
  For example: <img height = "80" alt = " web designer" src = "../ images / logo_w3cn_200x80.gif " width = "200" />.

(2) the names of elements and attributes of all tags must be lowercase.
  HTML is not the same and, XHTML on the upper and lower case sensitive.
  <title> and <TITLE> tag are different. XHTML requires all name tags and attributes must be lowercase. For example: <BODY> must be written as <body>. Uppercase and lowercase inclusion is not recognized.
  Attribute names are usually dreamweaver automatically generated their own "onMouseOver" must also change to "onmouseover".

(3) all XML tags must be properly nested.
  Since XHTML require the same rigorous structure. Therefore, all must be nested sequence.
  Once we write code: <p> <b> < / p> < / B> must be modified as: <p> <b> </ b> </ p>.
  That is to say. Layers of nesting must be strictly symmetrical.

(4) all the properties must be quoted "" quotes.
  In HTML. You do not need to be able to attribute values in quotes, but in XHTML, they must be in quotes.
  For example: <height = 80> must be modified as: <height = "80"> .
  Special cases, you need to use the property value in double quotes, you could use ", single quotes may be used & apos ;,
  for example: <Alt =" say & apos,; Hello & apos,; ">

(. 5) the whole <and & special symbols represented by encoded .
  regardless of less than (<). not part of the tag must be encoded as & lt; whatever greater than (>), not part of the label must be encoded as & gt whatever ampersand (&). , not part of the entity must be encoded as & amp; Note: no more space between characters.

(6) assign a property value to All.
  All the provisions of XHTML attributes must have a value, not value itself repeatedly.
  For example: <input type = "checkbox" name = "shirt" value = "medium" checked>
  must be modified as:
  <INPUT type = "CheckBox" name = "shirt" value = "Medium" the checked = "the checked" />

( 7) Do not stare content manipulation "-." "-" can only occur at the beginning and end of the XHTML gaze, that is, they are no longer valid in the content.
  The following example code is invalid: <- here this is a gaze gaze ----------- -!>: Replace a broken line or a space inside of the equals sign.
  <! - here is the gaze ============ Here's gaze ->: Some of these specifications seem rather strange, but everything is in order so that we have a unified code, only standard, data to facilitate subsequent re-use.

(8) The image must have a caption. Each picture must have ALT tags descriptive text.
  <img src = "ball.jpg" alt = "large red ball" title = "large red ball" /> // For compatibility Firefox and IE, for the image label, and as far as possible alt title ditag, simple alt label no caption under Firefox.

 

3.3 How to Convert HTML to XHTML

  Join a XHTML <! DOCTYPE> Web page.
  Html xmlns attribute is added to each element of a page.
  All the elements of change to lowercase.
  Close all empty elements.
  All changes to the attribute name to lowercase.
  All attribute value the quotation marks.

 

 

 

 

Reference: https://www.cnblogs.com/huanqna/p/8178057.html

     https://www.cnblogs.com/lxjshuju/p/7098341.html

Guess you like

Origin www.cnblogs.com/iamspecialone/p/11227978.html