|
Home > Online Product Documentation > Table of Contents > Creating an XSLT Scenario Creating an XSLT Scenario
An
XSLT scenario is a group of settings that Stylus Studio uses to process the XSLT when you click the
Preview Result button (
Even if you do not explicitly create a scenario, Stylus Studio uses default scenario settings in order to preview the XSLT. For example, Stylus Studio uses the first source document you specify as the document to which the XSLT is applied. (If the first source document is an XSD or DTD, Stylus Studio prompts you to provide an XML document for the scenario when you preview the XSLT.) This section covers the following topics: Overview of Scenario FeaturesThis section describes the main features of XSLT scenarios. It covers the following topics: Specifying XML Source DocumentsThe main benefit of the XSLT scenario feature is that it lets you specify the XML document against which you want to run your XSLT. By default, Stylus Studio uses the first source document you add using the XSLT mapper as the XML source document for the scenario. You can specify the XML source document setting on the General tab of the Scenario Properties dialog box.
For more informationSee Source Documents to learn more about the process of selecting and working with source documents in XSLT mapper. Setting Values for Global ParametersThe Parameter Values tab of the Scenario Properties dialog box displays any global parameters you have defined in the XSLT source and allows you to For example, imagine the following parameter defined in the XSLT source:
This parameter is displayed on the Parameter Values tab as follows:
If you want to specify an alternate parameter value for this scenario, click the Parameter value to be used when processing entry field. If the alternate value you enter is an XPath expression, click the associated check box.
Choosing an XSLT ProcessorBy default, Stylus Studio uses a built-in processor to process the XSLT you compose. You can select other supported processors on the Processor tab, or use this tab to specify an external or custom processor. Performance Metrics Reporting
Stylus Studio can generate an HTML report that contains information about how your XSLT is being processed. This option is off by default, but you can enable it, and choose options for the report, on the Profiling Options tab. See Profiling XSLT Stylesheets to learn more about the different ways in which Stylus Studio can provide you with XSLT performance metrics. Performing Post-ProcessingYou can use the Post-process tab to specify any optional processing you want performed on the XML after it has been processed by the XSLT. How to Create a ScenarioTo create a scenario:
1. In the XSLT editor toolbar, click
Alternative: Select Create Scenario from the scenario drop-down list at the top of the editor window. Stylus Studio displays the Scenario Properties dialog box.
2. In the
Scenario name: field, type the name of the new scenario.
3. In the
Source XML URL (optional): field, type the name of the XML file to which you want to apply the XSLT, or click
Browse
4. In the
Output URL field, optionally type or select the name of the result document you want the XSLT document to generate. If you specify the name of a file that does not exist, Stylus Studio creates it when you preview the XSLT.
5. If you want Stylus Studio to
Store paths relative to XSLT document path, ensure that this option is checked.
6. If you check
Preview result in an external application, Stylus Studio displays the result Internet Explorer. In addition, Stylus Studio always displays XSLT results in the
Preview window
7. Optionally, configure settings for global parameters, the XSLT processor you want to use, whether or not you want to run a profiling report, and whether or not you want to perform any post-processing on the XSLT result. See
Overview of Scenario Features for more information.
8. To define another scenario, click
Add and enter the information for that scenario. You can also copy scenarios. See
How to Clone a Scenario.
9. Click
OK.
If you start to create a scenario and then change your mind, click Delete and then OK. How to Run a ScenarioTo run a scenario:
1. Select a scenario from the scenario drop-down list at the top of the editor window.
Alternative:
a. In the XSLT editor toolbar, click
Stylus Studio displays the Scenario Properties dialog box.
b. On the
General tab, select the scenario you want to run from the
Existing Scenarios list.
c. Click
OK.
2. Click the
Preview Result button (
How to Clone a ScenarioWhen you clone a scenario, Stylus Studio creates a copy of the scenario except for the scenario name. This allows you to make changes to one scenario and then run both to compare the results. To clone a scenario:
1. Display the XSLT in the scenario you want to clone.
2. In the XSLT editor toolbar, click
3. In the
Scenario Properties dialog box, in the
Existing preview scenarios field, click the name of the scenario you want to clone.
4. Click
Clone.
5. In the
Scenario name field, type the name of the new scenario.
6. Change any other scenario properties you want to change. See
How to Create a Scenario.
7. Click
OK.
If you change your mind and do not want to create the clone, click Delete and then OK. |

Cart


