Làm đẹp XML với thụt lề đúng, hoặc thu gọn về một dòng. Chú thích, CDATA và chỉ thị xử lý được giữ nguyên.
Cách dùng Định dạng XML
Dán XML của bạn vào ô đầu vào.
Chọn Làm đẹp để thụt lề hoặc Thu gọn để nén.
Chọn kích thước thụt lề, rồi sao chép kết quả.
This is an XML formatter that beautifies a document with proper, depth-based indentation, or minifies it to a single line. It preserves comments, CDATA sections, processing instructions and the XML declaration.
Formatting runs entirely in your browser, so your data never leaves your device, which makes it safe even for XML that contains sensitive values.
XML is verbose and deeply nested. Indenting each element by its depth and putting tags on their own lines turns a wall of angle brackets into a structure you can actually follow.
It is useful across the many places XML still lives: SOAP responses, RSS feeds, build and config files, and document formats, where a quick reformat makes debugging far easier.
Beautifying keeps a single text child inline with its tags, so simple values stay compact, while the declaration, comments and CDATA are kept exactly as they were rather than being reflowed or dropped.
Minifying removes comments and the whitespace used only for indentation between tags. Text content and CDATA are kept exactly, so it is safe unless your document relies on significant whitespace in mixed content.
The tool reformats for readability and does not validate against a schema. Clean layout does not mean the document matches any DTD or XSD you expect.
Câu hỏi thường gặp
Nó thụt lề mỗi phần tử theo độ sâu lồng nhau và đặt các thẻ trên dòng riêng, đồng thời giữ một con văn bản đơn nội tuyến. Chú thích, CDATA và khai báo XML được giữ nguyên.
Nó loại bỏ chú thích và khoảng trắng chỉ dùng để thụt lề giữa các thẻ. Nội dung văn bản và các phần CDATA được giữ chính xác, nên an toàn trừ khi tài liệu của bạn dựa vào khoảng trắng có ý nghĩa trong nội dung hỗn hợp.
Không. Việc định dạng chạy hoàn toàn trong trình duyệt của bạn, nên dữ liệu của bạn không bao giờ rời khỏi thiết bị. Điều đó làm cho nó an toàn ngay cả với XML chứa giá trị nhạy cảm.
Nhúng công cụ này
Thêm công cụ này vào trang web của riêng bạn. Sao chép đoạn mã bên dưới; nó tự động cập nhật.
<iframe src="https://monu.tools/embed/vi/xml-formatter" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>Công cụ liên quan
Làm đẹp CSS với thụt lề gọn gàng, hoặc thu gọn để giảm kích thước tệp. Xử lý media query, calc() và chú thích giấy phép.
Làm đẹp HTML với thụt lề nhận biết khối, hoặc thu gọn nó. Nội dung của pre, textarea, script và style được giữ nguyên.
Làm đẹp và làm gọn JavaScript với thụt lề và khoảng cách nhất quán. Chạy hoàn toàn trong trình duyệt của bạn.
Chuyển CSV sang tệp Excel .xlsx và Excel trở lại CSV, hoàn toàn trong trình duyệt của bạn. Hoạt động theo cả hai chiều.