The Source editor supports the following features:
Syntax highlighting.
Context-sensitive code-completion based on DTD and/or XML Schema.
The code completion is based on the existing content of the XML document if no DTD or XML schema is associated with the XML document. When code completion is activated and the XML document contains <root><a><b/></a><a></a></root> once you type the second <a>, the editor suggests that you add b as a child of the a element.
As-you-type validation. If the XML is invalid (for example, the > is removed from a tag), the editor indicates the error.
General text editing operations such as undo, redo, cut, copy, paste, select all.
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.
|
![]() |
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 Section 21.5, Setting XML Editor Preferences. option. For more information, see |