Edit XML files

Extensible Markup Language (XML) is the universal format for data on the World Wide Web. XML allows web developers to easily describe and deliver rich, structured data in a standard, consistent way. XML does not replace HTML; rather, it is a complementary format.

When you work with XML files directly, it's important that the files contain well-formed XML. Since the rules governing the syntax of XML tags are stricter than those for HTML, if an XML file is missing a tag or an attribute, the file will not render correctly.

Microsoft Expression Web can also indent and format your XML for easier editing.

To check for well-formed XML

  • Right-click an open XML page in the editor and click Verify well-formed XML. If there is an error in your XML file, Expression Web opens the XML Validation dialog box with a description of the error, the line number of the error, and a button to take you to the error in the editor.

To format XML for easier editing

  • Right-click an open XML page in the Code view and then click Apply XML Formatting Rules.

To apply XML formatting rules

  • Right-click an open XML page in the Code view and then click Reformat XML.


    XML formatting rules will apply ending tags or empty-element tag formatting to all elements, even in document types that don't support XML formatting for all elements, such as HTML 4. This may cause code or compatibility errors in the file.

To change the XML encoding

  1. Right-click an open XML page in the editor, and then click Encoding on the shortcut menu.


    You can also edit the text encoding for the XML page directly in the <?xml?> tag.

  2. Do one of the following:

    • To reload the file, in the Reload the current file as box, click a different encoding, and then click Reload.

    • To save the file, in the Save current file as list, click the encoding you want, and then click Save As.

See also


Using code views
Using XML data

Send feedback about this topic to Microsoft. © 2011 Microsoft Corporation. All rights reserved.