跳到主要内容
Z

What is XML?

XML (eXtensible Markup Language) is a markup language for encoding structured data in a text format using nested, custom tags. It supports attributes, namespaces and schema validation (XSD/DTD), and is used for documents, configuration, web feeds (RSS) and enterprise data exchange.

XML wraps data in nested, self-describing tags you define yourself, with optional attributes on elements and namespaces to avoid name clashes. A schema (XSD or DTD) can enforce structure and types.

Once dominant for web services (SOAP) and data interchange, XML is now common for documents (DOCX, SVG), feeds (RSS/Atom) and configuration. JSON has largely replaced it for web APIs.

XML tools

常见问题

如果标题中包含空格或特殊字符怎么办?

这些字符会被替换为下划线,因为 XML 元素名不能包含它们。以数字开头的标题会自动添加前缀 `_`。

需要不同的 XML 结构(用属性而非子元素表示)怎么办?

可以先用 <a class="text-brand-600 hover:underline" href="/csv-to-json">CSV to JSON</a> 将 CSV 转为 JSON,编辑该 JSON,然后使用 <a class="text-brand-600 hover:underline" href="/json-to-xml">JSON to XML</a> 并设置属性前缀(attribute prefix)。

可以让输出结果的格式更美观吗?

输出结果已经过缩进处理。如需不同的缩进方式或想要压缩(minify),可以使用 <a class="text-brand-600 hover:underline" href="/xml-formatter">XML Formatter</a>。