20.2 Using the Source Editor

The Source editor supports the following features:

Figure 20-1 XML Source Editor

The XML Editor toolbar contains the following:

Table 20-1 XML Editor Toolbar



Expands all foldings (if code folding is enabled). You can enable/disable code folding in two ways.

  • Selecting Windows > Preferences > General > Editors. Select Structured Editors. Select Enable Code Folding.

  • In the Source editor, right-mouse in the left ruler. Access the Folding submenu.

Collapses all folding (if code folding is enabled)

Attaches a schema. For more information on using this feature, see Section 20.4, Attaching Schema or DTD

Shows help

The Source editor right-mouse menu contains these options:

Table 20-2 XML Editor Source Editor Right-mouse Menu Options

Menu choice


Revert File


Cut, Copy, Paste, Undo, Save

Performs the common editor function.


Document: Formats the entire document as specified in the preferences.

Active elements: Formats only selected elements.

Clear Validation Errors

Clears reported validation errors from the Problems view.


Validates the XML document and shows errors in the Problems view.


This is the same as setting preferences using the Windows > Preferences option. For more information, see Section 20.5, Setting XML Editor Preferences.