Debugging a template

You can debug your document templates to solve problems that occur during document generation.

Procedure

  1. In Document Studio, open the template that you want to debug.
  2. Define one or more breakpoints by clicking the Toggle Breakpoint Breakpoint iconor Toggle Conditional Breakpoint Conditional icontoolbar buttons, or right-clicking in the template editor and selecting Debug > Toggle Breakpoint or Toggle Conditional Breakpoint .
    Breakpoints can be set on any number of elements. You can set regular or conditional breakpoints. Conditional breakpoints are same as regular breakpoints but the debugger only stops when the condition is met. This condition is separate from any condition that might be defined on the template element and does not impact the output of the template.
    Note: The debugger does not stop at a conditional breakpoint for a query attribute not used elsewhere in the template. For example, if the template is printing Object text and Object heading, but the conditional breakpoint is on Object Identifier, the debugger does not stop at this point.
  3. Start the debugger by clicking the Debug document generation Debug start toolbar button. The debugger tracks the progress of the debug session by selecting the elements being currently processed.
    Tip: In the Publishing Document window, click the Run in Background button so that this window does not interfere with the debugging process.
  4. When the debugger reaches an element with a breakpoint, the debugger stops. You can inspect the element and the data context in the RPE Debug view. The element context gives the element ID, element type, current recursion level and if the condition on the element passed or not. The data context is made of the template variables and the data elements visible at that location.
    RPE Debug view
  5. Resume the debug session using one of the following 3 options:
    • Resume Next : advances the debugger to the next element in the template. The debugger must be stopped on a breakpoint for this command to be active
    • Resume document generation: resumes the debugger. The debugger stops on the next breakpoint or when the document generation finishes.
    • Resume normal document generation (no debug): resumes the execution and disables all breakpoints.
  6. To remove all breakpoints, click the Clear all breakpointsClear breakpoints toolbar button.

Feedback