Reusing parameter entities in attributes can save you a lot of
time. If you have several elements using the exact same attribute, you only
have to input the information once (into an entity).
The following instructions were written for the Resource
perspective, but they will also work in many other perspectives.
You
can create a DTD that reuses internal parameter entities in attributes. To
reuse internal parameter entities in attributes, follow these steps:
- In the workbench, create a new DTD.
- Add a new entity to the DTD you just created.
- Select Parameter from the Entity
type list, and type a value in the Entity Value field.
- Create an element and add an attribute to it.
- If you want to reuse the entity in an attribute name, in the Name field
for the attribute, type the name of the entity (that is, %NewEntity;) then
in the Type field, select the type for the attribute. Tip: If you want to use an entity to replace an entire attribute
definition, select (none) from the Type list.
- If you want to reuse the entity as the type of an attribute, type
the name of the attribute, and, in the Type field,
click the name of the entity you created in step 2.
- Repeat steps 4 and 5 or 4 and 6 as applicable.
You now have two attributes with the same name or type.
The following sample shows how you might reuse internal parameter
entities in an attribute type.
You are making a list of office supplies,
and all your supplies have Part and Stock attributes.
- Create a new DTD called OfficeSupplies.dtd .
- Add an entity called PartStock. Select Parameter from
the Entity type list. In the Entity Value field,
type Part ID #REQUIRED Stock CDATA #IMPLIED.
- Add three new elements to OfficeSupplies.dtd: pen, paper,
and pencils. Make the value of each element (#PCDATA).
- Right-click pen and click Add Attribute.
In the Name field for the attribute, type ID_Numbers.
In the Type field, click %PartStock;.
- Repeat step 4 for paper and pencils.
You now have three elements with the same attribute.