The broad mechanism used for debugging XSLT and XQuery files using the XSLT and XQuery Debugger is given below. Note that there is a difference between a debugging session and the debugger, even though both are started with the XSL/XQuery | Start Debugger / Go command. You must first start the debugging session, and then step through the XSLT or XQuery document with the debugger.
•Open a debugging session (with the XSL/XQuery | Start Debugger / Go command). The appropriate session (XSLT 1.0, XSLT 2.0, XSLT 3.0, XQuery 1.0 or XQuery 3.1) is selected on the basis of the active file (see XSLT and XQuery Debugger). The XSLT and XQuery Debugger works only in Text View and Grid View. If the view of the active document is not Text View or Grid View when you start the debugging session, you will be prompted for permission to change the view to Text View, which is the default view of the XSLT and XQuery Debugger. You can, in the Debugger Settings dialog, also choose to have this option set permanently.
•Step through the XSLT or XQuery document using the Step Into, Step Out, and Step Over commands in the XSL/XQuery menu. (If you click the Start Debugger / Go command at this point, the debugger will go through the entire transformation or execution, stopping only at breakpoints. If no breakpoint has been set, it will go through the transformation in one step, without showing any debug results.) If an XML file is associated with the session, the corresponding locations in the XML file are highlighted. Simultaneously, output for corresponding steps is generated in the result file and the result document is built up step-by-step. In this way, you can analyse what each statement of the XSLT or XQuery file does.
Alternatively to the view of the three documents (XML, XSLT/XQuery, Output) shown above, a view of two documents (XSLT/XQuery and Output), or a view of any one of the documents can be selected.
•While a debugging session is open, information windows in the interface provide information about various aspects of the transformation/execution (Variables, XPath Watch, Call Stack, Messages, Info, etc).
•While a debugging session is open, you can stop the debugger (not the same as stopping the debugging session) to make changes to any of the documents. All the editing features that are available in your XMLSpy environment are also available while editing a file during a debugging session. When the debugger is stopped, the XSLT and XQuery Debugger interface stays open, and you have access to all the information in the information windows. After stopping the debugger in a debugging session, you can restart the debugger (from the beginning of the XSLT/XQuery document) within the same debugging session.
•Breakpoints can be set in the XSLT file to interrupt the processing at selected points. This speeds up debugging sessions since you do not have to step through each statement in the XSLT or XQuery document manually.
•Tracepoints can be set in the XSLT file. For instructions where a tracepoint is set, the value of that instruction is output when the instruction is reached.
•Stop a debugging session. This closes the XSLT and XQuery Debugger interface and returns you to your previous XMLSpy environment. The information in the information windows is no longer available. Breakpoint and tracepoint information, however, is retained in the respective files till the file is closed. (So if you start another debugging session involving a file containing breakpoints, the breakpoints will apply in the newly opened debugging session.)
|Note:||The Debugger toolbar with Debugger icons appears automatically when a debugging session is started.|