![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |
Table 23 Configuration tab Field This is the name of the file when persisted. The *.dtd suffix will be automatically added.
Table 24 Statistics Tab Fields For a description of the buttons that appear on the toolbar when editing DTD resources, see Toolbar Buttons.
For element content models, buttons are provided for applying sequence and occurrence indicators. Table 26 describes the Occurrence indicators. Table 27 describes the Sequence indicators.
Table 26 Occurrence Indicators
Table 27 Sequence Indicators This declaration requires the MEMO element to contain, in sequence, one or more To elements, one or more From elements, zero or more Cc elements, a single Subject element, a single Body element, and zero or one Typist elements.The Intro element could appear once (and only once) at the start of the chapter, and then Section or Sidebar elements could follow in any order. (This model is read as “an Intro element followed by zero or more Section or Sidebar elements”.)This section steps you through building a content model using the buttons provided in the Content Model column. Figure 49 shows a completed content model.You will build the content model for an element based on the structure of a book. The content model would likely include several elements, including a Title, an Author, multiple Chapters, maybe an Appendix (or several), perhaps a Glossary, and possibly an Index. Assuming these elements are already declared, the steps to build the content model for Book appear below:
1. In the row for Book, click in the blank cell under the Content Model column. This is where the entry for the content model will be created. A series of buttons will appear. You should see the text cursor blinking inside the parentheses.Figure 50 Content Model Column
2. Figure 51 Element Declarations
3. Select the first element to be part of the content model (in this case, we'll start with Title). Repeat this step, selecting each element that is part of the content model. It's best to select the sub-elements in sequence if possible, because as each sub-element is selected, a comma is inserted between items by default to indicate that they are in sequence. The sub-element will always be inserted where the cursor is placed in the content model.Figure 52 Content Model
4. Which items may be repeatable? Within a book, the chapters usually occur more than once, so this sub-element needs to be indicated as a repeatable item. Highlight Chapter in the Content Model, and click on the Repeatable button. This adds a '+' indicator after Chapter, to indicate it is repeatable. Likewise, there may be more than one appendix, so highlight Appendix and click Repeatable to add a '+' indicator after Appendix.Figure 53 Repeatable Button
5. Which items are optional? Within a book, a glossary or index may not always occur, so these sub-elements need to be made optional. Highlight Glossary, and click the Optional button. Likewise, highlight Index, and click the Optional button. This will place a '?' after each of these sub-elements, to indicate they are optional.Figure 54 Optional Button
6. Appendix is also an optional item (not all books have appendices). Highlight Appendix and click the Optional button. Because Appendix is now both optional and repeatable, it is indicated with an '*' after it. Press the <Enter> key or click anywhere else in the element list panel to complete the content model.Figure 55 Adding Appendix
If the space provided by the Content Model column is too small to see all of an element content model, select Expand from the Schema > View menu or press the Ctrl-E keys to bring up the 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 (internal parameter entities). To add an element or reusable to a content model, click on its name. Occurrence and Sequence indicator buttons are also available in the editor. 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. The Content Model Editor is shown in Figure 56.Figure 56 Content Model Editor
Table 28 Reusable Editor
Once your reusables are created, they become available as choices by way of the Insert button within the Content Model and Attributes column of the element list. Notice that parameter entities, when referenced, are prepended with a ’%’. Figure 57 illustrates the use of a reusable within a content model.See Content Model Diagram for more information about the content model diagram.When selected from the Schema > View menu or upon clicking the Attributes button on the toolbar, the attributes panel becomes the primary panel for editing. The attributes panel is used to view, create, and edit attribute type declarations. While you can also create an element’s attribute in the element list, the attributes panel is required to specify an attribute’s data type, edit its constraints, indicate its use, and set a default value. The attributes panel is shown in Figure 58.Figure 58 Attributes Panel
Table 29 Attributes in the Panel This column allows you to modify the row and detect errors in the declaration. See Common Columns In Tables for more information about this column. This column indicates whether the declaration comes from the file being edited or from an external schema. See Common Columns In Tables for more information about this column. Note: Attribute names must begin with a letter and may contain other letters, numbers, underscores, dashes, and periods. The Constraints column allows you to limit the choices available for attribute values. This column is only applicable if the enumerated type is selected in the Data Types column. In this case, the Edit Enums button loads the enumerations editor (the Enumerations tab of the properties panel), where you can specify a list of possible values (of the specified data type) for the attribute. For more information on constraining attribute values, see Properties Panel. If the attribute’s usage is designated as default or fixed, enter the default or fixed value in the Value column. Choosing either optional or required and then entering a value in the Value column will produce an error message. Choosing either default or fixed and omitting a value in the Default column will also produce an error.
Table 30 Datatypes within a DTD
Creation of an attribute type within the attributes panel consists of several steps. For example, assume you have an element Picture, with the attributes GraphicsType. GraphicsType is an attribute that tells us if a picture is a JPG, TIF, or GIF file.Here are steps for declaring GraphicsType:
1. Click on a blank line under the Attributes Name column. Enter the attribute name GraphicsType. Names must begin with a letter and may contain numbers, underscores, dashes, and full stops -- typically periods.
2. Select the cell under the next column heading, Element, in the row for GraphicsType. Since we know this attribute will be used by the element Picture, type in Picture.An attribute type declaration, by default, sets the data type for an attribute to string. In this example, GraphicsType will be enumerated (that is, it will only ever have the value of JPG, TIF, or GIF).
4. Click the Type button and select enumeration from the XML Types menu.Since GraphicsType can be only be a JPG, TIF, or GIF, these values must be entered in the attribute type declaration.Figure 59 Enumeration Tab
8. To set the default value of GraphicsType to JPG, tab into the cell under the Use column for the row GraphicsType. Click the Select Use button to display a menu of choices. Choose 'default' from the drop-down menu.This completes the declaration for GraphicsType.When you choose Schema >View >Overview or click the Overview button on the toolbar, the overview panel loads to the left of the elements panel. The overview panel allows you to control the creation of schemas that use multiple modules, as well as explore the overall organization of your schema. The overview panel's tools let you build schemas from declarations in multiple files, create large composite schemas from sets of smaller ones, enhance reusability and simplify management. Figure 60 illustrates the overview panel with the right button menu activated.Figure 60 Overview Panel
Table 31 XML Schema Icons
Figure 61 Overview Tree
When selected from the Schema > View menu or upon clicking the Properties button on the toolbar, the properties panel loads to the left of the elements panel. The properties panel includes three tabs -- Properties, Constraints, and Enumeration. When working with a DTD resource, only the Enumeration tab is applicable. When an attribute is of type enumeration, use the Enumeration tab to create a list of possible values.The Enumeration tab allows you to enumerate allowable values for an attribute. Accordingly, the Enumeration tab becomes applicable when an attribute is declared to be of type enumeration. The Enumeration tab is shown in Figure 62.Figure 62 Enumerations Tab of the Properties PanelFor example, to create an entity named 'shortened' that has the value '(title, paragraph)' - an element content model - the entries shown in Figure 63 would be appropriate.Figure 63 Creating an Internal Parameter EntityFigure 64 illustrates the use of a parameter entity within a content model.Modules that have been added through the overview panel will appear here, and modules added here will appear in the overview panel. When you add a module, its content is downloaded for use in the current schema. The parameter entity declarations for that module will also appear in the parameter entity window, preceded by an icon if the module hasn't been opened for editing in the overview panel. A listing of external parameter entities is shown in Figure 65.Figure 65 Listing of External Parameter Entities
Defining an internal general entity requires only the entry of a name and a value. The value must be plain text or well-formed XML - all start tags in the entity must have end tags and vice versa. Figure 66 illustrates the creation of two internal general entities.Figure 66 Defining Internal General EntitiesExternal general entities work very similarly, except that the value isn't given in the declaration. Instead, a reference to another document in your project is provided (either a full or relative path name), and the contents of the referenced document are used as the value for substitution. Like the value of an internal entity, all markup within the referenced file must be well-formed. Optionally, a public identifier (used in some SGML environments) may be provided. The notation column should be left blank for an external general entity. Figure 67 illustrates the creation of an external general entity.Figure 67 Defining an External General EntityExternal general entities are referenced from documents the same way that internal general entities are referenced -- using the &entityName; syntax. In this case, &play; would reference the XML document 'othello.xml' and include it in a document.
The last kind of entity that can be created in the general entities tab is the unparsed external entities. Unparsed entities reference non-XML content, like graphics files or data. Documents reference unparsed entities through the use of attributes of type ENTITY or ENTITIES. To create an unparsed entity, provide the same information as would be provided for an external general entity (name, system identifier, optional public identifier), but also provide a notation in the Notation column to identify the file type that is being referenced. This notation must be declared on the Notations tab. The 'myGraphic' unparsed entity shown below in Figure 68 is an example of an unparsed entity.Figure 68 Defining an External Unparsed EntityNotations allow you to describe a new data type or file type. The description involves a name for the type and a link to more information on the type or to programs that can process the type. For example, the notations declared in Figure 69 provide information on ISO8601 dates and times, and Java integers. Either could be used for a data type and will appear as an option in the type menus that appear in the elements panel and attributes panel.Figure 69 Notations
Table 32 Notations in Panel This column allows you to modify the row and detect errors in the declaration. See Common Columns In Tables for more information about this column. This column indicates whether the declaration comes from the file being edited or from an external schema. See Common Columns In Tables for more information about this column. Note: Use the Insert File Name button to browse for and select a file in your project containing the desired content.
Table 33 Processing Instruction This column allows you to modify the row and detect errors in the declaration. See Common Columns In Tables for more information about this column. This column indicates whether the declaration comes from the file being edited or from an external schema. See Common Columns In Tables for more information about this column. Enter the instruction for the processor. The format for the instruction is up to you, though it may not contain the sequence ?>, which ends a processing instruction,
Table 34 Notes Panel in Selected Declaration
Table 35 Notes Panel
![]() |
Copyright © TIBCO Software Inc. All Rights Reserved |