extensibility

Element List Pane


The element list pane, located at the bottom of the Element Types pane, is where much of the creation and editing of element type declarations takes place. The Content Model pane displays the content model of the currently selected element and permits considerable editing, but the element list pane is the quickest way to reach your element type declarations. Most creation, editing, and deletion of elements is done from within the element list pane (Figure A below).

element list pane

Figure A - Element List pane

Each element type is listed in a row of the pane.  Information that defines each element type appears in columns across the pane and includes the following (from left to right):

Additional columns may appear when editing OneSoft schemas or Tamino schemas.  

The entire list can be sorted at any time by clicking on one of the column headers. For example, to sort the list by the name of the element type, click on the Element Type column header. Or, to sort the list by content model, click on the Content Model column header, and so forth. Shift-clicking on a column header sorts the column in descending order.

Row Selector/Error Indicator

The row selector/error indicator (dot), located at the start of each row on the left, can be clicked-on to select a row (or multiple rows, using the shift and ctrl keys) for cut, copy, and paste operations. The indicators turn red if there is an error in the declaration.  If the user hovers the mouse cursor over a red row selector/error indicator for a few seconds, a description of the declaration's error is displayed. Right-clicking on the row selector/error indicator brings up a menu offering cut, copy, paste, and clear options.

Included-Document Indicator

The column between the selectors and the element type names indicates whether a declaration comes from the file being edited. If a small document icon () appears in this space, it indicates that the declaration cannot be edited directly here, because the declaration comes from a file that has been included from the Overview pane.  To edit these declarations, open the original file containing the declarations or unlock the included file in the Overview pane.

Element Type Name

A new element can be created by clicking on a blank row under the element type column, and then entering a name.  (NOTE: Names must begin with a letter and may contain numbers, underscores, dashes, and full stops -- typically periods).  To edit an element type name, click on an existing name in the element type name column.   Unless the schema will be using namespaces, avoid using colons. If namespaces are being used, reserve colons for use as a separator between the namespace prefix and the local part of the element name.

Extends

The Extends column allows SOX developers to represent child/parent relationships. Because the child element extends the parent element, it inherits the content model of parent. (Beta extends Alpha as indicated in Figure B.) The inherited content is indicated in gray; if the child element had additional appended content of its own, that content would appear in the same color as regular elements.

element list pane

Figure B - Extends in SOX

Constraint Checkboxes

XML Authority provides a number of options for describing the content model of an element type, creating constraints on the type of information that may be stored within instances of that element. The checkboxes for Text and Elements (Elem.), shown in Figure B below, provide a basic level of control over the content, and the Content Model/Data Type column allows the user to describe more complex element structures. If you are editing an XML-Data Reduced or XSDL schema, an additional checkbox to indicate whether the content model for the element is open or closed may appear.

element list pane

Figure C - Element Types Declared via Checkboxes and Content Model

The checkboxes interact with each other and with the Content Model to produce a coherent element type declaration. There are some limitations built into the available models. If an element contains a data type, the Text checkbox must be checked and the Element checkbox must not be checked, and the Content Model column (which will change to Data Type) may only contain the name of a data type. Thus, in XML Authority, checking the Text checkbox puts the 'string' data type into the Data Type column by default.

If no checkboxes are checked, the element type has an empty content model, and element instances may not contain any content, whether text, data, or child elements.

The Text and Elem checkboxes may be used separately or together. If only the Text checkbox is checked, the element may only contain text, more specifically the data type indicated in the Data Type column - no child elements are permitted. If both the Text and Elem checkboxes are checked, the element has 'mixed' content and may contain text or the elements listed in the Content Model column in any combination. (If no elements are specified in the Content Model column, and Text and Elem are both checked, the element has an ANY content model.) If only the Elem checkbox is checked, then the content model in the Content Model column will provide constraints for the child elements appearing within instances of this element type.

Tip: You can use Alt-L and Alt-X to toggle the Element and Text checkboxes while you're editing the content model. 

Content Model/Data Type

The Content Model/Data Type column displays the content model of the elements and provides a set of tools for creating and editing content models and data types. (The name of the column changes based on the context set by the Text and Element checkboxes.) Users who are comfortable with occurrence and sequence indicator syntax can enter element content models directly by typing them in the Content Model column. For users not yet comfortable with occurrence and sequence indicators, XML Authority provides a Qlicker (Figure C) that has options, elements, and data types to help the user create and edit content models. 

editing a content model

Figure D - Content Model Qlicker

The Insert button provides a drop-down menu (Figure D) that differs depending on whether the content model may include elements or data. 

content model menus

Figure E - Insert menu
(the menu bar at left appears for element content models;
the menu bar at right appears for data content models)

The Insert menu on the Qlicker provides a quick way to add content that's been previously defined, either a data type (if it's a data element), an element type, or reusable model (if it has child elements). The selected material is inserted at the current location of the cursor. Right clicking on the content model also brings up the Insert menu.

For element content models, the Qlicker also lets the user apply sequence and occurrence indicators to his/her choices. The user selects a group of elements and then chooses from Choice or Sequence, Optional, and Repeatable. XML Authority adds the appropriate content model syntax to the group of selected elements, helping to build a content model quickly. (The buttons' states change to reflect the current selection.)

Note: Within XSDL and SOX schemas, the Qlicker also allows developers to set local tags for a current element and specify occurrence ranges for elements and groups of elements.   

If the space provided by the Content Model column is too small to see all of an element content model, selecting Expand from the View menu or pressing the Ctrl-E keys brings up the Content Model Editor dialog box (Figure E).

content model menus

Figure F - Content Model Editor dialog box

The Content Model Editor provides more room for editing, making it easier to work with larger content models, and gives easy access to the elements and reusables (that were previously hidden in the Insert drop-down menu.) To add an element type or reusable to a content model, click on its name. The Qlicker is available in the Editor, and works the same way. The Apply button adds the edited content model to the list, but leaves the Editor open. The Cancel button closes the Editor without making any changes to the content model in the list, while the Save button closes the Editor and makes the changes.

When leaving the Content Model Editor (or Applying changes in the Content Model Editor), XML Authority checks the content model to see if there are references to any new element types. If there are, it will ask the user to create new declarations for them, which appear by default as containers for text and elements with no element content model specified.

XML Authority enforces XML 1.0's rules for acceptable content models, and may seem to limit your choices at times. Mixed content, for example, is always a list of elements separated by | (or) sequence indicators, marked as an optional and repeatable group. XML 1.0 does not allow the creation of content models where text and elements are mixed; these content models would not be any other model that that of elements separated by | (or) sequence indicators.

Attributes

The Attributes column allows the user to specify which attributes may be used for a particular elements. If an attribute name is entered which does not yet exist, XML Authority creates one with a default type of string and no constraints. Attributes can be edited in the Attribute Types pane at any time. Right-clicking on an attribute name when the field has not been opened for editing brings up a 'Go to' option that lets the user edit attributes immediately. When this list of attributes is open for editing, an Insert Attribute menu listing previously defined attributes and reusables becomes available both as a button and as a right-click pop-up menu (Figure F). Selecting an attribute name or a reusable adds it to the current list.

Insert Attribute menu

Figure G - Insert Attribute pop-up menu

Copyright 2000 Extensibility, Inc.

Suite 250, 200 Franklin Street, Chapel Hill, North Carolina 27516