Developer Tools

XML Viewer

Live

Display XML as an indented element tree.

About XML Viewer

Display XML as an indented element tree. Enter xml in a purpose-built xml viewer interface designed for this subject. Well-formed XML is traversed into a safe text tree and pretty-printed without rendering active content. The result includes formatted xml, element tree, elements, supporting detail, and clear units or diagnostics. Results depend on the entered assumptions, units, and rounding. Review important decisions against authoritative requirements. Processing stays in your browser, and UtilityPages does not store the values you enter.

Set up XML Viewer

Workspace

Source workbench

Edit the source fields below and inspect the rendered output alongside your work.

This workspace updates as you edit.

Enter xml.

XML Viewer result

Enter the values above, then process to see a detailed result.

How XML Viewer works

Well-formed XML is traversed into a safe text tree and pretty-printed without rendering active content.

How it works

Well-formed XML is traversed into a safe text tree and pretty-printed without rendering active content. Results depend on the entered assumptions, units, and rounding. Review important decisions against authoritative requirements.

Examples

XML Viewer worked example

Example input
{
    "source": "<catalog><tool id=\"1\"><name>Calculator</name></tool></catalog>"
}
Expected result
{
    "formatted": "<catalog>\n  <tool id=\"1\">\n    <name>Calculator\n    </name>\n  </tool>\n</catalog>",
    "tree": [
        {
            "depth": 0,
            "element": "catalog"
        },
        {
            "depth": 1,
            "element": "tool"
        },
        {
            "depth": 2,
            "element": "name"
        }
    ],
    "element_count": 3
}

Privacy

This tool does not store your inputs or results on UtilityPages.org.

Citations & sources

  1. Extensible Markup Language 1.0

Frequently asked questions

How does the XML Viewer work?

Well-formed XML is traversed into a safe text tree and pretty-printed without rendering active content.

What information should I enter?

Enter xml. Use values and units from the same scenario so the result is internally consistent.

What results does this tool provide?

It reports formatted xml, element tree, elements, including intermediate context where it helps you review the answer.

What limitations should I know about?

Results depend on the entered assumptions, units, and rounding. Review important decisions against authoritative requirements.