Generating a DTD From a Modeled Entity

You can use the DTD Wizard to create DTDs based on modeled entities.

Note:  When working in the DTD Wizard, you can only insert modeled entities. To define elements for non-modeled objects, edit the DTD in the Define DTD form.

To generate a DTD from an application model entity:

  1. In the DTD Editor, create a DTD object, then click Wizard.
  2. Select the root element of the tree, right-click, and choose Insert Entity and select a modeled entity.
  3. To add fields to the entity:
    1. Choose Load Fields and select the fields you want, to add fields from the same entity.
    2. Choose Insert Field to add fields that are not defined in the entity.
  4. To add child entities to an entity, right-click, and choose Insert Entity and select a modeled entity.
  5. To add attributes to an element, select it, right-click and choose Select Attributes.
  6. To rename an object in the DTD Wizard:
    1. Select the object, right-click, and choose Rename from the context menu.
    2. In the resulting dialog, provide a new name for the object. and click OK.

    When you rename elements, note the following:

    • The default element name suggested is the lowercase Uniface name. If you accept the lowercase element name, a mapping is added to the DTD mapping table.
    • If an element name is exactly the same as the Uniface name, and is uppercase, the mapping is removed from the table.
    • No attempt is made to qualify the element name when a dot is missing. Thus, fld_1 stays fld_1, not fld_1.ent_1.
    • Duplicate names that match exactly, regardless of the case, are not allowed. Thus, MyField.Ent is the same as MYFIELD.ENT. However, MyField is different than MyField.Ent.
  7. Compile the DTD.

    This generates a DTD that defines a structure corresponding to the selected application entity.

Related Topics