About Arbortext Styler > Formatting Footnotes and Endnotes > Formatting the Reference Mark in a Footnote > Example: Output a reference mark based on an attribute value: Reference Model footnote
  
Example: Output a reference mark based on an attribute value: Reference Model footnote
Here we assume the use of a DocBook document, with its permitted footnote element footnote. The value of the label attribute should be output as the footnote reference mark.
Note that this procedure also applies for DITA document types. You will use different footnote elements and attributes.
1. In Arbortext Editor, open a DocBook document and use the Styler menu to open a new stylesheet.
2. In Arbortext Styler, select the footnote element in the Elements list.
3. Assign the Footnote style to the footnote element via the Edit > Style menu option. Note that a new context with the (Footnote Area Properties) suffix has been created for the footnote element.
4. In the Footnote category for the footnote everywhere context, deselect the Generates reference mark and footnote option. You will see that the special context footnote everywhere (Footnote Area Properties) disappears, and the description of the footnote everywhere context changes to Inline, Footnote (content). Here you have specified that the footnote element will generate the footnote content only, and another element will produce the footnote and reference mark.
5. Select the xref element in the Elements list.
6. Assign the Cross Reference style to the xref element via the Edit > Style menu option.
The Cross Reference Details dialog box opens.
7. Select linkend as the target attribute of the cross reference in the Reference attribute field. Set the required cross reference format option, for example Number, then click OK to save the change and exit the dialog box. Here you have specified that the reference mark for the footnote will output the footnote number.
8. With the xref element still selected, select Insert > Context to create a new context.
The New Context dialog box opens.
9. Select XPath Predicate from the Position list.
The XPath Predicate dialog box opens.
10. Enter @role='fn' and id(@linkend)/@label in the XPath Predicate field then click OK to close the dialog box. The context xref[@role='fn' and id(@linkend)/@label] appears in the New Context dialog box. Here you have specified that the xref element will match when its role attribute has a value of fn and its linkend attribute points to an element that has a label attribute specified.
11. Click OK to save the new context and close the New Context dialog box.
12. Select the xref[@role='fn' and id(@linkend)/@label] context in the Elements list.
13. In the Footnote category, select the Element references footnote and generates reference mark option. Make sure the Generates footnote checkbox is checked. You will see that a special context xref[@role='fn' and id(@linkend)/@label] (Footnote Area Properties) has been created and the description of the xref[@role='fn' and id(@linkend)/@label] context is now Footnote (reference).
Here you are specifying that, when the cross reference is of role “fn” and its linkend attribute points to an element that has a label attribute, it will generate a reference mark. You are also confirming that the footnote reference will generate a footnote as well, and you will give details of the element that will provide the content for the footnote in the next step.
14. Select linkend from the Reference attribute list to confirm the correct reference attribute of the cross reference.
Here you are specifying the particular IDREF, IDREFS, or CDATA attribute on the xref element that will point to the target element that contains the content of this footnote reference.
15. Refer to the Description tab for the xref[@role='fn' and id(@linkend)/@label] context - you can see that the context is described as Footnote (reference).
16. Select the xref[@role='fn' and id(@linkend)/@label] context in the Elements list and assign the desired formatting properties for the reference mark.
17. Select the special (Footnote Area Properties) context for the footnote context in the Elements list and assign the desired formatting properties for the footnote body.
18. Select the xref[@role='fn' and id(@linkend)/@label] (Footnote Area Properties) context in the Elements list, then navigate to the Generated text category. Note that it is set to generate a number in the Add before element content field.
19. In the Numbers and Bullets field, select the Details button where Number is selected. The Footnote Number dialog box opens.
20. Click the Edit button next to the XPath override for current level field. The Edit XPath Override for Current Level dialog box opens.
21. Select XPath expression returns a string in the Expression type field, then add the expression id(@linkend)/@label in the Expression field. Click OK to exit the dialog box. Here you have specified that the value of the label attribute on the element targeted by the linkend attribute on the xref element should be used as the marker for the footnote, rather than the default numbering.
22. Click OK to exit the Footnote Number dialog box.
Note that the value of the Add before element content field is now S..
23. In Arbortext Editor, create a footnote in the document by inserting a footnote element anywhere the element is permitted, preferably on a page other than the first one. Give it attributes and values as shown below, and add the text that should form the footnote content.
Attribute
Value
label
Alpha character, e.g. #
id
ID, e.g. fn1
24. In the first paragraph in the topic, insert an xref element in the place in the text at which you wish the footnote reference mark to appear. Give it attributes and values as shown below:
Attribute
Value
linkend
footnote ID, e.g. fn1
Follow standard cross reference syntax for the document type to identify the relevant footnote object. This example is written following DocBook guidelines.
role
fn
25. In Arbortext Styler, choose Preview > Print again. In the print preview window, note that the reference marker for the footnote appears at the place in the document where you inserted the xref element, and is marked with the callout character, e.g. #. The footnote appears at the bottom of the page that contains the footnote reference, and is marked with the callout character.