Chapter 12. Debugging XSLT stylesheets and XQuery documents

Table of Contents

Overview
Layout
Control Toolbar
Information views
Multiple output documents in XSLT 2.0
Working with the XSLT/XQuery Debugger
Steps in a typical debug process
Using breakpoints
Inserting breakpoints
Removing breakpoints
Viewing processing information
Context node view
XPath watch view
Breakpoints View
Break conditions view
Messages View
Stack View
Trace history view
Templates view
Node set view
Variables View
Determining what XSL/XQuery expression generated particular output

Overview

The Debugger perspectives enables you to test and debug XSLT 1.0 /2.0 stylesheets and XQuery 1.0 documents including complex XPath 2.0 expressions. The interface presents simultaneous views of the source XML document, the XSLT/XQuery document and the result document. As you go step by step through the XSLT/XQuery document the corresponding output is generated step by step, and the corresponding position in the XML file is highlighted for each step. At the same time, special views in the interface provide various types of debugging information and events useful for understanding the transformation process.

The user benefits of a rich set of features for testing and solving XSLT/XQuery problems:

  • Support for XSLT 1.0 stylesheets (through the Saxon 6.5.5 and Xalan XSLT engines) , XSLT 2.0 stylesheets and XPath 2.0 expressions that are included in the stylesheets (through the Saxon 9.2.0.6 PE XSLT engine and the Saxon 9.2.0.6 EE one) and XQuery 1.0 (through the Saxon 9.2.0.6 PE XQuery engine and the Saxon 9.2.0.6 EE one).

  • Stepping capabilities: step in, step over, step out, run, run to cursor, run to end, pause, stop.

  • Back mapping between every piece of output and instruction element /source context who generate it .

  • Breakpoints on both source and XSLT/XQuery documents.

  • Call stack view on both source and XSLT/XQuery documents.

  • Trace history on both source and XSLT/XQuery documents.

  • Support for XPath expression evaluation during debugging.

  • Step into imported/included stylesheets as well as included source entities.

  • Available templates and hits count.

  • Variables view.

  • Dynamic output generation.