Home >Online Product Documentation >Table of Contents >XSLT Scenarios
This topic is part of a sequence. If your-quotes.xsl is not open, see Opening a Sample Stylesheet. The sequence starts with Exploring the XSLT Source Tab.
To apply a stylesheet to an XML document in Stylus Studio, you use a scenario. A scenario is a group of customizable settings that allows you to experiment with different source XML documents (that is, the XML document to which you will apply the XSLT), processors, parameter values, post-processors, and profiling settings. You can also use scenarios to perform validation on the XML document that results from the XSLT processing. (Validation is always performed before any post-processing you specify.)
You can define multiple scenarios using different settings to see how each affects document processing. Stylus Studio also supports scenarios for Web service calls, XQuery, and XML pipelines.
An XSLT scenario is defined by a single stylesheet-XML document pair. You can associate any number of scenarios with a stylesheet, though only one scenario can be in effect at the time the XSLT is processed. Similarly, you can associate any number of scenarios with an XML source document.
Stylus Studio lets you work with several XSLT processors, including Saxon, MSXML and .NET.
A scenario has already been created for the your-quotes.xsl stylesheet, using the your-quotes.xml as the source XML document. Run the scenario now and look at the output created by the XSLT defined in your-quotes.xsl.
Stylus Studio processes the source XML document using the XSLT stylesheet you specify and displays the results in the Preview window.
By default, results are displayed using a Web browser. If you choose, you can display results in tree or text format, by clicking Preview in Tree and Preview Text in the Preview window tool bar.
Use the scroll bar to review the HTML in the Preview window. You can see that the values come from the XML document your-quotes.xml.
If it is not already open, you can open the source XML document specified in a scenario by clicking Open XML From Scenario in the XSLT Editor tool bar.
To define additional scenarios, click the down arrow next to the scenario field in the XSLT Editor tool bar, and click Create Scenario. After you have more than one scenario, click the same down arrow to select the scenario you want to use to preview a result.
To change the properties of a scenario, or to delete a scenario, select the scenario you want to change or delete, and then click Browse to the right of the scenario name field. Stylus Studio displays the Scenario Properties dialog box.
When you preview a result, Stylus Studio automatically saves the changes you have made to the document. If you want to revert to the document's previous state, you can use the undo function (Edit > Undo).
Notice the tab at the bottom of the XSLT Preview window. It specifies your-quotes [your-quotes.xsl]. After you create another scenario and apply the stylesheet in that scenario, another tab with the name of that scenario will be displayed. You can click the tab for the result you want to view and easily compare result documents from different scenarios.