About Arbortext Styler > Cross References and Other Links > Creating Cross References and Cross Reference Formatting > Cross Referencing to an Element That Does Not Have a Title
  
Cross Referencing to an Element That Does Not Have a Title
The steps detailed below describe how to generate a cross reference to a caution element, which does not have a title element, and output the text caution, page and the page number upon which the caution appears as the text for the cross reference. To mimic usual cross reference linking procedure you must create a pseudo title, represented by a User Formatting Element (UFE), for the caution element. The UFE does not need to contain any content, so including it will not affect the appearance of the caution element.
1. In Arbortext Editor, open the transport.xml sample document located at Arbortext-path/samples/styler.
2. Choose Styler > Edit Stylesheet to open the associated stylesheet for edit. This is a read only stylesheet so you will need to save a local copy if you want to make amendments.
3. Choose InsertCross Reference to create a new cross reference format object in the Cross References list The Cross References list icon - blue rectangles in the top left and bottom right corners, connected by a red arrow. Rename the object caution.
4. Click the Edit button to open the Generated Text Editor for the object.
5. Type the text caution, page followed by a space. Choose Insert > Page Number to insert a PageNumberReference gentext object. You have now set the clickable text that will be output for the cross reference.
6. Click File > Apply and Close to save the gentext setting and exit the editor. The window in the property area shows the setting you have made:
This is an image of the property window for the caution cross reference object, showing the text “caution, page” followed by the markup <_gte:PageNumberReference/>
7. In the Elements list, select the xref element. This element has the Cross Reference style in the default stylesheet for the sample file - if this is not the case, use the Edit > Style menu option to assign that style to the element.
8. Navigate to the Generated text category and click the Edit button next to the After-text field to open the Generated Text Editor.
9. Place your cursor to the right of the CrossReference element and click Edit > Modify Attributes to open the Modify Cross Reference dialog box.
10. In the Cross reference format field, select caution. Click OK to exit the dialog box.
11. Click FileApply and Close to save the change and exit the editor. The After-text field shows the change you have made to the format of the cross reference:
This is an image of the After-text field for the xref element, showing the markup <_gte:CrossReference refAttr=”linkend” xrefStyle=”caution”/>
12. In the Elements list, choose Insert > Element to create a new element. Here you are creating a User Formatting Element (UFE), so name the element accordingly, for example _ufe:caution-title.
13. Assign the Title style to the UFE, via the Edit > Style menu option.
14. Choose Insert > Context to create a new context for _ufe:caution-title. The New Context dialog box opens.
15. Click the New Ancestor button and select caution from the ancestor drop down menu. Note that field at the top of the dialog box now reads _ufe:caution-title anywhere in caution.
This is an image of the New Context dialog box for the _ufe:caution-title element, showing the caution with the nested context levels “*” and “_ufe:caution-title” selected. The context description is shown as “_ufe:caution-title anywhere in caution”
16. Click OK to save the new context and exit the dialog box. The new context now appears in the Elements list, described as _ufe:caution-title anywhere in caution.
17. In the Elements list, select the caution element. This element has the Formal Block style in the default stylesheet for the sample file - if this is not the case, use the Edit > Style menu option to assign that style to the element.
18. Note the Description of the caution element - you can see that the element has a separate generated text setting for Print/PDF output. The final step of this procedure is to preview the sample document for PDF output so you must make sure that you edit the Print/PDF option, rather than the overall Base (All Outputs) option.
19. In the Outputs to Edit field, select the Print/PDF option.
20. Navigate to the Generated text category and click the Edit button for the Before-text field. The Generated Text Editor opens.
21. Place your cursor before the markup in the field, then choose Insert > User Formatting Element. Select _ufe:caution-title from the list of UFEs that appears.
22. Choose File > Apply and Close to save the changes and exit the editor. The Before-text field shows the change you have made to the generated text for the caution element in Print/PDF output.
This is an image of the Before-text field for the caution element, which includes the markup <_ufe:caution-title></_ufe:caution-title> followed by the text “CAUTION”
23. In Arbortext Editor, navigate to Chapter 2 of the sample document and add a caution element after the first para element and give it some random text. Set the id attribute of the element to caution.
24. Navigate back to the abstract element at the start of the document. Insert a new para element into the element.
25. In the para element, add the text Refer to for further information.
26. Place your cursor between the words to and for and insert an xref element. The Modify Attributes dialog box appears for the xref element.
27. Set the value of the linkend attribute to caution. Click OK to exit the dialog box. The text is updated to reflect the addition of the cross reference.
This is an image of a para element containing an xref element with the attribute linkend=”caution” that is preceded by the text “Refer to” and followed by the text “for further information”
28. In Arbortext Styler, choose PreviewPrint. In the print preview window that appears, note that the cross reference in the abstract element is updated to read Refer to caution, page 3 for further information. Click on the cross reference to be taken to the caution element.