Format Code Now
/

MXML Viewer

FV-60

Paste a Flex MXML file to read it as a highlighted element tree you can fold open and shut, or switch to indented source. Click an element to get its XPath-style path.

Runs in your browser. Nothing is uploaded.

MXML

Element tree

Path Click a key to see its path

How to use it

  1. Paste your MXML, or open an .mxml file.
  2. Choose Element tree or Indented source under Show.
  3. Pick how many levels start open in the tree.
  4. Click an element to see its path, then press Copy path.

What the tree shows

Each element appears with its attributes, and parents fold open and shut. Script blocks and other text, such as the ActionScript inside fx:Script, are shown in their own box with the shared indentation removed. Clicking an element gives a path such as /s:Application/s:Label[2], where the number counts elements with the same name under one parent. The status line counts the elements and lists the namespace prefixes on the root.

Checks and limits

The viewer checks that the file is well-formed XML and reports the first problem with its line. It recognizes the Flex 4 (2009) and Flex 3 (2006) MXML language namespaces and says which one the root uses. It does not compile the MXML, check component or property names, or run any ActionScript. Comments are left out of the tree but kept in Indented source.

Error messages and what to do

MessageWhat it meansFix
No root element found. XML needs one element such as <root>...</root>The input has no element at all, only text, comments or a declaration.Paste the whole MXML file, starting from its root element.

Questions people ask

What is MXML?

MXML is the XML-based markup language of Adobe Flex, now Apache Flex, used to lay out user interfaces for Flash and AIR applications. Elements such as s:Button and s:Label describe components, and ActionScript code sits inside fx:Script blocks.

Can I open an MXML file without Flash Builder?

Yes, to read it. Paste or open the file here to see its structure and source. This viewer does not compile or run the application; for that you still need the Flex SDK.

What does Indented source do?

It re-indents the MXML with two spaces per level and colors tags, attributes and values. Runs of spaces inside text are collapsed, while CDATA blocks, such as script code, are kept as written.

Why does it say there is no MXML language namespace?

The root element has no xmlns attribute for http://ns.adobe.com/mxml/2009 or http://www.adobe.com/2006/mxml. The file may be a fragment, plain XML or use a namespace this viewer does not know. The tree still shows it.

Is my MXML file uploaded?

No. The file is parsed and drawn in your browser tab. Nothing is sent to a server, and no ActionScript or other script inside the file is run.

About this tool

MXML is the XML language of Adobe and Apache Flex. The tree shows each element with its attributes, folds parents open and shut, and shows script and other text blocks with their shared indentation removed. Click an element to see an XPath-style path such as /s:Application/s:Label[2]. The status line lists the namespace prefixes on the root and whether it uses the Flex 3 or Flex 4 MXML namespace. It checks that the XML is well-formed; it does not compile the MXML or check component names. Comments are left out of the tree but kept in Indented source, which collapses runs of spaces inside text. A DOCTYPE is skipped, never loaded.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.