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:
- In the DTD Editor, create a DTD object, then click Wizard.
- Select the root element of the tree, right-click, and choose Insert Entity and select a modeled entity.
-
To add fields to the entity:
- Choose Load Fields and select the fields you want, to add fields from the same entity.
- Choose Insert Field to add fields that are not defined in the entity.
- To add child entities to an entity, right-click, and choose Insert Entity and select a modeled entity.
- To add attributes to an element, select it, right-click and choose Select Attributes.
-
To rename an object in the DTD
Wizard:
- Select the object, right-click, and choose Rename from the context menu.
- 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
staysfld_1
, notfld_1.ent_1
. - Duplicate names that match exactly,
regardless of the case, are not allowed. Thus,
MyField.Ent
is the same asMYFIELD.ENT
. However,MyField
is different thanMyField.Ent
.
-
Compile the DTD.
This generates a DTD that defines a structure corresponding to the selected application entity.