About Arbortext Styler > Formatting Footnotes and Endnotes > Formatting the Reference Mark in a Footnote > Example: Generate a combination of numbered footnotes and footnotes with reference marks based on attribute values
  
Example: Generate a combination of numbered footnotes and footnotes with reference marks based on attribute values
Here you will output two types of footnote in the same DocBook document - numbered footnotes and footnotes whose reference mark is generated from the value of the footnote element’s label attribute.
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 if this has not already been done.
4. Create two contexts of the footnote element, with details as shown below:
Context
Description
Footnote properties
footnote[@label]
Footnotes that include a value for the label attribute
Element contains footnote text
Generates reference mark and footnote
footnote everywhere else
All other footnotes
Element contains footnote text
Generates reference mark and footnote
You should now see four contexts of the fn element, as listed below:
footnote[@label]
footnote[@label] (Footnote Area Properties)
footnote everywhere else
footnote everywhere else (Footnote Area Properties)
5. Select the footnote everywhere else (Footnote Area Properties) context in the Elements list.
6. 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.
Note that the footnote context is set to be numbered. Leave this setting as it is.
7. Select the footnote[@label] (Footnote Area Properties) context in the Elements list.
8. Navigate to the Footnote Number dialog box , as described above.
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, when it has been specified.
11. Click OK to exit the Footnote Number dialog box. Note that the value of the Add before element content field is now S..
12. In Arbortext Editor, create four footnotes in permitted locations in your DocBook document, with the details as shown below:
The image shows markup for four <footnote> elements, two with “label” attributes specified and two without
13. In Arbortext Styler, choose Preview > Print. In the Print Preview window, note that the footnotes have been given reference marks as shown below:
The image shows four footnotes, the first and last with character markers, and the middle two numbered “2” and ”3”
You can see that the four footnotes have been counted together. In the next step you will exclude the footnotes with character markers from the counting scheme, thus outputting the two numbered footnotes with markers 1 and 2.
14. Select the footnote everywhere else (Footnote Area Properties) context in the Elements list. Navigate to the Generated text category.
15. Navigate to the Footnote Number dialog box , as described above, and click the Edit button next to the XPath override for current level field. The Edit XPath Override for Current Level dialog box opens.
16. Select the XPath expression returns a string option, and enter the expression shown below in the Expression field:
count(preceding::footnote[not(@label)])+1
Click OK to exit the dialog box. Here you have specified that the numbering count for numbered footnotes should not include those that have the label attribute specified.
17. Repeat the Preview > Print action. You will see now that the reference marks for the two numbered footnotes are now 1 and 2. They have been counted in isolation from the footnotes marked with characters:
The image shows four footnotes, the first and last with character markers, and the middle two numbered “1” and ”2”