21.2 Using the Source Editor

The Source editor supports the following features:

Figure 21-1 XML Source Editor

The XML Editor toolbar contains the following:

Table 21-1 XML Editor Toolbar

Button

Description

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 21.4, Attaching Schema or DTD

Shows help

The Source editor right-mouse menu contains these options:

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

Menu choice

Description

Revert File

 

Cut, Copy, Paste, Undo, Save

Performs the common editor function.

Format

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.

Validate

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

Preferences

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