When editing an XML document based on a schema (DTD or XML Schema), Grid View provides intelligent editing features based on information gathered from the schema. These features are listed below.
Inserting or appending element or attribute names
To insert or append an element or attribute relative to a selected item, you can use either commands in the XML menu or icons in the Attributes and Elements Toolbar . If this toolbar is not visible, select the menu option Tools | Customize, and, in the Toolbars tab, check the Attr & Elem entry. For a detailed explanation of how to use the toolbar icon commands and XML menu commands, see the XML menu section.
To insert or append an element or attribute:
|1.||Select the item relative to which the element or attribute is to be inserted or appended.|
|2.||Click on the appropriate icon in the Attributes and Elements toolbar, or select the appropriate command from the XML menu (Insert, Append, or Add Child). This creates a new entry in the grid and opens a popup with available element or attribute options.|
|3||Select the desired element or attribute from the popup, and either click or press Enter. Alternatively, you can type in the name of the desired element or attribute.|
You will notice that the various Entry Helpers are constantly updated depending on the current selection in the Grid View. The Info Window constantly shows important information regarding the selected element or attribute.
New lines and tabs in Grid View
To enter a new line in a Grid View cell, press Ctrl+Enter. To enter a tab, press Ctrl+Tab.
Editing an element or attribute name
When you edit the name of an element or attribute, a popup menu containing the available options opens. These options depend on the position of the element and the content model defined by the schema. A similar popup is displayed if the contents of an element or attribute are restricted by an enumeration or choice of some sort.
To edit an element or attribute name:
|1.||Double-click the element or attribute name. A popup with the available options appears.|
|2.||Select the required element or attribute from the popup menu.|
|3.||Accept the selection by hitting Return or clicking the name. (Esc causes the change to be abandoned.)|
Adding namespace prefixes
The XML | Namespace Prefix command enables a namespace prefix to be added to the selected node in Grid View and all its descendant element or attribute elements. The namespace will have to be declared separately.
Grid View context menu
In addition to the commands available through the various menus and toolbars, Grid View also provides a context menu that contains the most frequently used commands collected from several menus in one convenient place. To open the context menu, right-click the item for which you wish to perform an action.
In Grid View, documents can be spellchecked with any of the built-in language dictionaries. A user dictionary can also be created and edited to allow words not contained in the language dictionary. For details, see the descriptions of the Spelling and Spelling Options commands.
User input in Grid View can be partially validated. Enumeration and pattern errors in attribute values, for example, will be picked up. But adding a child element to an element that can take only text will not be flagged as an error. To ensure that an XML document is valid, switch to Text View and validate.
© 2019 Altova GmbH