Add Markup to the Template Layout

Publisher converts the formatting that you apply in the word processor to XSL-FO. You add markup to create the mapping between the layout and the XML file and to include features that cannot be represented directly in the format.

The most basic markup elements are placeholders, to define the XML data elements; and groups, to define the repeating elements.

Publisher provides tags to add markup to the template. For the XSL equivalents of the Publisher tags, see XSL Equivalents.

Create Placeholders

The placeholder maps the template field to the XML element data field. At runtime the placeholder is replaced by the value of the element of the same name in the XML data file.

Enter placeholders in the document using the following syntax:

<?XML element tag name?>

The placeholder must match the XML element tag name exactly. It's case sensitive.

There're two ways to insert placeholders in the document:

  • Use the Basic RTF Method: Insert the placeholder syntax directly into the template document.

  • Use the Form Field Method: (Requires Microsoft Word) Insert the placeholder syntax in Microsoft Word's Text Form Field Options window. This method allows you to maintain the appearance of the template.

    See Insert a Field.

Use the Basic RTF Method

Enter the placeholder syntax in the document where you want the XML data value to appear.

Enter the element's XML tag name using the syntax:

<?XML element tag name?>

In the example, the template field "Supplier" maps to the XML element VENDOR_NAME. In the document, enter:

<?VENDOR_NAME?>

The entry in the template is shown in the following illustration.

Use the Form Field Method

Placeholder tags can be added using the Form Field method.

To use Microsoft Word's Form Field method to insert the placeholder tags:

  1. Enable the Forms toolbar in the Microsoft Word application.
  2. Position the cursor in the location where you want to create a placeholder.
  3. Select the Text Form Field toolbar icon. This action inserts a form field area in the document.
  4. Double-click the form field area to invoke the Text Form Field Options dialog box.
  5. (Optional) Enter a description of the field in the Default text field. The entry in this field populates the placeholder's position on the template.

    For the example, enter "Supplier 1".

  6. Select the Add Help Text button.
  7. In the help text entry field, enter the XML element's tag name using the syntax:

    <?XML element tag name?>

    You can enter multiple element tag names in the text entry field.

    In the example, the report field "Supplier" maps to the XML element VENDOR_NAME. In the Form Field Help Text field enter:

    <?VENDOR_NAME?>

    The following illustration shows the Text Form Field Options dialog and the Form Field Help Text dialog with the appropriate entries for the Supplier field.

    Tip:

    For longer strings of Publisher syntax, use the Help Key (F1) tab instead of the Status Bar tab. The text entry field on the Help Key (F1) tab allows more characters.
  8. Click OK to apply.

    The Default text is displayed in the form field on the template.

    The following illustration shows the Supplier field from the template with the added form field markup.

Complete the Example

This table shows the entries made to complete the example. The Template Field Name is the display name from the template. The Default Text Entry is the value entered in the Default Text field of the Text Form Field Options dialog box (form field method only). The Placeholder Entry is the XML element tag name entered either in the Form Field Help Text field (form field method) or directly on the template.

Template Field Name Default Text Entry (Form Field Method) Placeholder Entry (XML Tag Name)

Invoice Num

1234566

<?INVOICE_NUM?>

Invoice Date

1-Jan-2004

<?INVOICE_DATE?>

GL Date

1-Jan-2004

<?GL_DATE?>

Curr

USD

<?INVOICE_CURRENCY_CODE?>

Entered Amt

1000.00

<?ENT_AMT?>

Accounted Amt

1000.00

<?ACCTD_AMT?>

(Total of Entered Amt column)

1000.00

<?ENT_SUM_VENDOR?>

(Total of Accounted Amt column)

1000.00

<?ACCTD_SUM_VENDOR?>

This figure shows the Payables Invoice Register with the completed form field placeholder markup. See Use the Basic RTF Method for the completed basic RTF markup.