RevealTheme logo

Trình định dạng XML

Định dạng và làm đẹp các tài liệu XML. Hữu ích cho SOAP, sitemap, feed RSS và tệp cấu hình.

Cách sử dụng công cụ này

  1. 1

    Paste your XML into the text box (one line or many — minified XML works too).

  2. 2

    Read the indented result that appears in the output panel below; it updates automatically as you type, with no button to press.

  3. 3

    Select the formatted text in the output panel and copy it manually into your editor or file.

Trình định dạng XML là gì?

XML ra đời trước JSON, nhưng vẫn được sử dụng rộng rãi trong các tích hợp doanh nghiệp, feed RSS/Atom, sitemap và tệp cấu hình. Trình định dạng này thêm thụt lề và ngắt dòng nhất quán để XML lồng sâu trở nên dễ đọc. Việc xác thực theo một XSD cụ thể đòi hỏi một trình xác thực XML chuyên dụng.

Các trường hợp sử dụng phổ biến

  • Make a one-line SOAP response from a web service readable so you can trace which element holds a fault or value.

  • Re-indent a minified sitemap.xml or RSS/Atom feed before scanning it for missing or duplicated entries.

  • Tidy a hand-edited Maven pom.xml, Android layout, or Spring config so the nesting is obvious at a glance.

  • Pretty-print an XML API payload pulled from logs or a network capture for a quick visual review.

  • Turn an exported config blob (build files, .csproj, web.xml) into an indented form before diffing it against another version.

  • Format a snippet for a bug report or documentation so reviewers can follow the element hierarchy.

Câu hỏi thường gặp

Tôi có thể xác thực theo một XSD không?
Không thể với công cụ này: hãy dùng xmllint hoặc một trình xác thực XSD trực tuyến.
Còn XML có không gian tên thì sao?
Việc định dạng hoạt động tốt; các không gian tên được giữ nguyên trạng.

Công cụ liên quan