<?xml version="1.0" encoding="iso-8859-1"?> <?xml-stylesheet href="../make-menu.xsl" type="text/xsl"?><html> <head> <this-is section="samples" page="dotnetsamples" subpage=""/> <!-- Generated at 2011-12-09T20:47:22.916Z--><title>Saxonica: XSLT and XQuery Processing: Example applications for .NET</title> <meta name="coverage" content="Worldwide"/> <meta name="copyright" content="Copyright Saxonica Ltd"/> <meta name="title" content="Saxonica: XSLT and XQuery Processing: Example applications for .NET"/> <meta name="robots" content="noindex,nofollow"/> <link rel="stylesheet" href="../saxondocs.css" type="text/css"/> </head> <body class="main"> <h1>Example applications for .NET</h1> <p>The <code>/samples/cs</code> directory contains somer sample applications written in C#, designed to illustrate use of the Saxon API available in the <code>Saxon.Api</code> namespace. In particular there are three programs <code>ExamplesHE.cs</code>, <code>ExamplesPE.cs</code>, and <code>ExamplesEE.cs</code> relevant to Saxon-HE, Saxon-PE, and Saxon-EE respectively; each shows various ways of invoking XSLT, XQuery, XPath, and schema validation where appropriate. The idea is that you should be able to cut and paste a suitable fragment of code into your own application as a quick way of getting started.</p> <p>The main value of these samples is in reading the source code rather than in actually running them; however, running them is also a good check that your installation has been set up correctly. a quick look at the comments in the source should enable you to see how they are executed. Note that they all require the environment variable <code>SAXON_HOME</code> to be set to the directory where Saxon is installed: this is used to find the sample data files.</p> <p>The example applications can be run from the command line. They take the following arguments:</p> <ul> <li> <p><b>-dir:<i>samples</i></b> - provides the name of the samples directory from the saxon-resources download. The default uses the SAXON_HOME environment variable - but it's normally best to supply this parameter explicitly.</p> </li> <li> <p><b>-ask:<i>yes|no</i></b> - with ask:yes (the default), the application prompts after each test to ask if you want to continue.</p> </li> <li> <p><b>-test:<i>testname</i></b> - supplies the name of the test you want to run, or "all" (the default) to indicate all tests.</p> </li> </ul> <p>Also in the same directory is an application <code>TestRunnerProgram.cs</code> which is a test harness for running the XSLT, XQuery, and XSD test suites published by W3C (in the case of XSLT, the test data is available to W3C members only).</p> <table width="100%"> <tr> <td> <p align="right"/> </td> </tr> </table> </body> </html>