XSLT Debugger Features:
- Support for XSLT 1.0, XSLT 2.0, XSLT 3.0
- Step-by-step node transformation
- Stepping into, out, and over nodes
- Setting breakpoints and tracepoints
- Context information window
- Call stack window
- XML, XSLT, and output panes displayed in parallel
- XSLT Profiler and XSL Speed Optimizer to optimize transformations
The high-performance XMLSpy XSLT debugger is powered by RaptorXML, Altova's third-generation, lightning-fast XML validator and processing engine.
XMLSpy also includes a powerful XSLT profiler to help you further optimize XSLT code by helping you identify and remove bottlenecks.
Testing XSLT Code
You can start the XSLT debugger at any time when working with an XML or XSLT file. If a permanent XML / XSLT file designation has not been specified, XMLSpy will prompt you to select the associated file. The XSLT debugger includes a three-panel interface (shown in the image at the top of this page) that displays the XML document, the associated XSLT stylesheet, and the output document as it is being built in real-time. Below the three panels, Context and Callstack information windows include multiple tabs that supply all the necessary debugging information.
Depending on the complexity of your XSLT stylesheet and your personal preferences, the XSLT debugger allows you to debug XML and XSLT files in Advanced Text View or Grid View, and view the dynamic output in Advanced Text, Grid, and Browser View, switching between the different views as required.
The XSLT debugger allows you to move through the transformation step-by-step, and you can step into, step out, and step over nodes. It highlights the current instruction in the XSLT and the current node in the XML file, and produces output for each step, highlighted in the output pane. Seeing all three factors at the same time provides you with an immediate visual understanding of the way that your code is rendering the XML data.
Setting Breakpoints & Tracepoints
When debugging complex XSLT stylesheets, it is useful to be able to understand exactly what output is produced by each instruction. In the XSLT debugger, you can define breakpoints in the XML and XSLT files, and tracepoints in the XSLT document.
Breakpoints halt the XSLT debugger when a particular node, element, or attribute is accessed by an XSLT instruction, allowing you to view the output to that particular point in the transformation. When you start the debugger, the XSLT processor stops at the first breakpoint and displays all data relevant to the node in the debugger info windows.
In contrast to breakpoints, tracepoints do not halt the XSLT debugger. When a tracepoint is hit during an XSLT debugging session, the instruction is executed, and information is written to the Trace window. Once the transformation is complete, the trace window displays the list of tracepoints as well as the output produced by each. This allows you to view exactly how each XSLT instruction is executed.
Debugging and Perfecting XSLT Stylesheets
As you’re debugging a stylesheet, the XSLT debugger presents you with several useful pieces of information. To supplement the information shown in the output pane and Trace window, the debugging information windows display additional important details.
The Context information window includes the following tabs:
- Context: displays the context node and associated attributes or value(s).
- Variables: displays the global, local, and parameter based variables as well as the name and variable value.
- XPath Watch: displays the result of XPath expressions, which are evaluated against the root or context node, depending on how they are entered. You can define the XPath expressions you want to monitor here.
Call Stack Window
Tabs in the Call Stack info window include:
- Call Stack: displays a list of the previously processed XSL instructions and templates, with the current instruction appearing at the top of the list.
- Templates: displays all templates used while debugging the current XSLT file. This includes the provided default templates in the built-in template, as well as any included or imported templates.
- Info: displays information about the type of debugging (XSLT 1.0, 2.0, or 3.0), the files used, and the debugger status.
- Messages: displays the xsl:message instruction(s) or any error messages that may occur during debugging.
- Trace: displays output information for each tracepoint.