An XML editor that checks every change
This online XML editor is for quick edits when opening an IDE is overkill: changing a value in a config file, adding an element to a test fixture, or fixing a feed before re-uploading it. You type in a syntax-highlighted editor, and every change is parsed again, so a missing quote or an unclosed tag shows up in the status bar right away rather than when a deployment fails.
The editing loop
The page has two halves. On the left is the text you edit; on the right is the result of the selected action. With View Tree (the default) the right side shows a collapsible tree of your document and the status bar reads something like 7 elements, root <catalog>. Add a <book> and the count goes up; forget to close it and the status bar switches to an error with the line and column.
The other buttons change what the right side shows: Format for indented markup, Validate for a well-formedness report, and Minify for a single-line version with the bytes saved.
Example: adding a record
Load the Sample catalog (three books, status 19 elements, root <catalog>) and add a fourth book just before </catalog>, but type the closing tag wrong:
<book id="bk104" lang="en">
<title>Oberon Legacy</title>
<price>5.95</price>
</Book>
The status bar immediately reports Expected closing tag 'book' (opened in line 24, col 3) instead of closing tag 'Book', followed by the position of the bad tag, line 27. XML names are case-sensitive, so </Book> does not close <book>. Change it to lowercase and the message becomes 22 elements, root <catalog>, with book now listed as 4 items in the tree.
Hand-editing XML without breaking it
- Escape special characters in text. Write
&for & and<for <. For a block of code or HTML, use<![CDATA[ ... ]]>instead of escaping every character. - Quote every attribute value, with either single or double quotes, and never repeat an attribute on the same element.
- Keep one root element. New records go inside the root, not after it.
- Comment out with care.
<!-- ... -->cannot be nested, so commenting out a region that already contains a comment ends the outer one early.
The XML escape tool converts a snippet of text into safely escaped XML if you are pasting in content from elsewhere.
Saving and sharing
Download saves the output rather than the editor text: indented XML after View Tree, Validate or Format, and a single line after Minify. Save & Share stores your input and options and gives you a link, which is handy for showing a colleague a broken payload. Anyone with the link can open it, so do not share documents that contain credentials or personal data.
Limits of a browser editor
This editor checks syntax, not meaning. It does not load an XSD, so it cannot tell you that <price> must be a decimal or that <title> is required. Namespace prefixes are not checked against their declarations either. For schema-driven editing with autocompletion, a desktop IDE is the better tool; for fast fixes and a second pair of eyes, this page is quicker.
To see what changed between your edited version and the original, paste both into XML diff. If you only need to read a file, the XML viewer keeps the focus on the tree.
Privacy
Editing, validation and the tree preview all run in your browser. Your document is only sent to our server when you use Load URL or Save & Share.