XML basics
XML (Extensible Markup Language), Extensible Markup Language, It is a subset of SGML (Standard General Markup Language). The main function of the xml file is to be used as a program configuration file. Others include data transfer between different languages and the ability to exist as a small database. XML files serve as a markup language. Like HTML (Hyper Text Markup Language), they are both based on element tags. The tree structure language has the characteristics of clear data hierarchy and universal data recognition. However, there are still differences between XML and HTML languages: 1. As an extensible language, XML language can name its tags by itself, and Tag names with Chinese names are also allowed (although garbled characters may occur during parsing); 2. XML language parsing is very complex, including different parsing methods and parsers, while HTML language parsing comes from browsing It is a static language with unified specifications and does not require us to write code for parsing.
XML language specification:
1. The XML file must have an xml document declaration:
<span style="color: #0000ff"><?</span><span style="color: #ff00ff">xml version="1.0" encoding="UTF-8" standalone="yes?></span>
The version attribute represents the current XML version, the encoding attribute represents the encoding method of the XML file, and the standalone attribute represents whether the XML file is independent (whether it depends on external files, the default is yes)
The document declaration must start in the first line and column of the xml file, otherwise it will be invalid
2. Element format of XML file:
The element format of xml is basically the same as that of html,
3. XML element naming convention:
The naming convention of elements in xml: it can contain numbers, letters and some common symbols, but it must follow several principles: it cannot start with a number or an underscore; it cannot be named with keywords such as xml; it cannot contain spaces; it cannot be in the middle of the name Include":".
4. XML element attribute declaration:
Element attributes in XML can be defined by yourself. The specification of attribute name declaration is the same as that of element name. The declaration format of element attributes is the same as in HTML, which is xx attribute="xx value". An element can have multiple attributes, but The same attribute cannot have multiple values.
5. Comments in XML
Same as in html, it is , comments cannot be nested in comments
4.XML language escape characters and CDATA area:
The escape characters of xml are the same as those of html language. The CDATA area is used when the expression contains many escape characters. It is too troublesome to escape them one by one. Therefore, there is a special area to store such expressions instead of The area that can be parsed successfully even if you manually escape it is the CDATA area with the following format:
<span style="color: #0000ff"><!</span><span style="color: #ff00ff">[CDATA[表达式]]</span><span style="color: #0000ff">></span>
5.PI instruction (processing instruction)
The so-called PI instruction can be understood as informing the parser how to process xml content. The basic format is , such as parsing xml documents according to css style:
<span style="color: #0000ff"><?</span><span style="color: #ff00ff">xml-stylesheet type="text/css" href="a.css"</span><span style="color: #0000ff">?></span>

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

Hot Topics

The article discusses the HTML <datalist> element, which enhances forms by providing autocomplete suggestions, improving user experience and reducing errors.Character count: 159

The article discusses using HTML5 form validation attributes like required, pattern, min, max, and length limits to validate user input directly in the browser.

The article discusses the <iframe> tag's purpose in embedding external content into webpages, its common uses, security risks, and alternatives like object tags and APIs.

The article discusses the HTML <progress> element, its purpose, styling, and differences from the <meter> element. The main focus is on using <progress> for task completion and <meter> for stati

The article discusses the HTML <meter> element, used for displaying scalar or fractional values within a range, and its common applications in web development. It differentiates <meter> from <progress> and ex

Article discusses best practices for ensuring HTML5 cross-browser compatibility, focusing on feature detection, progressive enhancement, and testing methods.

The article discusses the viewport meta tag, essential for responsive web design on mobile devices. It explains how proper use ensures optimal content scaling and user interaction, while misuse can lead to design and accessibility issues.

This article explains the HTML5 <time> element for semantic date/time representation. It emphasizes the importance of the datetime attribute for machine readability (ISO 8601 format) alongside human-readable text, boosting accessibilit
