Generate C# .NET Code for XML Pipeline

You use the Generate C# .NET Code for XML Pipeline dialog box to specify the properties you want to use when generating C# code for your XML pipeline.


Target directory

The target directory in which you want the C# code created. c:\temp\myPipelineC#Code, for example. If the directory you name does not exist, Stylus Studio creates it when you run the Code Generation wizard. The default is the same directory as the .pipeline file.


Stylus Studio uses the namespace name to create a folder in the target directory you specify. If you use myNamespace, for example, the generated code is written to c:\temp\myPipelineC#Code\myNamespace. (Though optional, it is considered good practice to create a namespace.)

Class name

Stylus Studio uses the class name for the .cs file created by the Code Generation wizard. For example, if you provide the name myClass, Stylus Studio creates c:\temp\myPipelineC#Code\myClass.cs. Stylus Studio uses the XML pipeline name as the default class name.

Saxon .NET folder

Allows you to specify the location of Saxon .NET on your system. Stylus Studio adds this URL to the Microsoft Visual Studio 2005 project, allowing the generated C# code for .NET to compile.

Create a Main method

Whether or not you want the resulting .cs file to contain a static void Main(String
[ ] args)

Execution log

Specifies the argument for the setExecutionLog method in the generated application. Choices are Console.out (the default), Console.err, and Quiet. Set to Quiet to turn off the log.

Open the generated file

Whether or not you want to open the generated code file. If selected, the generated C# file is opened in whatever application is registered to open .cs files.

Embed the XQuery source in the generated program

Whether or not you want to embed the XQuery source in the generated C# code. This option is available when using either the Saxon XQuery or DataDirect XQuery processors. This option is available only if the Generate inline code check box is selected.

Add the class to a Visual Studio 2005 project

Either creates a new Visual Studio 2005 project or updates an existing one. If a new project is created, it is automatically opened with whatever application is registered to open .csproj files. The .csproj file contains all the necessary references to the generated .cs file, as well as all the .dll files that the .cs file requires.

To run the .cs file, simply press Ctrl+F5 in Visual Studio.

For More Information

Generating Code for an XML Pipeline

Execution Framework and Code Generation

Specifying an Execution Framework

Deployment Considerations

Free Stylus Studio XML Training:
W3C Member