(what) XML What is it?
XML refers to Extensible Markup Language (extensible Markup Language)
1, XML is a markup language, similar to HTML.
2. XML has a self-descriptive nature
3. XML is designed to transmit and data (design purpose/purpose)
The relationship and difference between XML and HTML
XML is a supplement to HTML, not a substitute.
Similarities: 1, both are markup languages. 2, are the recommended standard
Differences: 1, (the purpose of different) XML is designed to transmit and store data, focusing on the content of the data; HTML is designed to display data, focusing on the display of data. 2, (different tags) XML tags are not predefined, self-descriptive, need to define their own, HTML tags are predefined.
( why Why do you want to use XML ? --Application
• Separate the data from HTML, allowing the HTML to focus more on layout and display.
• Simplify data sharing and transfer data to and from incompatible systems.
( How ) How to use XML ? --Grammar rules
1. First define the declaration of the XML version
2. The document must have a root element
3. The element must have a close tag
4, the label is sensitive to the case
5. label must be nested correctly
6. Attribute values must be quoted
<?xml version= "1.0" encoding= "iso-8859-1"? ><note><to>george</to><from>john</ From>
The first line is the XML declaration. It defines the version of the XML (1.0) and the encoding used (iso-8859-1 = latin-1/Western European character set).
The root element of the document is <note>
There are 4 sub-elements, namely <to> <from>
Elements (regardless of the root element or child element) are closed and nested correctly.
Introduction to XML-extensible Markup Language (extensible Markup Language)