xml spy
Previous  Top  Next
Enhanced Grid View

Click the Enhanced Grid View icon ic_enh_grid to open this view.

The Enhanced Grid View is the core presentation and editing view of XML Spy. It shows the hierarchical structure of any XML-compliant document through a set of nested containers, that can be easily expanded and collapsed to get a clear picture of the document's structure.

ref_p93a

All items contained in an XML document are displayed in a structured way that allows for easy manipulation of contents and structure at the same time.

An hierarchical item (such as the XML declaration, document type declaration, or any element that contains child elements) is represented with a gray side bar and a tiny arrow. Clicking the side bar expands or collapses the item.

Please note:
An element is denoted with the ic_elementicon, eg. ic_elementheader
An attribute is denoted with the ic_attribicon, eg. ic_attribstyle

Display & Navigating
The contents of an hierarchical item depend on its kind and - in the case of elements - mostly consists of attributes, character data, comments and child elements.

Element and Attribute order
To emphasize the strong coupling between attributes and the respective parent element, attributes are always listed first and cannot be preceded by comments, character data or child elements. The order of the individual attributes is, however, preserved from the input file and can be modified if necessary.

Following the attributes, the remaining items within an element appear exactly in the order found in the source file, and can be rearranged without restriction using drag & drop.

Elements and character data
If an element contains only character data, the data will be shown in the same line as the element and the element will not be considered hierarchical by nature. The character data for any other element will be shown indented with the attributes and potential child elements and will be labeled as "Text".

If an element is collapsed, its attributes can be shown in the same line in a different color. This attribute preview is especially helpful, when editing XML documents that contain a huge number of elements of the same kind that only differ by their contents and attributes (e.g. database-like applications).

Customizing the grid view
The grid view can easily be customized using the mouse to adjust column widths.

To resize a column to the width of its largest entry:
1.Double-click on the grid line to the right of that column.  

To adjust the column widths to display all content:

1. Select the menu item View | Optimal widths command, or click on the Optimal widths icon ic_opt_widths.  

The heights of the cells are generally determined by their contents and can only be adjusted by the user using the menu option Tools | Options| View tab | Enhanced Grid view, "Limit cell height to xx lines".

You can also use the keyboard to navigate an XML document in the Enhanced Grid View.
·The arrow keys move the selection bar in the tree and grid views  
·the + and - keys on the numeric keypad allow you to expand and collapse items.  

Please note:
You can activate the Text view icon at any time, to see marked data in the source file for example.

Embedded Database/Table view
XML Spy allows you to display recurring elements in a Database/Table view. This function is available wherever the Enhanced Grid view can be activated, and can be used when editing any type of XML file - XML, XSD, XSL etc.

Intelligent editing
When editing an XML document based on a DTD or Schema, the Enhanced Grid View provides many Intelligent Editing features based on the information gathered from the Schema or DTD.

Whenever editing the name of an element or attribute, a popup menu opens. The options available depend on the position of the element and the content model defined by the Schema or DTD. A similar popup is displayed, if the contents of an element or attribute are restricted by an enumeration or choice of some sort.

ref_p94a  

To edit an element or attribute name:

1.Double click on the element name.  
2.Edit the name (XML Spy chooses the best match from the menu).  
3.Accept the selection by hitting the Return key (Esc. abandons the change).  

To insert or append elements or attribute names:

1.Click on the respective icon in the Attr. & Element toolbar, or  
usr_attr_elem_toolb  
2.Double click on an element or attribute name in one of the Entry Helpers.  

You will notice that the various Entry Helpers are constantly updated depending on the current selection in the Enhanced Grid View. The Info Window constantly shows important information regarding the selected element or attribute.

Enhanced Grid View context menu
In addition to the commands available through menus and toolbars, the Enhanced Grid View also provides a context-menu, activated by the right mouse-button. It contains the most useful commands in one convenient place:

Enhanced Grid View context menu:
ref_p95a  


Previous  Top  Next

⌐ 2002 Altova