Using an External XSLT Processor

In addition to a built-in XSLT processor, Stylus Studio includes several third-party XSLT processors, including Xalan-J, MSXML .NET, and Saxon (6 and 8). Note, however, that only the following XSLT processors support Stylus Studio stylesheet debugging and backmapping functionality:

  • Stylus Studio's built-in XSLT processor
  • Xalan-J
  • MSXML .NET
  • Saxon 6 and 8

These features are not supported by other XSLT processors, including others bundled with Stylus Studio (MSXML 4.0, for example).

Note

 

You can use only the built-in XML parser with Stylus Studio.

  

This section discusses the following topics:

How to Use an External Processor

You specify XSLT processors on an individual stylesheet basis. When you use an external XSLT processor, output from the processor appears in the Preview window.

To use an external XSLT processor:
1. Open the stylesheet for which you want to use the external processor.
2. In the XSLT editor, in the scenario name field, click the down arrow to display the scenarios associated with the stylesheet.
3. To use an external processor for an existing scenario, click the scenario name, and then click to display the Scenario Properties dialog box.

To create a new scenario, click Create Scenario. See Creating a Scenario.

4. In the Scenario Properties dialog box that appears, click the Processor tab.
5. Click the radio button associated with the XSLT processor you want to use. Note that they are grouped based on whether or not they support Stylus Studio XSLT debugging and backmapping.

Note

 

Stylus Studio allow you to choose an MSXML option only if you have the MSXML or MSXML .NET processor installed.

  

6. If you selected a standard XSLT processor, you are done. Click OK.

If you selected Use custom processor (%1 xml, %2 xslt, %3 output):

a. In the Command line field, type the command line for invoking the processor you want to run. You must specify the command line so that it is clear where to use the three arguments. Following are two examples:
myparser %1 %2 %3
       
myparser -inputxslt %2 -inputxml %1 -out %3
       

    
b. In the Path field, specify any path that needs to be defined for the processor to run. Typically, this is the location of the processor.
c. In the Classpath field, type any directories the external processor needs to access that are not already specified in your CLASSPATH environment variable.
d. Click OK.

Passing Parameters

To pass parameters to the Stylus Studio built-in XSLT processor or to the Xalan-J, MSXML .NET, Saxon, or MSXML processor, specify them in the Parameters tab of the Scenario Properties dialog box. To pass parameters to a custom external processor, you must specify them in the command line you enter.

Options for Using External Processors

If you want, you can specify external XSLT processor options that Stylus Studio uses whenever you specify the use of a particular external processor in a scenario. If you use a particular external processor frequently, and you specify default values in the external XSLT options page, you do not need to enter the information for each scenario. You would just need to indicate which processor you want to use.

If you specify default values and you then specify different values in a scenario's properties, the scenario properties override the defaults.

To set external XSLT processor options:
1. From the Stylus Studio menu bar, select Tools > Options.

Stylus Studio displays the Options dialog box.

2. Expand Module Settings and XSLT Editor.
3. Click External XSLT.

Figure 211. Options for External XSLT Processors
4. Edit the options.
5. Click OK.

Xalan-J XSLT Processor Options

For the Xalan-J XSLT processor, you can specify any of the following:

  • Default additional path
  • Default additional class path
  • Additional JVM options

Custom XSLT Processor Options

For a custom XSLT processor, you can specify any of the following:

  • Default command line
  • Default additional path
  • Default additional class path
 
Free Stylus Studio XML Training: