Altova XMLSpy 2024 Enterprise Edition

Context Menu in Grid View

Home Prev Top Next

When you right-click a cell in Grid View, a context menu (screenshot below) appears that provides commands for editing content related to the cell and for modifying the display. The context menu can also be accessed by pressing the keyboard's Menu key. The commands of the context menu are described below.

XSXMLGridViewContextMenu

Type

Hovering over the Type command causes a sub-menu to be displayed in which you can select the type of the component. You can also directly access the Type sub-menu via the keyboard shortcut Ctrl+Menu.

 

Insert After/Before, Append, Add Child

The Insert and Append commands add an item (by default an element) at the same level. The new item is added in the case of Insert After and Insert Before, respectively, after and before the selected item, and in the case of Append as the last sibling of the selected item. The Add Child command appends a new item (by default an element) as a child. Change the name of the newly added element by double-clicking in its name cell and editing. Change the node type by clicking the element's icon (to the left of its name) and selecting the node type you want.

 

Wrap in Element

The selected item is given a parent element with a default element, which you can rename (by double-clicking the name and editing it).

 

Edit as Raw Text

Enables you to edit text content of the selected item as raw text. This is useful, for instance, if you are editing complex content such as HTML code. For example, the screenshot below, shows the Address element in Grid View.

XSXMLGridViewRawTextOff

If you switch the display of the Address element to raw text (screenshot below), the grid structure is converted to a single item containing raw text, all of which can be edited as in Text View.

XSXMLGridViewRawTextOn

 

Element Whitespace

Available on element nodes, it adds the xml:space attribute to the element's markup and gives this attribute the value you select from the command's submenu.

 

However, if you select the Omit value, then the xml:space attribute is not added, which has the effect of normalizing whitespace.

The Preserve value preserves all whitespace as is and turns off pretty printing for that element. Preserved whitespace is indicated in Grid View by an ellipsis icon.

The Default value takes the value specified for that element in the schema, which can be useful for overriding an xml:space value that has been inherited from an ancestor element in the XML document.

 

Move Up/Down/Left/Right

If it is possible to move a component up, down, left or right from its current location in the grid, then the corresponding command/s are enabled. Select the respective command to carry out the move.

 

Copy

These commands can be used to copy the current selection. Only those options are enabled that are allowed on that component.

 

Command

Description

Copy as XML Text

Current selection is serialized as XML markup

Copy as Tab-separated Text

Current table selection is serialized as TSV (Tab-Separated Values)

Copy as Image

Current image cell is copied as image

 

Note the following points:

 

Copy as Image copies the Base64-encoded string of the selected image. If the string is pasted to a document where the Base64-encoded string can be rendered as an image (for example to another table cell in Table Display), then it will be rendered. Otherwise, it will be pasted as a string.

To insert text in a cell, copy the text and paste it in the cell.

To import from file, for example an image, use the command Edit | Insert | Encoded External File. This inserts an image as Base64-encoded string, and displays this string as an image in JSON Grid View. Image file formats that are supported for import are: PNG, JPEG, BMP, GIF, TIFF.

 

Copy XPath

This command copies to the clipboard an XPath 3.1 locator expression, starting at the document root, that locates the selected node.

 

Copy XPointer

This command copies to the clipboard an XPointer expression that locates the selected node. See Copy XPointer/JSON-Pointer for details.

 

Filter, Filter to Focus

The Filter command is a toggle command. It adds a filter to the selected element or deactivates a filter. Note that, after you add a filter via this command, you must enter a filter expression; otherwise the filter will automatically be removed. After a filter has been added you can deactivate it by selecting the command again or clicking the filter. To remove the filter, click Remove all filters in the toolbar.

 

The Filter to Focus command (i) builds a filter on the root element which contains an XPath expression to locate the selected node, and (ii) filters the Grid View display to show the selected node (and its descendants) directly under the root element. This is useful if you want to focus the display on just the selected node. To remove the filter, click the Filter icon in the content cell of the root element.

 

Expand Fully

This command is enabled if the selected component or any of its descendants is collapsed. It expands the component and all descendant components.

 

Collapse Unselected

This command collapses all components except the selected component and its ancestor components.

 

Text Direction

This command is available for nodes containing text, and switches the reading order to start from either the left or the right of the cell. This is useful when using languages such as Arabic and Hebrew.

 

© 2017-2023 Altova GmbH