About Arbortext Styler > Cross References and Other Links > Creating Cross References and Cross Reference Formatting > Specifying Cross Reference Formatting for References to a Particular Element
Specifying Cross Reference Formatting for References to a Particular Element
To use an XPath expression to specify the formatting for cross references whose linkend attribute defines a reference to a listitem element only:
1. In Arbortext Styler, select the xref element (or applicable context) in the Elements list, and then choose Insert > Condition to define a condition for this element.
2. In the New Condition dialog box, click New XPath Test to open the New XPath Test dialog box.
3. Enter the XPath expression name(id(@linkend))='listitem' to advise Arbortext Styler that the formatting will apply to listitem elements that are given as targets of the cross reference. Click OK to exit the XPath dialog box.
4. In the New Condition dialog box, select the Condition Type as applicable and click OK, to exit the dialog box.
Note that here you can test for multiple numbered element names. Two methods apply:
Include multiple tests in a single XPath expression
Define a separate XPath expression for each element and select the Any test is true option in the Condition dialog box
5. Select the condition you just created in the Elements list then navigate to the Generated text category.
6. Click Edit to the right of the After-text field.
7. Click to the right of the Cross Reference element, and then choose Edit > Modify Attributes.
8. Choose Number as the Cross reference format, and linkend as the Reference attribute.
9. Click OK.
10. Choose File > Apply and Close in the Generated Text Editor.
11. In Arbortext Editor, choose File > Print Preview to confirm that the Number formatting style has been applied to your cross reference.