About Arbortext Styler > Generating Indexes > Creating an Index with Attribute Model Index Terms
Creating an Index with Attribute Model Index Terms
Some document types provide a single index term element. For example, documents based on the CALS model contain only the indxflg and index elements. The indxflg element is set as the index term element while the index element is used to generate the index itself in the document. In these cases you can extract the value of selected attributes in the element to form index term content, and assign a role to each attribute to specify the level at which its value should be output in the index entry.
The following example demonstrates how to create and modify an index using the Attribute Model.
Example: Creating an Index with Attribute Model Index Terms
1. In Arbortext Editor, open the calsindex.sgm document located at Arbortext-path/samples/styler. Note that the document includes various indxflag elements throughout its content, each with a ref1 attribute defining a piece of index entry content.
2. Choose Styler > New Stylesheet to create a new stylesheet.
3. In Arbortext Styler, deselect the View > Only Elements in Document option to display in the Elements list all elements permitted by the doctype.
4. In Arbortext Styler, select the indxflag element and give it the Index Term (Attribute Model) style from the Style list, accessed via the Edit > Style menu option. The Index Term (Attribute Model) Details dialog box opens.
5. On the Indexes tab, note that the index definition object Main Index is already selected. The index object is created and selected automatically when your stylesheet is updated. The index term you’re styling will belong to all indexes set to be formatted with this index definition object.
Create and select an alternative index definition object if required. Refer to Indexes List for further information.
6. On the Roles tab, configure the roles that the ref1. ref2, ref3, and ref4 attributes should perform in the final index entry. Roles specify the level at which each attribute’s content is output in the index entry.
Select each attribute in turn in the Available attributes list, and click Add to move it to the Index term attributes list. Select a role for the attribute from the Attribute role field.
For example:
ref1 - Level 1 term
ref2 - Level 2 term
ref3 - Level 3 term
ref4 - Level 4 term
7. Click OK to save your settings and exit the dialog box.
8. In Arbortext Editor, place your cursor directly to the left of the rear element at the end of your document. Insert an index element if one does not already exist.
9. Back in Arbortext Styler, select the index element in the Elements list and give it the Index style from the Style list, accessed via the Edit > Style menu option.
10. In the Index Details dialog box, select the index definition object that will format the index from the Index drop down list. Set the language in which the index will be sorted from the Language field.
11. Select Preview > Print to view the new index in your document.