GUIDE深度 · Deep dive

XML Basics

XML uses paired tags to describe hierarchical data: <book id="1"><title>...</title></book>. It is more verbose than JSON but still common in configs, SOAP, RSS and document standards.

更新 2026-11-01 · 公式可核验

Pieces

Declaration: <?xml version="1.0" encoding="UTF-8"?>.

Elements: paired tags; attributes: name="value".

Text must escape & < >.

Namespaces

xmlns defines prefixes to avoid collisions between standards.

The prefix is an alias; the URI is the identity.

FAQ

Is XML the same as HTML?

Syntax is similar, but XML must be strictly closed and is case-sensitive.

Is the declaration required?

Not required, but declaring encoding is recommended.

Sources

Related calculators

XML FormatterFormat, minify and validate XML with a readable error message.

More guides

Common XML ErrorsRead guide
KEEP READING

继续读

按顺序读,或跳到同主题的其他指南。

全部指南 →