Scenario Settings

Stylus Studio generates Java code based on the scenarios you have defined for an XSLT document. The following tables summarizes the scenario settings that have an effect on Java code generation.

Tab
Comment
General
The Java Code Generation wizard uses only the Source XML URL, and the Output URL field, if specified. All other properties on this page are ignored.
Parameter Values
Default parameter values and parameters in the form of XPath expressions are ignored.
Processor
You must use a Saxon or XalanJ processor. The Stylus Studio URI Resolver is also used to resolve non-standard URIs if you select the check box on the Processor page.
Profiling Options
Ignored.
Validation
Validation is optional. If you choose to validate XSLT output, the Java Code Generation wizard always uses the Xerces-J processor, regardless of the validator you specify on the Validation tab. If you want to specify external schemas for validation purposes, click Use built-in validator. Note that the Xerces-J processor is used for validation even in this case.
Post-process
Only post-processing using Apache FOP is specified in the generated code. Resulting PDF is written to the output URL.
Table 35. Scenario Settings that Affect Java Code Generation

Choosing Scenarios

You can generate Java code for one or more of the scenarios defined for a single XSLT document. By default, the Java Code Generation wizard selects only the current scenario for generation, as shown in Figure 226.

Figure 226. The Current Scenario Is Selected for Code Generation

The generated code includes a setScenario method for every scenario you select for code generation, as shown in the following example.

// Uncomment the setScenario call for the scenario you want the code to run.
               
// All other scenarios must be commented out.
               
   app.setScenario_myScenario();
               
// app.setScenario_Scenario1();
               
// app.setScenario_Video_0032_Scenario_0032_1()
               

            

Only one setScenario method can be called at a time. Uncomment the setScenario method for the scenario you want the code to process, and make sure that all other setScenario methods are commented.

 
Free Stylus Studio XML Training: