XML (Ngôn ngữ đánh dấu mở rộng)
XML là ngôn ngữ đánh dấu linh hoạt cho dữ liệu có cấu trúc, sử dụng thẻ tùy chỉnh do người dùng định nghĩa. Nó mang lại khả năng tự mô tả dữ liệu, xác thực lược đồ và các tính năng chuyển đổi mạnh mẽ.
Loại MIME
application/xml
Loại
Văn bản
Nén
Không mất dữ liệu
Ưu điểm
- + Self-describing with user-defined tags and schemas
- + Mature ecosystem: XPath, XSLT, XSD, SAX/DOM parsers
- + Standard for RSS/Atom feeds, SVG, XHTML, and SOAP
- + Supports namespaces for mixing vocabularies
Nhược điểm
- − Verbose syntax compared to JSON or YAML
- − Parsing is slower and more memory-intensive than JSON
- − Largely replaced by JSON for web APIs
Khi nào nên dùng .XML
Sử dụng XML cho đánh dấu tài liệu, tệp cấu hình cần lược đồ xác thực, dịch vụ web SOAP, nguồn cấp dữ liệu (RSS/Atom) và các định dạng công nghiệp.
Chi tiết kỹ thuật
Tài liệu XML có cấu trúc cây gồm các phần tử với thẻ mở và đóng, thuộc tính, không gian tên và nội dung văn bản. Lược đồ (XSD, DTD, RelaxNG) xác thực cấu trúc. XSLT chuyển đổi XML thành các định dạng khác.
Lịch sử
W3C công bố XML 1.0 vào năm 1998 như một tập con đơn giản hóa của SGML. Nó trở thành nền tảng cho XHTML, SVG, các dịch vụ web SOAP và nhiều định dạng dữ liệu trong những năm 2000.
Chuyển đổi từ .XML
Chuyển đổi sang .XML
Định dạng liên quan
Thuật ngữ liên quan
Learn More
File Format Conversion: A Complete Guide
Converting files between formats is a daily task for professionals across every industry. This comprehensive guide covers document, image, audio, …
JSON vs YAML vs TOML: Choosing a Configuration Format
Configuration files are the backbone of modern applications. JSON, YAML, and TOML each offer different trade-offs between readability, complexity, and …
Meta Tags for SEO: Title, Description, and Open Graph
Meta tags control how your pages appear in search results and social media shares. This guide covers the essential meta …
Text Encoding Explained: UTF-8, ASCII, and Beyond
Text encoding determines how characters are stored as bytes. Understanding UTF-8, ASCII, and other encodings prevents garbled text, mojibake, and …
CSV vs JSON vs XML: Data Exchange Formats Compared
Data exchange formats serve different needs. CSV excels at tabular data, JSON dominates web APIs, and XML powers enterprise integrations. …
How to Format and Validate JSON Data
Malformed JSON causes silent failures in APIs and configuration files. Learn how to format, validate, and debug JSON documents to …