Xml,html,xhtml

Source: Internet
Author: User
Tags closing tag dashed line

for the above 3 technologies. We often use, here in detail to do a summary. To compare these 3 things.


    • What is XML?
XML, extentsible Markup Language (Extensible Markup Language), is a meta-language used to define other languages, formerly SGML (Standard Universal Markup Language). It has no tag set (tag set) and no syntax rules (grammatical rule). But it has syntactic rules (syntax rule).

Any XML document must be well-formed (well-formed) for whatever type of application and correct parsing. That is, each open label must have a matching end tag, not a reversed-order label, and the statement composition should conform to the requirements of the technical specifications. XML documents can be valid (valid), but not necessarily valid. A valid document is a document that conforms to its document type definition (DTD).

Suppose a document conforms to the rules of a schema. Then this document is schema-valid (schema valid).

    • What is HTML?
The full spelling of the HTML is hypertext Markup Language, Chinese is the Hypertext Link Markup Language.

HTML (hypertextmark-uplanguage), or Hypertext Markup Language, is the descriptive narrative language of www. The purpose of the HTML language is to make it easy to connect text or graphics stored on a computer with text or graphics on a computer, to form an organic total, without considering whether the details are on the current computer or on other computers in the network. We just need to use the mouse to pick an icon in a document. The internet will immediately go to the content associated with this icon. This information may be stored on the network and on a computer.

HTML text is a descriptive text composed of HTML commands that can describe text, graphics, animations, sounds, tables, links, and so on. The structure of the HTML includes the head (head), the body (body) two parts, in which the head describes the information required by the browser. The main body includes the detailed content to be explained. In addition, HTML is the universal language of the network, a simple, universal, all-in-one markup language. It agreed that web-makers create complex pages that combine text with images that can be browsed by anyone on the web, regardless of the type of computer or browser they use.

    • What is XHTML?
XHTML refers to the extended Hypertext label Language (extensible Hypertext Markup Language).

As the next generation of HTML. We can understand that XHTML is an upgraded version of HTML. XHTML is a transitional language for HTML like XML. It is higher than HTML rigor. Then the base language is still the label of the HTML that follows. Just to abolish some of the performance layer of the label, colleagues in the standard requirements for a high point of reference tag strict nesting, label end and so on. There are different browser technologies in today's market. Some browsers execute on the computer, and some browsers perform on mobile phones and handheld devices. The latter has no ability or means to explain bad markup language.

So by combining the benefits of HTML and XML, we've got the markup language-XHTML that can come in handy today and in the future. XHTML can be read by all XML-enabled devices. At the same time, before the rest of the browsers are upgraded to XML support, XHTML gives us the ability to write documents with good structure. These documents work well with all browsers and are backwards compatible.


    • XML and HTML comparison:
Two words: 1,xml is designed to describe the narrative data, the focus is: what is the data, how to store data.

2,html is designed to display data, with the emphasis on displaying data and how to display it better.


    • The relationship between HTML and XML:
1, in fact, there is no very strong relationship between HTML and XML, XML is not to replace HTML, in fact, XML can be seen as a complement to HTML.
2. The goal of XML and HTML is different: HTML is designed to display data and focus on the appearance of the data. The object of XML design is to describe the data and focus on the content of the data.
3, similar to HTML, XML does not do whatever operation. Although an XML tag can be used to describe the structure of an item such as a narrative order, it does not include any code that can be used to send or process the order and ensure delivery by that order, and others must write code to actually run these operations on the data in XML format.

Unlike HTML, XML tags are defined by the author of the schema or document and are unrestricted.

The HTML tag is defined in advance; HTML authors can only use tags that are supported by the current HTML standard.

4, different from HTML. XML tags are defined by the author of the schema or document and are unrestricted. The HTML tag is defined in advance; HTML authors can only use tags that are supported by the current HTML standard.

    • HTML vs. XHTML comparison:
XHTML as an upgraded version of HTML. There are, of course, many other specifications. Details such as the following:
1. All tokens must have a corresponding closing tag.

Used to be in HTML. You can open many tags, such as <li> without necessarily writing the corresponding </li> to close them. But it's not legal in XHTML.

XHTML requires a rigorous structure, and all tags must be closed.

Assume that there is a single, unpaired label. At the end of the label, add a "/" to close it. For example: 2, the names of the elements and attributes of all tags must be lowercase. Unlike HTML, XHTML is sensitive to uppercase and lowercase. <title> and <TITLE> are different labels. XHTML requires that all labels and property names must be lowercase. For example,:<body> must be written in <body>. Uppercase and lowercase inclusions are also not recognized, and often Dreamweaver's own self-generated property name "OnMouseOver" must also be changed to "OnMouseOver".
3, all XML tags must be nested appropriately. The same is because XHTML requires a rigorous structure. Therefore all nesting must be in order. Once we wrote this code:<p><b></p></b> must be changed to:<p><b></b></p>.

So. A layer of nesting must be strictly symmetrical.
4. All attributes must be enclosed in an "" argument. In HTML. You do not need to add an argument to the attribute value, but in XHTML they must be added to the argument. For example,:5, the full < and & special symbols are encoded.

No matter what the less than sign (<). is not part of the label, it must be encoded as & L T; whatever is greater than (>), not part of the label, must be encoded as & G T. No matter what the number (&), not part of the entity, must be encoded as & a M P; Note: There are no spaces between the above characters.
6, assign a value to all attributes. XHTML specifies that all properties must have a value, repeating itself without a value. For example: <input type= "checkbox" name= "Shirt" value= "medium" checked> must be changed to: <input type= "checkbox" Name= "Shirt" Value= "Medium" checked= "checked"/>
7, do not make "--" in the gaze content. "--" can only occur at the beginning and end of the XHTML gaze, that is, they are no longer valid in the content.

For example the following code is invalid:<!--here is gaze-----------here is gaze-->: Replace the inner dashed line with an equal sign or a space.
<!--here is the gaze of ============ here is the gaze of-->: Some of these specifications look strange, but all of this is to make our code a uniform, unique standard for future data reuse.
8. The picture must have a descriptive text. Each picture label must have alt explanatory text. //In order to be compatible with Firefox and IE browser, for the picture label, as far as possible with the ALT and title double tag, The simple alt tag does not have a picture description under Firefox.

    • How to convert HTML to XHTML
  1. Add an XHTML <! doctype> to the Web page.
  2. Add the xmlns attribute to each page's HTML element.

  3. Change all the elements to lowercase.

  4. Closes all empty elements.
  5. Change all of the property names to lowercase.
  6. All attribute values are added to the argument.




Xml,html,xhtml

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.