|
Home > Online Product Documentation > Table of Contents > Debugging Stylesheets - Getting Started Debugging Stylesheets - Getting StartedThe Stylus Studio debugger allows you to follow XSLT processing and detect errors in your stylesheets. Stylus Studio includes sample files that you can experiment with to learn how to use the debugger. To get you started, this section provides step-by-step instructions for using the debugger with these sample files. You should perform the steps in each topic in the order of the topics. For complete information about how to use the debugger, see Chapter 6Debugging Stylesheets. In addition, Stylus Studio allows you to observe and debug the interaction between your Java code and XML data. See Debugging Java Files. This section includes the following topics: Before you beginTo get started, you'll need to start Stylus Studio if you haven't already. See Starting Stylus Studio. Setting Up Stylus Studio to Debug Sample FilesTo set up Stylus Studio to debug sample files:
1. In the Stylus Studio tool bar, select
File >
Open.
2. In the
Open dialog box that Stylus Studio displays, navigate to the
examples\VideoCenter directory in your Stylus Studio installation directory and open the
videosDebug.xsl stylesheet.
Alternative: If the Stylus Studio
Project window is open, you can access this stylesheet from the
Stylus Studio displays the
3. In the XSLT editor tool bar, click
Preview Result
DebugVideosScenario. The source XML document is
videos.xml.
Stylus Studio applies the stylesheet and displays the results (a finished HTML page that displays information about a single video) in the Preview window.
Inserting a Breakpoint in the Sample StylesheetThis topic is part of a sequence that starts with Setting Up Stylus Studio to Debug Sample Files. As with any debugger, in the Stylus Studio XSLT debugger you insert a breakpoint where you want to suspend processing and examine what is going on. You can do this using the Debug menu or the debug set of tools in the tool bar.
To insert a breakpoint in the sample stylesheet:
1. In the XSLT Editor, click in line 202. Line numbers appear in the lower right corner of the XSLT Editor window. Line 202 starts with
2. In the Stylus Studio tool bar, click
Toggle Breakpoint
Alternative: If you prefer, select Debug > Toggle Breakpoint, or press F9.
Stylus Studio displays a red circle to the left of the line that contains the
Do not do it, but to remove a breakpoint, you click in the line that has the breakpoint and then click Toggle Breakpoint (or F9). The Toggle Breakpoint button and F9 key operate as toggles.
3. Press F5 to start debugging.
Alternative:
In the Stylus Studio tool bar, click
Start Debugging
The XSLT processor displays a yellow triangle to indicate where processing has been suspended. Instead of the finished HTML created when you first ran the scenario, the Preview window displays just the HTML code because complete processing of the XSLT was suspended before the finished HTML could be rendered.
Do not do it, but to stop debugging, you can click
Cancel in the lower right corner of the XSLT editor window, or click
Stop Debugging
If you click
Preview Result
Gathering Debug Information About the Sample FilesThis topic is part of a sequence that starts with Setting Up Stylus Studio to Debug Sample Files. When XSLT processing is suspended at a breakpoint, Stylus Studio displays the Variables, Call Stack, and Watch windows.
You can use the information in these windows to learn about potential and actual problems encountered in your XSLT processing.
The Variables WindowThe Variables window displays a list of variables and their values when processing was suspended.
As you can see, the stylesheet defines the
The Call Stack WindowThe Call Stack window displays a history of the steps the processor performed to reach the point at which processing was suspended, including the names of the templates that are currently instantiated, in most recent-to-oldest order.
In this example, the XSLT processor has instantiated the
To step out of debug, click Step out
|

Cart


