TagBar Overview

TagBar is a tool that allows you to compose an XML document based on an XML Schema. TagBar displays the Schema definition as an expandable element tree. This tree shows all the elements defined in the Schema, their relationships and attributes.

Getting Started with TagBar

Load an XML Schema into TagBar using the Load TagBar command in the Tools menu. The root of the TagBar tree is the root element as defined in the XML Schema. The children of an element in TagBar are the element’s attributes, the allowable child elements for that element, and any user defined content nodes.

Note: Note that the XML Schema documents loaded into TagBar must conform to IE5's support of the XML Schema language. Information about IE5's Schema support can be found at Microsoft's website.

(See also: How to Load an XML Schema into TagBar.)

Elements in TagBar

Each element represented in TagBar has one of the following associated icons:

sequence A sequence of this element may appear. The order of the sequence matches the order shown in TagBar.
one Only one of this element may appear.
many Multiples (Many) of this element may appear in any order.
attribute An attribute of the parent element.
content node A user defined content node.

Min, Max and Data Types

The minimum and maximum allowable number of each element is shown in the square brackets ([]) following the element name. The first number in the square brackets indicates the minimum allowable number of this element. The second number in the square brackets indicates the maximum allowable number of this element. An asterix (*) indicates that there is no limit on the maximum number of instances of the element.

The Schema datatypes as defined in the XML schema can also be displayed after the minimum and maximum values. The Show Datatypes in TagBar Preference must be enabled to see datatypes. This preference is disabled by default.

Inserting Elements using TagBar

To insert an element into the current document using TagBar, click and drag the element you wish to insert, and drop the element in the location where you want to insert it in the document.

(See also: How to Add Elements from TagBar to a Document.)

TagBar Auto Insert and Insert Mode

One of the most convenient features of TagBar is the ability to specify child elements, attributes and content that should be inserted when a given element is inserted.

The Auto Insert functionality is controlled at both a global and local level. There is a global preference called Insert Mode, which controls the overall behaviour of TagBar. This preference is accessible by right clicking on a tree item in TagBar. The values that Insert Mode may have are:

Don’t Insert ChildrenOnly the specific element dragged from TagBar will be inserted. No attributes, child elements, or content nodes will be inserted.
Auto Insert ChildrenOnly the attributes, child elements, and content nodes that are switched to Auto Insert will be inserted. See below for further explanation.
Insert All ChildrenAll attributes, child elements, and content nodes will be inserted.

At a local level, you can individually specify which elements, attributes and content nodes should be automatically inserted. To switch an element on or off, right click on the element and select Auto Insert. Elements that are set for Auto Insert are displayed in bold in the TagBar tree. If the global Insert Mode preference is set to Auto Insert Children, only the elements that are bold in TagBar, will be placed in the document.

Content Nodes

Content nodes allow you to define common or repeatedly used content for a particular element. To define a content node for an element or attribute, right-click on the tree item and select Add Content Node. After you type some text and press OK, a new child node will be created for the element or attribute you selected. If this content node is on Auto Insert, when you drag the parent element or attribute into the document the content will be placed inside the element’s start and end tags, or as the attribute value respectively.

Note: You can define multiple content nodes for an element or attribute and include some or all of them by setting the Auto Insert properties of each. You can also drag content nodes directly into the document, just inserting the text itself without an element or attribute.

(See also: How to Insert Content into Elements in TagBar.)

Hiding TagBar Items

If you are working with a very large Schema, it may be convenient to only display some portions of the Schema in TagBar. You can hide individual elements, attributes and content nodes in order to reduce clutter in TagBar. To hide a TagBar item, right-click on the item and click on the Hide context menu item. To show hidden items, click on the item’s parent and select the item from the Show Children list. You cannot hide the root element.

Note: Hidden items are still inserted if the global preference and the Auto Insert value for that item dictate that it should be inserted. This is convenient if you have a lot of standard elements that you want to insert, but do not need to see in TagBar.

(See also: How to Show/Hide Elements in TagBar.)

Additional Notes

When you load a schema, default values for attributes are automatically inserted as content nodes for that attribute. Attributes indicated as required in the Schema are initially set to Auto Insert.

You cannot save your changes to TagBar in this version of XMLwriter.

<<Previous Section Contents
Main Contents
Next>>