<%@ page language="C#" masterpagefile="~/templates/Documentation.master" inherits="Page" pagetitle="How to Generate C# Code for XSLT" keywords="How to Generate C# Code for XSLT"%>

How to Generate C# Code for XSLT

To generate C# code for XSLT:
1. Open the XSLT for which you want to generate C# code.
2. Define at least one scenario for the XSLT transformation. The scenario must use the Saxon processor. See <hyperlink>Scenario Properties Used for Generating Code for more information.
3. Select the scenario for which you want to generate C# code.
4. Close the Scenario Properties dialog box.
5. Select XSLT > Generate Code > Generate C# Code from the Stylus Studio menu.

The Generate C# Code dialog box appears. (See Figure 247 .)

6. Specify the settings you want for the target directory, package and class names, and so on. See <hyperlink>C# Code Generation Settings if you need help with this step.
7. Click OK.

Stylus Studio generates C# code for the XSLT. When the code generation is complete, the resulting file (classname.cs) is opened in a third-party editor if you chose the Open the generated file option.