About Arbortext Styler > Formatting Footnotes and Endnotes > Formatting the Reference Mark in a Footnote > Example: Output a reference mark based on an attribute value: Inline Model footnote
  
Example: Output a reference mark based on an attribute value: Inline Model footnote
In this example we work in 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.
4. Choose Insert > Context to create a new context for the fn element.
The New Context dialog box opens.
5. From the Position list, select XPath Predicate.
The XPath Predicate dialog box opens.
6. Enter @label in the XPath Predicate dialog box then click OK to exit the dialog box. The context footnote[@label] appears in the New Context window. Click OK to save the context and exit the dialog box.
The context footnote[@label] now appears in the Elements list. Leave the footnote setting in the Footnote category as Element contains footnote text, and Generates reference mark and footnote. The description of the regular context for footnote[@label] reads Footnote (content and reference).
Note that a special context footnote[@label] (Footnote Area Properties) has also been created.
This context will match if the label attribute on the footnote element contains a value.
7. Select the footnote[@label] (Footnote Area Properties) context in the Elements list.
8. Navigate to the Generated text category for the context. In the Numbers and Bullets field, select the Details button where Number is selected. The Footnote Number dialog box opens.
9. Click the Edit button next to the XPath override for current level field. The Edit XPath Override for Current Level dialog box opens.
10. Select XPath expression returns a string in the Expression type field, then add the expression @label in the Expression field. Click OK to exit the dialog box. Here you have specified that the value of the label attribute should be used as the marker for the footnote, rather than the default numbering.
11. Click OK to exit the Footnote Number dialog box.
12. You may wish to add formatting to the footnote before you generate it. The list below describes the stylesheet items that relate to each part of the footnote:
Reference mark: add formatting properties to the footnote[@label] context of the fn element.
Footnote body: add formatting properties to the footnote[@label] (Footnote Area Properties) context of the footnote element. This context also has the property set Footnote font assigned, which you can edit as necessary.
Footnote number: apply formatting properties via the Numbering Details dialog box, accessed by clicking the Details button for numbering, in the Generated text category for the footnote[@label] (Footnote Area Properties) context.
13. In Arbortext Editor, create a footnote in the document by inserting a footnote element anywhere the element is permitted. Set the value of the label attribute to the # character. Add the text that should form the footnote content.
14. In Arbortext Styler, choose Preview > Print. In the print preview window, note that the footnote you added is marked by the # character, and the footnote is placed at the bottom of the page as usual, with the same character marking it.