Please enable JavaScript to view this site.

Altova XMLSpy 2022 Professional Edition

» No topics above this level «

Editing Document Content

Scroll Home Prev Top Next More

Editing XML content in Grid View is straightforward: Double-click inside the content field and and edit the content as required. Entities can be inserted via the Entities entry helper.

 

Additionally, Grid View offers the following editing features:

 

Type selection functionality, as well as automatic type detection and conversion of values

Auto-completion in JSON documents that are based on a JSON schema

Validation

Find and Replace

 

Type selection and conversion

XML Grid View distinguishes between the following type categories:

 

Simple types: Attribute, Text, CDATA, Comment, Processing Instruction (PI), Entity Reference

Container types: Element, XML Declaration, DOCTYPE (internal or external DTD)

Special container types: Formula

 

The type of a value is indicated by a symbol in front of the value (see screenshot below). To change a type, click its symbol and select the type you want from the menu that appears. The symbols and shortcuts of types are shown in the screenshot below:

XSXMLGridViewTypeSelection

Note the following points:

 

Nodes of type Element, Attribute, and PI have a key and a value, whereas nodes of type Text, CDATA, and Comment have only a value. For example, an element node will have a name (its key) and content (its value), whereas a text node will have only a value.

Type conversions try to preserve the original key and value. For example, if you convert an element to an attribute, the attribute will have (i) the same name as the element, and (ii) a value that is, as far as possible, the same as the content of the element.

In the sequence of child nodes of element, attributes are always listed first. As a result, type conversions could lead to a reordering of nodes.

In the case of mixed content (character data interspersed with element children), consecutive text nodes are not allowed and so might be automatically joined.

 

Auto-completion

Auto-completion is enabled when the XML document being edited is associated with a schema.

 

Auto-completion provides you with entry options at the cursor location. These options, which are based on the definitions in the schema, are provided (i) via pop-ups in the main window, and (ii) via the entry helpers (see screenshot below). The pop-ups and entry helpers each display a list of entries that are valid at that cursor location. To move through the entries in the pop-up list, use the arrow keys. Select an entry from the pop-up window or double-click an entry in the entry helper to insert it.

XSXMLGridViewAutoCompletion

 

In-cell command buttons

In XML Grid View, buttons in grid cells or in the Grid View toolbar provide functionality that is available in the context of the current selection (cell or column). Using these commands is a faster and easier way to carry out commonly used operations. The available commands are listed in the table below. Display-related commands are shown with a blue background. Commands for editing the document (structure and content) are shown with a beige background. For additional commands in a particular cell's context, use the cell's context menu. Note: The name of a command is displayed as a tool tip when you hover over the cell button or toolbar icon.

 

ic_opt_widths

Optimizes widths of grid columns according to cell content.

ic_jsongridmakelist / ic_jsongridmaketable

When colored, Table Display is on, otherwise off. Click to switch the display

ic_jsongridrowcols / ic_jsongridcolrows

A toggle command in top left cell of table. Switches rows to columns and vice versa

ic_jsongridfilteroff / ic_jsongridfilteron

When colored, a filter for the table, object, or array is active, otherwise the filter s deactivated. Click to deactivate/activate. To edit the expression, double-click it

ic_xmlgridviewwordwrap

Toggle command to word-wrap cells. When selected, word-wrap is on. By default. only the contents of items are wrapped. If you want to additionally wrap the names of items, choose this option from the icon's dropdown list.

ic_xmlgridviewmagnification

Zoom level of Grid View

ic_xmlgridviewsort

Enabled when a column header in Table View is selected. The buttons sort the rows of the table, respectively, in descending or ascending order of column content

 

Note:For a description of other toolbar commands, see the section Context Menu in Grid View.

 

 

Validate on modification

The Validate on Edit mode is toggled on by default. When toggled on, well-formed checks and validation checks are carried out as you modify a document in JSON Grid View. For validation of a JSON document to be carried out (additional to well-formed checks), a JSON Schema must be assigned to the JSON document. Errors are shown by displaying erroneous text in red and flagging the location with a red exclamation mark. See Validating JSON Documents for more information.

 

The Validate on Edit mode can be toggled on/off either (i) via the XML | Validate on Edit menu command, (ii) the Validate on Edit toolbar button, or (iii) via the On Edit option of the Validation settings of the Options dialog.

 

Find and Replace

You can use the Find (Ctrl+F) and Replace (Ctrl+H) commands of the Edit menu to find text in JSON Grid View and replace it. Results are highlighted in orange, with containing components also being highlighted in orange. In the case of cells containing long text strings, only the cell is highlighted.

 

© 2015-2021 Altova GmbH