About Arbortext Styler > Formatting Footnotes and Endnotes > Creating and Modifying a Hybrid Model Footnote
  
Creating and Modifying a Hybrid Model Footnote
Some document types enable you to sometimes use the Inline Model footnote and sometimes use the Reference model. The Darwin Information Typing Architecture (DITA) document types use this method, where the footnote model used depends on the presence of a particular attribute. This is called the Hybrid Model. The Hybrid Model contains a Footnote Content and Reference element with an ID equivalent attribute and a Footnote Reference element. How the model operates depends on whether the ID equivalent attribute in the Footnote Content and Reference element has a value assigned. If it does not have a value assigned, the model operates as an Inline Model footnote and generates both the reference mark and footnote at the location of the element. If the ID equivalent attribute does have a value assigned, then the model operates as a Reference Model footnote and must be referenced by the IDREF, IDREFS, or CDATA attribute of the Footnote Reference element.
To support this model in Arbortext Styler, you must use an XPath predicate element context to determine which type of footnote model should be used in a document. The following example uses a DITA document type. Arbortext Editor contains support for the DITA attributes by default. If you want to use the hybrid footnote model and your document type does not have an ID attribute defined in the document type for the Footnote Content and Reference element, you must define a chosen attribute as an ID equivalent. To do this, use the idAttribute attribute on the Options element in the document type's document type configuration file (.dcf file) to define the attribute as an ID.
See Document Type Configuration Files in Arbortext Editor online help for further information about document type configuration files.
The following examples use a DITA document type to illustrate how to create and modify a Hybrid Model footnote based on the id and href attributes. Note that Arbortext Editor contains support for the DITA attributes by default.
Example: Creating a Hybrid Model Footnote (DITA)
1. In Arbortext Editor, open a DITA document and use the Styler menu to open a new stylesheet.
2. In Arbortext Styler, select the fn element in the Elements list.
3. Assign the Footnote style to the fn element via the Edit > Style menu option. Note that a new context with the (Footnote Area Properties) suffix has been created for the fn element - this is where you can add formatting properties specific to the footnote body. Note also that the description of the regular context for the element is given as Footnote (content and reference).
Note also that a new context for the p element, p (first in its parent) anywhere in fn has also been created, with a Structure Type of Inline (see the Breaks category). This special context is added so that Arbortext Styler can make sure that the first paragraph (i.e. that which contains the footnote content) in a fn element is marked as inline and hence will appear on the same line as the footnote number in the footnote area. If you set formatting for this context, its properties will be reflected in the footnote content.
4. With the fn element still selected, choose the Insert > Context menu option to create a new context.
The New Context dialog box opens.
5. From the Position list, select XPath Predicate.
The XPath Predicate dialog box opens.
6. Enter @id in the XPath Predicate dialog box then click OK to exit the dialog box. The context fn[@id] appears in the New Context window. Click OK to save the context and exit the dialog box.
The context fn[@id] now appears in the Elements list. This context will match if the id attribute on the fn element contains a value.
Note that a special context fn[@id] (Footnote Area Properties) has also been created, and that the description of the regular context fn[@id] is Footnote (content and reference). You will change these default settings in the next steps.
This is an image of the Description tab for the fn@id context, which displays the description “Hidden, Inline, Footnote (content and reference), Gentext: Add Before(1)”
7. Select the fn[@id] context in the Elements list. Note that it is set to Hidden in the Text category - this is because the element itself should not be displayed if the id attribute is present, it should merely be identified as a container for footnote content.
8. In the Footnote category, deselect the Generates reference mark and footnote option. You will see that the special context fn[@id] (Footnote Area Properties) disappears, and the description of the fn[@id] context changes to Inline, Footnote (content). Here you have specified that, if its id attribute contains a value, the fn element will generate the footnote content only, and another element will produce the footnote and reference mark.
9. Select the xref element in the Elements list.
10. Assign the Cross Reference style to the xref element via the Edit > Style menu option.
The Cross Reference Details dialog box opens.
11. Select href 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.
12. With the xref element still selected, select Insert > Context to create a new context.
The New Context dialog box opens.
13. Select XPath Predicate from the Position list.
The XPath Predicate dialog box opens.
14. Enter @type='fn' in the XPath Predicate field then click OK to close the dialog box. The context xref[@type='fn'] appears in the New Context dialog box. Here you have specified that the xref element will match when its type attribute has a value of fn.
15. Click OK to save the new context and close the New Context dialog box.
16. Select the xref[@type='fn'] context in the Elements list.
17. 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[@type='fn'] (Footnote Area Properties) has been created and the description of the xref[@type='fn'] context is now Footnote (reference).
Here you are specifying that, when the cross reference is of type “fn”, 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.
18. Select the href attribute from the Reference attribute list to confirm the correct target 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.
19. Refer to the Description tab for the xref[@type='fn'] context - you can see that the context is described as Footnote (reference).
20. Select the xref[@type='fn'] context in the Elements list and assign the desired formatting properties for the reference mark. For example, give it a Text color of Red in the Text category. Then you can ascertain when the reference mark has been generated by the xref element because the id attribute on the fn element contains a value (Reference Model), rather than by the fn element itself (Inline Model).
21. Select the special (Footnote Area Properties) context for the fn element in the Elements list and assign the desired formatting properties for the footnote body.
22. With the xref[@type='fn'] context selected, navigate to the Generated text category - note that it is set to generate a number in the Before-text field. Thus the reference mark for the footnote will be output in the form of the footnote number when the xref generates the footnote.
23. In Arbortext Editor, create a footnote in the document by inserting an fn element anywhere the element is permitted, preferably on a page other than the first one. Add the text that should form the footnote content.
24. In Arbortext Styler, choose Preview > Print. In the print preview window, note that the footnote marker has been generated in the place where the fn element was inserted and the footnote appears at the bottom of the page. The footnote marker is displayed in black text as this footnote is working from the Inline Model - the fn element has generated both footnote and marker.
25. Change the fn element you added previously to include the target attribute id=”footnote1”.
26. Carry out the print preview operation again. You will see that no footnote or reference is generated. Since the fn element now has a value for the id attribute the footnote should be generated using the Reference Model. However, since the document contains no xref element with an equivalent IDREF attribute, the footnote cannot be generated.
27. 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
href
#topicID/footnote1
type
fn
28. In Arbortext Styler, choose Preview > Print again. In the print preview window, note that the reference marker appears at the place in the document where you inserted the xref element. The marker is in red text as it has been generated by the xref element, following the Reference Model. At the bottom of the page that contains the footnote reference, note that the footnote now appears.
It is possible to designate an attribute that can be used to specify the character to be used as the superscript reference marker for the footnote. You may enter a particular value for the callout attribute for the footnote element, and if this attribute value is present the character will be used as the superscript reference marker for the footnotes. Permitted values for the attribute are numbers, alpha characters or graphics. The procedures below explain how to incorporate this feature in the Inline and Reference footnote models, which you can combine to form the Hybrid footnote model as described in the previous section.
Example: Modifying a Hybrid Model Footnote
1. To set general formatting options for the footnotes in your document, select Tools > Format Footnotes in Arbortext Styler to open the Footnotes dialog box.
2. Use the options in the Footnotes dialog box to determine the width, style, and scope of your footnotes. You can also specify the amount of space to leave above footnotes and whether there should be a separator rule between the footnotes and the document body text.
You may use this dialog box to elect to have footnote numbering restart within the scope of specified contexts. When Arbortext Styler encounters one of the contexts you have listed in the Contexts that restart footnote numbering field it will restart footnote numbering at 1, with numbering continuing consecutively until it reaches either another listed context or the end of the document.
* 
If you elect to have footnote numbering start at a particular level of nested element, numbering will be restarted at all contexts of that element at the same level. For example, if you specify that numbering should restart at the section in section context, it will also restart when Arbortext Styler encounters any similar contexts at the same level, for example:
section in section
first section in section
not first section in section
section in section in preface
3. Select the regular context for the fn element in the Elements list.
4. Assign the desired formatting properties for the footnote reference mark. You can assign different properties to different types of output using the Outputs to edit list.
5. Select the special (Footnote Area Properties) context for the fn element in the Elements list.
6. Assign the desired formatting properties for the footnote body. You can assign different properties to different types of output using the Outputs to edit list.
7. Select the xref[@type='fn'] context for the xref element in the Elements list.
8. Assign the desired formatting properties for the footnote reference mark. You can assign different properties to different types of output using the Outputs to edit list.
9. Select the xref[@type='fn'] (Footnote Area Properties) context for the xref element in the Elements list.
10. Assign the desired formatting properties for the footnote body. You can assign different properties to different types of output using the Outputs to edit list.