Development

XML Formatter

Format valid XML with indentation while preserving mixed text and xml:space; DTD declarations are rejected.

01Input and settings

The calculation runs in your browser. You can use the tool without installing software.

02Result

Waiting for input
Waiting for input

Enter your values or load the example to see the result here.

About this tool: XML Formatter

Format valid XML with indentation while preserving mixed text and xml:space; DTD declarations are rejected.

Load XML and choose two or four indentation spaces. Elements containing text mixed with child elements are kept intact, as are subtrees marked xml:space="preserve". Invalid XML, DTD and excessive nesting are rejected before a result is produced.

Worked example

Input
<catalog><book id="1"><title>Asted</title><price>25</price></book></catalog>
Indentation
2
<catalog>
  <book id="1">
    <title>Asted</title>
    <price>25</price>
  </book>
</catalog>

Questions and answers

What does this tool do?

Format valid XML with indentation while preserving mixed text and xml:space; DTD declarations are rejected. Load XML and choose two or four indentation spaces. Elements containing text mixed with child elements are kept intact, as are subtrees marked xml:space="preserve". Invalid XML, DTD and excessive nesting are rejected before a result is produced.

What affects precision and input format?

Load XML and choose two or four indentation spaces.

Where are the calculations performed?

The calculation runs in your browser. You can use the tool without installing software.

Comments (0)

Share your thoughts — please be polite and stay on topic.

No comments yet. Leave a comment — share your opinion!

To leave a comment, please log in.

Log in to comment