HTML, XML, and HTMLXML

Source: Internet
Author: User

HTML, XML, and HTMLXML

HyperText MarkupLanguage, it marks parts of the web page to be displayed by marking symbols. A webpage file is a text file. By adding a tag to a text file, you can tell the browser how to display the content (such as how the text is processed and how the screen is arranged, ).

XML (Extensible MarkupLanguage): An Extensible markup language, a subset of Standard Generic Markup languages. It is a structured markup language used to mark electronic files.

URL (Uniform ResourceLocator): a Uniform resource locator is a concise representation of the location and access method of resources that can be obtained from the Internet. It is the address of standard resources on the Internet. Each file on the Internet has a unique URL. It contains information that specifies the location of the file and how the browser should handle it. An anchor tag (<a>) is a feature used in HTML to define the source and target of a hyperlink. We often use the <a> label and Its href attribute to define a source hyperlink. The value of this href attribute is the target URL.


Comparison between HTML and XML


1. In fact, there is no inevitable link between HTML and XML. XML is not to replace HTML. In fact, XML can be regarded as a supplement to HTML.

2. Different goals for XML and HTML: HTML is designed to display data and concentrate on the Data appearance. XML is designed to describe data and concentrate on data content.

3. Similar to HTML, XML does not perform any operations. Although the XML tag can be used to describe the structure of an item such as an order, it does not contain any code that can be used to send or process the order and ensure delivery by the order, others must write code to actually perform these operations on data in XML format.

4. Unlike HTML, XML markup is defined by the author of the architecture or document and is unrestricted. HTML tags are predefined. HTML authors can only use tags supported by the current HTML standard.

5. HTML and XML have many common character entities, as shown in:

 


Good habits

Well-formatted xml files must meet the following requirements:

1. Document starts with xml Declaration

<? Xml version = "1.0"?>

This statement cannot contain spaces or other characters, that is, <? Xml version = "1.0"?> It must be in the first row and column of the xml file, and in the <? And xml cannot contain spaces. Otherwise, they are all incorrect.

2. Xml can only contain unique root elements

The correct example is as follows:

<?xml version="1.0"?><man>

The error example contains two root elements:

<?xml version="1.0"?>

3. Mark must be closed

4. Null tag conventions

Representation: <empty tag/>

Empty tag can have attributes

5. Layer-by-layer Nesting is required

Child elements must be nested in the parent element and cannot be staggered.

Elements of the same layer must be tied together and cannot be nested.

6. Case Sensitive

The start and end tags of the element must be consistent.

7. Attribute settings

Attribute settings must use quotation marks.

8. Special Character Representation

Reference using predefined object reference:

Incorrect syntax:

<span style="font-size:24px;"><compare>3<6</compare></span>

Correct syntax:

<span style="font-size:24px;"><compare>3 &lt; 6</compare></span>


Related Article

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.