XML is an important new type defined in e4x, focusing on how to structure descriptive information, using it to represent any independent part of the XML structure, which is a markup language used to tag electronic files to make them structural.
The XML language is designed to describe the data, focusing on the content of the data, designed to describe the information, which does not make any information, it is designed to structure, store, and transmit information.
The XML tag is not predefined, and when it is used, it needs to define its own label, which allows it to define its own label and its own document structure.
XML can support dynamic update, for the newer volume of the site, XML is more advantageous than HTML;
The purpose of XML: As a language for data exchange on the network, the language has the advantages of "data validation with Web browser" and "easy to generate data", so it is mainly used to exchange and utilize data between enterprises, or more conveniently within the enterprise. Using XML, it is also possible to convert data that is difficult to process in a previous database into a database.
XML is free and extensible.
XML will be the most common tool for all data processing and data transfer.
HTML is just a hypertext protocol.
The HTML language is designed to display data, which focuses on the appearance of the data and is designed to display information;
HTML has a lot of predefined tags;
For small sites, HTML writing is recommended in order to improve the responsiveness of the page.
in fact, XML and HTML are not comparable, their functions and objectives are not the same, the application of the same situation. It is important to note that XML is more standard than HTML.
They can be converted to each other on the server side: xml-〉html.
The main difference between XML and HTML:XML is designed to carry data, store data, transmit information, and HTML is designed to display that data.
XML is not intended to replace HTML.
Read JavaScript Advanced Programmer's design, 19th Chapter E4X notes
There are many ways to create XML, the first of which is to call its constructor:
var x new XML (); It contains only one document structure
var x = new XML ("<div></div>")
XML ();
Run it, get an empty XML object, we can add data like it.
Create XMLList:
var New XMLList (); It can contain more than one document structure
var list = new XMLList ("string structure");
var list = new XMLList ("<item></item>")
XML and HTML