The Tag and Edit areas are designed to present a document's elements and attributes in an orderly and structurally significant manner. Because the most appropriate view of a document may vary based on a user's needs, these areas have been made to be easily customized. The default view (Figure A) for the Tag and Edit areas present all elements (identified by a diamond) in a vertical manner, with child elements appearing indented under the the parent elements. The default view displays an element's attributes (identified by a circle) in the same position as a child element. In Figure A, name is a child element of shipTo, while same is an attribute of shipTo.
Figure A - Default View
XML Instance provides a wide variety of mechanisms to customize the default view:
NOTE: When a view is customized for a single document based on a schema, the changes are automatically carried over to all other instance documents adhering to the same schema.
Expanding and Collapsing Elements
To allow for a cleaner view of your document at a particular level of its hierarchy, you can expand or collapse sections of the tag structure by clicking the small + or - icons preceding element tags. In Figure B, the item element has been expanded to display all of its sub-element content, while the content of header has been collapsed. (A single element can also be expanded or collapsed via the Item menu.)
Figure B - Expansion/Collapse Icons
All elements of a particular type can be collapsed at once by right-clicking on an instance of element in the Tag Area and selecting the "Element Type" option from the drop down menu. A second menu will appear with the expand and collapse options (Figure C). (Element types can also be collapsed/expanded via the Type menu.) All "Type" level changes are executed at the schema-level and affect all instances of elements and attributes of a particular type.
Figure C - Tag Area Drop Down Menus
The Tag Area's tags are nested by default to emphasize parent-child relationships, but you can align the labels flush left via the View menu (View...Align Labels). Such an alignment is especially useful when working with documents with deeply nested hierarchies.
Figure D - Left alignment of elements
When working with a specific set of elements in a document, XML Instance allows you to hide the elements and attributes you are not working with. Elements can be hidden either on an item basis (i.e. hide only one instance of the element) or on a type basis (hide all instances of a particular element.) After selecting an element within the Tag area it can be hidden on an item basis either by right-clicking on the element and selecting hide from the drop-down menu (Figure E) or by selecting hide from the Item menu.
Figure E - Hiding an Element
All elements of the same type can be hidden via the Type menu or by right-clicking on the element and selecting "Element Type" from the first drop down menu and "Hide" from the "Element Type" sub menu. In Figure F all address elements will be hidden.
Figure F - Hiding an Element Type
To show elements that have been hidden, select the parent of the hidden element and use the "Show" or "Show All" functions accessible through the Type and Item menus as well as the Tag area drop down menus. The Show command is used to select an individual element or element type to be shown, while "Show All" displays all items previously hidden for the selected element. Use the Type Menu or the Element Type drop-down (shown in Figure F) to display elements types that have been hidden. Use the Item menu or the element-level drop down (shown in Figure E) to display elements hidden one at a time. Hint: Select the root element to show all of elements and attributes previously hidden.
XML Instance allows you to take an element or attribute whose tag name is not easily understood and give it an alias in your view of the document. In Figures G-H, the attribute dur is given the alias of duration.
Figure G - Creating an Alias for an Attribute
Figure H - Attribute displayed as an alias
The alias is only designed to help users understand the meaning of a tag without having to rename the element; when you save a document containing aliases, the original element names will be preserved.
XML Instance allows you to assign one of six colors to one or more element types in the Tag Area. The default background color (light gray) will change to the chosen color. Assigning different colors to particular elements provides a quick way to locate particular elements, facilitating data entry (Figure I).Figure I- Adding Color to Elements
Their are two ways to add color to the element type selected in the Tag area:
Promote Elements and Attributes
You can customize your view from the default vertical format to a horizontal tabular format through promotion. In Figure J, the attributes name and focus have been placed on the same row as their parent, sale_agent and the elements total_sales, total_calls, nails, and screws have been placed on the same row of their parent, monthly.
Figure J - Promotion
If you want to promote a large number of child elements, you can resize an element row to allow for multiple lines of promotion per element. To resize an element row vertically, click on the bottom of the row in the area just to the left of the split bar separating the Tag and Edit Areas and then drag to the desired size. An element row can be re-sized to allow for a maximum of 7 lines per row. In Figure K , the row for the element monthly has been resized to allow for three lines of promotion.
Figure K- Multiple lines of promotion
There are three different ways to promote elements and attributes:
If the promoted element has any promoted item of its own, they will accompany the element's move and also display in tabular format. If there are multiple occurrences of the promoted element, all elements of the same type will reflect the promotion.
Note: Promoting the elements does not change their structural position within the XML document, just their position within the viewable interface of XML Instance.
If you wish to cancel the customization, choose Undo Promote from the Edit menu or right click on the promoted element and select Demote from the drop-down menu.
The style and size of the font displayed in Instance can be changed in the preferences menu (Figure L) accessed via the edit menu.
Figure L - Set font preferences
Copyright 2000 Extensibility, Inc.
Suite 250, 200 Franklin Street, Chapel Hill, North Carolina 27516